3 # Copyright 1996-2013 Ian Jackson <ijackson@chiark.greenend.org.uk>
4 # Copyright 1998 David Damerell <damerell@chiark.greenend.org.uk>
6 # Chancellor Masters and Scholars of the University of Cambridge
7 # Copyright 2010 Tony Finch <fanf@dotat.at>
9 # This is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with userv-utils; if not, see http://www.gnu.org/licenses/.
22 subdirs_build= ipif www-cgi git-daemon
23 subdirs_nobuild=dyndns groupmanage misc
25 packages_indep= userv-dyndns userv-groupmanage userv-misc userv-git-daemon
26 packages_arch= userv-ipif userv-cgi
27 packages= $(packages_indep) $(packages_arch)
35 set -e; for s in $(subdirs_build); do \
36 $(MAKE) -C $$s all depr=disable; \
43 set -e; for s in $(subdirs_build); do \
44 $(MAKE) -C $$s -i distclean || \
45 $(MAKE) -C $$s -f Makefile.in distclean; \
47 rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars*
54 set -e; for s in $(subdirs_build) $(subdirs_nobuild); do \
55 $(MAKE) -C $$s install install-docs install-examples \
56 prefix=$t/userv-$$s/usr \
57 etcdir=$t/userv-$$s/etc \
58 vardir=$t/userv-$$s/var \
63 mv debian/tmp/userv-www-cgi debian/tmp/userv-cgi
64 mv debian/tmp/userv-groupmanage/usr/share/doc/groupmanage \
65 debian/tmp/userv-groupmanage/usr/share/doc/userv-groupmanage
67 set -e; for p in $(packages); do \
68 install -d $t/$$p/DEBIAN $t/$$p/usr/share/doc/$$p; \
69 cp debian/copyright debian/changelog \
70 $t/$$p/usr/share/doc/$$p/; \
72 $t/$$p/usr/share/doc/$$p/changelog.Debian.gz; \
73 gzip -9v $t/$$p/usr/share/doc/$$p/changelog; \
76 rename 's/\.example$$//' $t/userv-ipif/etc/userv/vpn/*.example \
77 $t/userv-dyndns/etc/userv/dyndns-service-users.example \
78 $t/userv-groupmanage/etc/groupmanage.conf.example
79 rename 's/\.distrib$$//' $t/*/etc/userv/services.d/*.distrib
80 rename 's/$$/\.disabled/' $t/userv-misc/etc/userv/services.d/mailq
81 set -e; for p in $(packages); do \
84 find etc -type f -exec printf '/%s\n' '{}' ';' \
88 mv $t/userv-misc/usr/bin/mailq $t/userv-misc/usr/bin/mailq.userv
90 # gzip -9f $t/*/usr/share/man/man*/*
92 binary-hook-userv-misc:
93 binary-hook-userv-groupmanage:
94 binary-hook-userv-cgi:
95 binary-hook-userv-dyndns:
96 binary-hook-userv-ipif:
97 binary-hook-userv-git-daemon:
100 set -e; for f in preinst postinst prerm postrm conffiles; do \
101 test -f debian/$p/$$f || continue; \
102 cp debian/$p/$$f $t/$p/DEBIAN/$$f; \
103 chmod u=rwX,go=rX $t/$p/DEBIAN/$$f; \
105 dpkg-gencontrol -p$p -P$t/$p -Tdebian/sv-$p
106 chown -R root.root debian/tmp
107 chmod -R g-ws debian/tmp
108 debian/rules binary-hook-$p
109 dpkg --build $t/$p ..
111 binary-indep: checkroot build binary-prep
112 set -e; for p in $(packages_indep); do \
113 debian/rules binary-one p=$$p; done
115 binary-arch: checkroot build binary-prep
117 dpkg-shlibdeps -Tdebian/sv-userv-ipif \
118 $t/userv-ipif/usr/bin/udptunnel-forwarder \
119 $t/userv-ipif/usr/lib/userv/ipif
120 dpkg-shlibdeps -Tdebian/sv-userv-cgi \
121 $t/userv-cgi/usr/lib/userv/cgi/target \
122 $t/userv-cgi/usr/lib/userv/cgi/cgi/ucgi
123 set -e; for p in $(packages_arch); \
124 do debian/rules binary-one p=$$p; done
127 test -f ipif/service.c
130 # Below here is fairly generic really
132 binary: binary-indep binary-arch
135 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
139 test root = "`whoami`"
141 .PHONY: binary binary-arch binary-indep clean checkroot