* tests/foreign-loader.lisp: Commit patch from Luis Oliveira
[uffi.git] / debian / rules
1 #!/usr/bin/make -f
2
3 pkg             := uffi
4 pkg-tests       := $(pkg)-tests
5 debpkg          := cl-$(pkg)
6 debpkg-tests    := $(debpkg)-tests
7
8
9 clc-source      := usr/share/common-lisp/source
10 clc-systems     := usr/share/common-lisp/systems
11 clc-files       := $(clc-source)/$(pkg)
12 clc-tests       := $(clc-source)/$(pkg-tests)
13 doc-dir         := usr/share/doc/$(debpkg)
14 lib-dir         := usr/lib/uffi
15
16 configure: configure-stamp
17 configure-stamp:
18         dh_testdir
19         # Add here commands to configure the package.
20         touch configure-stamp
21
22
23 build: build-stamp
24
25 build-stamp: configure-stamp 
26         dh_testdir
27         # Add here commands to compile the package.
28         (cd tests; make)
29         touch build-stamp
30
31 clean:
32         dh_testdir
33         dh_testroot
34         rm -f build-stamp configure-stamp
35         # Add here commands to clean up after the build process.
36         $(MAKE) clean
37         (cd tests; make clean)
38         rm -f debian/$(debpkg).postinst.* debian/$(debpkg).prerm.*
39         rm -f doc/cl-uffi.pdf.gz
40         dh_clean
41
42 install: build
43         dh_testdir
44         dh_testroot
45         dh_clean -k
46         dh_installdirs --all $(clc-systems) $(clc-source) 
47
48         # Add here commands to install the package into debian/uffi.
49         dh_installdirs -p $(debpkg) $(doc-dir) $(clc-files)/src
50         dh_install $(pkg).asd $(clc-files)
51         dh_install "src/*.lisp" $(clc-files)/src
52         dh_link $(clc-files)/$(pkg).asd $(clc-systems)/$(pkg).asd
53
54         rm -rf doc/html
55         (cd doc; tar xzf html.tar.gz; cd ..)
56         dh_install doc/html $(doc-dir)
57         rm -rf doc/html
58         cp doc/uffi.pdf doc/cl-uffi.pdf
59         rm -f doc/cl-uffi.pdf.gz # ensure file not present before making gz
60         gzip -9 doc/cl-uffi.pdf
61         dh_install doc/cl-uffi.pdf.gz $(doc-dir)
62
63         dh_installdirs -p $(debpkg-tests) $(clc-tests)/tests $(lib-dir)
64         dh_install -p $(debpkg-tests) $(pkg-tests).asd $(clc-tests)
65         dh_install -p $(debpkg-tests) tests/*.lisp tests/*.c $(clc-tests)/tests
66         dh_install -p $(debpkg-tests) tests/*.so $(lib-dir)
67         dh_link -p $(debpkg-tests) $(clc-tests)/$(pkg-tests).asd $(clc-systems)/$(pkg-tests).asd
68
69 # Build architecture-independent files here.
70 binary-indep: build install
71         dh_testdir -i
72         dh_testroot -i
73         dh_installdocs -i
74         dh_installexamples -i examples/*.lisp
75         dh_installmenu -i
76         dh_installcron -i
77         dh_installinfo -i
78         dh_installchangelogs ChangeLog -i
79         dh_link -i
80         dh_compress -i
81         dh_fixperms -i
82         dh_installdeb -i
83         dh_gencontrol -i
84         dh_md5sums -i
85         dh_builddeb -i
86
87 # Build architecture-dependent files here.
88 binary-arch: build install
89         dh_testdir -a
90         dh_testroot -a
91         dh_installdocs -a
92         dh_installchangelogs ChangeLog -a
93         dh_strip -a
94         dh_link -a
95         dh_compress -a
96         dh_fixperms -a
97         dh_installmenu -a
98         dh_installdeb -a
99         dh_shlibdeps -a
100         dh_gencontrol -a
101         dh_md5sums -a
102         dh_builddeb -a
103
104 binary: binary-indep binary-arch
105 .PHONY: build clean binary-indep binary-arch binary install configure
106