81dd430948ccf07b79e91ff9265e1f4d87bd2de4
[uffi.git] / debian / rules
1 #!/usr/bin/make -f
2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 to 1999 by Joey Hess.
4
5 # Uncomment this to turn on verbose mode.
6 # export DH_VERBOSE=1
7
8 # This is the debhelper compatibility version to use.
9 export DH_COMPAT=4
10
11 pkg     := uffi
12 debpkg  := cl-uffi
13
14 UPSTREAM_VER    := $(shell sed -n -e "s/${debpkg} (\(.*\)-[0-9.]).*/\1/p" < debian/changelog |head -1)
15
16 pkg-ver         := $(debpkg)-$(UPSTREAM_VER)
17 clc-source      := usr/share/common-lisp/source
18 clc-systems     := usr/share/common-lisp/systems
19 clc-uffi        := $(clc-source)/$(pkg)-$(UPSTREAM_VER)
20
21 doc-dir         := usr/share/doc/${debpkg}
22 lispfiles       := $(clc-uffi)
23
24
25 configure: configure-stamp
26 configure-stamp:
27         dh_testdir
28         # Add here commands to configure the package.
29
30         touch configure-stamp
31
32
33 build: build-stamp
34
35 build-stamp: configure-stamp 
36         dh_testdir
37
38         # Add here commands to compile the package.
39
40         touch build-stamp
41
42 clean:
43         dh_testdir
44         dh_testroot
45         rm -f build-stamp configure-stamp
46
47         # Add here commands to clean up after the build process.
48         -$(MAKE) clean
49         rm -f debian/cl-uffi.postinst.* debian/cl-uffi.prerm.*
50
51         dh_clean
52
53 install: build
54         dh_testdir
55         dh_testroot
56         dh_clean -k
57         dh_installdirs --all $(clc-systems) $(clc-source) 
58         dh_installdirs -p $(debpkg) $(doc-dir) $(lispfiles)/mcl 
59
60         # Add here commands to install the package into debian/uffi.
61         dh_install "src/*.cl" "*.system" $(lispfiles)
62         dh_install "src/mcl/*.cl" $(lispfiles)/mcl
63
64         rm -rf doc/html
65         (cd doc; tar xzf html.tar.gz; cd ..)
66         dh_install doc/html $(doc-dir)
67         rm -rf doc/html
68         cp doc/uffi.pdf doc/cl-uffi.pdf
69         gzip -9 doc/cl-uffi.pdf
70         dh_install doc/cl-uffi.pdf.gz $(doc-dir)
71
72 # Build architecture-independent files here.
73 binary-indep: build install
74
75
76 # Build architecture-dependent files here.
77 binary-arch: build install
78         dh_testdir
79         dh_testroot
80 #       dh_installdebconf       
81         dh_installdocs
82         dh_installexamples examples/*.cl
83 #       dh_installmenu
84 #       dh_installlogrotate
85 #       dh_installemacsen
86 #       dh_installpam
87 #       dh_installmime
88 #       dh_installinit
89 #       dh_installcron
90 #       dh_installman
91 #       dh_installinfo
92 #       dh_undocumented
93         dh_installchangelogs ChangeLog
94         dh_strip
95         dh_compress
96         dh_fixperms
97         dh_link -p $(debpkg) $(clc-uffi) $(clc-source)/$(pkg)
98 #       dh_makeshlibs
99         dh_installdeb
100 #       dh_perl
101         dh_shlibdeps
102         dh_gencontrol
103         dh_md5sums
104         dh_builddeb
105
106 binary: binary-indep binary-arch
107 .PHONY: build clean binary-indep binary-arch binary install configure
108