r2148: *** 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) $(INSTALLDIRFLAGS) $(clc-source)/mcl
65         $(INSTALL) $(INSTALLFLAGS) $(shell echo src/*.cl *.system) $(clc-source)
66         $(INSTALL) $(INSTALLFLAGS) $(shell echo src/mcl/*.cl) $(clc-source)/mcl
67         $(INSTALL) $(INSTALLFLAGS) doc/html/* $(DOCDIR)/html
68         cp doc/uffi.pdf doc/cl-uffi.pdf
69         rm -f doc/cl-uffi.pdf.gz
70         gzip doc/cl-uffi.pdf
71         $(INSTALL) $(INSTALLFLAGS) doc/cl-uffi.pdf.gz $(DOCDIR)
72         rm -f doc/cl-uffi.pdf.gz
73
74 # Build architecture-independent files here.
75 binary-indep: build install
76
77
78 # Build architecture-dependent files here.
79 binary-arch: build install
80         dh_testdir
81         dh_testroot
82 #       dh_installdebconf       
83         dh_installdocs
84         dh_installexamples examples/*.cl
85 #       dh_installmenu
86 #       dh_installlogrotate
87 #       dh_installemacsen
88 #       dh_installpam
89 #       dh_installmime
90 #       dh_installinit
91 #       dh_installcron
92 #       dh_installman
93 #       dh_installinfo
94 #       dh_undocumented
95         dh_installchangelogs ChangeLog
96         dh_link $(clc-source) $(SOURCEDIR)
97         dh_strip
98         dh_compress
99         dh_fixperms
100 #       dh_makeshlibs
101         dh_installdeb
102 #       dh_perl
103         dh_shlibdeps
104         dh_gencontrol
105         dh_md5sums
106         dh_builddeb
107
108 binary: binary-indep binary-arch
109 .PHONY: build clean binary-indep binary-arch binary install configure
110