chiark / gitweb /
userv (1.1.1) unstable; urgency=low
[userv.git] / debian / rules
1 #!/usr/bin/make -f
2
3 SHELL=/bin/bash
4 package=userv
5
6 t=debian/tmp
7
8 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
9         INSTOPTS= LDFLAGS=-s INSTALL_PROGRAM='install -c -s'
10 else
11         INSTOPTS= INSTALL_PROGRAM='install -c'
12 endif
13
14 build: build-arch build-indep
15
16 build-arch:
17         $(checkdir)
18         ./configure --prefix=/usr
19         $(MAKE) all docs
20         touch build-arch
21
22 clean:
23         $(checkdir)
24         rm -f build build-arch
25         $(MAKE) -i distclean || $(MAKE) -f Makefile.in distclean
26         rm -rf *~ $t
27         rm -rf spec.html spec.ps debian/substvars*
28         dh_clean
29
30 build-indep:
31 binary-indep:
32
33 binary-arch:    checkroot build
34         $(checkdir)
35         -rm -rf $t
36         install -d $t/{DEBIAN,etc/init.d} $t/usr/{sbin,bin}
37         install -d $t/etc/userv/{override,default}.d
38         install -d $t/usr/share/doc/$(package)/examples/
39         install -d $t/usr/share/lintian/overrides/
40         install -m 755 debian/{postinst,prerm,postrm} $t/DEBIAN/.
41         install -m 644 debian/conffiles $t/DEBIAN/.
42         install -m 755 debian/initd $t/etc/init.d/userv
43         $(MAKE) $(INSTOPTS) \
44                 prefix=$t/usr etcdir=$t/etc \
45                 docdir=$t/usr/share/doc/userv \
46                 mandir=$t/usr/share/man \
47                 install install-doc
48         cp debian/copyright $t/usr/share/doc/$(package)/.
49         cp debian/changelog $t/usr/share/doc/$(package)/changelog
50         cp README $t/usr/share/doc/$(package)/README.upstream
51         cp system.default system.override $t/usr/share/doc/$(package)/examples
52         ln -s changelog.gz $t/usr/share/doc/$(package)/changelog.Debian.gz
53         gzip -9v $t/usr/share/doc/$(package)/changelog \
54                 $t/usr/share/man/man1/*.1 $t/usr/share/man/man8/*.8 \
55                 $t/usr/share/doc/userv/*.ps
56         cp debian/lintian $t/usr/share/lintian/overrides/userv
57         dpkg-shlibdeps daemon client
58         dpkg-gencontrol -isp
59         dh_fixperms -Pdebian/tmp
60         chown root.root debian/tmp/usr/bin/userv
61         chmod 4755 debian/tmp/usr/bin/userv
62         dpkg --build $t ..
63
64 define checkdir
65         test -f overlord.c -a -f lexer.l.m4 -a -f debian/rules
66 endef
67
68 # Below here is fairly generic really
69
70 binary:         binary-indep binary-arch
71
72 source diff:
73         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
74
75 checkroot:
76         $(checkdir)
77         test root = "`whoami`"
78
79 .PHONY: binary binary-arch binary-indep clean checkroot