chiark / gitweb /
autoconf-generated files included in CVS; Changelogs merged
[userv.git] / debian / rules
1 #!/usr/bin/make -f
2
3 package=userv
4 revision=$(shell dpkg-parsechangelog | sed -n 's/^Version:.*-//p')
5 verext=-$(revision)deb
6
7 build:
8         $(checkdir)
9         ./configure --prefix=/usr
10         $(MAKE) VEREXT=$(verext)
11         $(MAKE) spec.html VEREXT=$(verext)
12         touch build
13
14 clean:
15         $(checkdir)
16         -rm -f build
17         -$(MAKE) -i distclean || $(MAKE) -f Makefile.in distclean
18         -rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars*
19
20 binary-indep:   checkroot build
21         $(checkdir)
22 # There are no architecture-independent files to be uploaded
23 # generated by this package.  If there were any they would be
24 # made here.
25
26 binary-arch:    checkroot build
27         $(checkdir)
28         -rm -rf debian/tmp
29         install -d debian/tmp/{DEBIAN,etc/init.d} debian/tmp/usr/{sbin,bin}
30         install -d debian/tmp/etc/userv/{override,default}.d
31         install -d debian/tmp/usr/doc/$(package)/examples/
32         install -d debian/tmp/var/run/$(package)/
33         cp debian/{postinst,prerm,postrm,conffiles} debian/tmp/DEBIAN/.
34         cp debian/initd debian/tmp/etc/init.d/userv
35         chmod +x debian/tmp/DEBIAN/{postinst,prerm,postrm}
36         chmod +x debian/tmp/etc/init.d/userv
37         $(MAKE) LDFLAGS=-s INSTALL_PROGRAM='install -c -s' \
38                 VEREXT=$(verext) \
39                 prefix=debian/tmp/usr etcdir=debian/tmp/etc install
40         cp debian/copyright debian/tmp/usr/doc/$(package)/.
41         cp debian/changelog debian/tmp/usr/doc/$(package)/changelog.Debian
42         cp README debian/tmp/usr/doc/$(package)/README.upstream
43         cp Changelog debian/tmp/usr/doc/$(package)/changelog
44         cp system.default system.override debian/tmp/usr/doc/$(package)/examples
45         gzip -9v debian/tmp/usr/doc/$(package)/changelog{,.Debian}
46         cp -a spec.html debian/tmp/usr/doc/$(package)/
47         dpkg-shlibdeps daemon client
48         dpkg-gencontrol
49         chown -R root.root debian/tmp
50         chmod -R g-ws debian/tmp
51         chmod 700 debian/tmp/var/run/userv
52         dpkg --build debian/tmp ..
53
54 define checkdir
55         test -f overlord.c -a -f lexer.l.m4 -a -f debian/rules
56 endef
57
58 # Below here is fairly generic really
59
60 binary:         binary-indep binary-arch
61
62 source diff:
63         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
64
65 checkroot:
66         $(checkdir)
67         test root = "`whoami`"
68
69 .PHONY: binary binary-arch binary-indep clean checkroot