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