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