r2147: *** empty log message ***
[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 prefix  := debian/$(debpkg)
14
15 INSTALL := install
16 INSTALLFLAGS    := -g root -o root -m 0644
17 INSTALLDIRFLAGS := -d -g root -o root -m 0755
18
19 SOURCEDIR       := $(prefix)/usr/share/common-lisp/source/${pkg}
20 DOCDIR          := $(prefix)/usr/share/doc/${debpkg}
21
22 UPSTREAM_VER    := $(shell sed -n -e "s/${debpkg} (\(.*\)-[0-9.]).*/\1/p" < debian/changelog |head -1)
23
24 clc-source      := $(SOURCEDIR)-$(UPSTREAM_VER)
25
26 configure: configure-stamp
27 configure-stamp:
28         dh_testdir
29         # Add here commands to configure the package.
30
31         touch configure-stamp
32
33
34 build: build-stamp
35
36 build-stamp: configure-stamp 
37         dh_testdir
38
39         # Add here commands to compile the package.
40         # Make doc isn't necessary because the docs are in the upstream version
41         # $(MAKE) doc
42
43         touch build-stamp
44
45 clean:
46         dh_testdir
47         dh_testroot
48         rm -f build-stamp configure-stamp
49
50         # Add here commands to clean up after the build process.
51         -$(MAKE) clean
52         rm -f debian/cl-uffi.postinst.* debian/cl-uffi.prerm.*
53
54         dh_clean
55
56 install: build
57         dh_testdir
58         dh_testroot
59         dh_clean -k
60         dh_installdirs
61
62         # Add here commands to install the package into debian/uffi.
63         $(INSTALL) $(INSTALLDIRFLAGS) $(clc-source)
64         $(INSTALL) $(INSTALLFLAGS) $(shell echo src/*.cl *.system) $(clc-source)
65         $(INSTALL) $(INSTALLFLAGS) $(shell echo src/mcl/*.cl) $(clc-source)/mcl
66         $(INSTALL) $(INSTALLFLAGS) doc/html/* $(DOCDIR)/html
67         cp doc/uffi.pdf doc/cl-uffi.pdf
68         rm -f doc/cl-uffi.pdf.gz
69         gzip doc/cl-uffi.pdf
70         $(INSTALL) $(INSTALLFLAGS) doc/cl-uffi.pdf.gz $(DOCDIR)
71         rm -f doc/cl-uffi.pdf.gz
72
73 # Build architecture-independent files here.
74 binary-indep: build install
75
76
77 # Build architecture-dependent files here.
78 binary-arch: build install
79         dh_testdir
80         dh_testroot
81 #       dh_installdebconf       
82         dh_installdocs
83         dh_installexamples examples/*.cl
84 #       dh_installmenu
85 #       dh_installlogrotate
86 #       dh_installemacsen
87 #       dh_installpam
88 #       dh_installmime
89 #       dh_installinit
90 #       dh_installcron
91 #       dh_installman
92 #       dh_installinfo
93 #       dh_undocumented
94         dh_installchangelogs ChangeLog
95         dh_link $(clc-source) $(SOURCEDIR)
96         dh_strip
97         dh_compress
98         dh_fixperms
99 #       dh_makeshlibs
100         dh_installdeb
101 #       dh_perl
102         dh_shlibdeps
103         dh_gencontrol
104         dh_md5sums
105         dh_builddeb
106
107 binary: binary-indep binary-arch
108 .PHONY: build clean binary-indep binary-arch binary install configure
109