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