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
$(MAKE
) -C
$$s all; done
41 set
-e
; for s in
$(subdirs_build
); do \
42 $(MAKE
) -C
$$s -i
distclean || \
43 $(MAKE
) -C
$$s -f Makefile.in
distclean; \
45 rm -rf
*~ debian
/tmp debian
/*~ debian
/files
* debian
/substvars
*
52 set
-e
; for s in
$(subdirs_build
) $(subdirs_nobuild
); do \
53 $(MAKE
) -C
$$s install install-docs install-examples \
54 prefix=$t/userv-
$$s/usr \
55 etcdir
=$t/userv-
$$s/etc \
56 vardir
=$t/userv-
$$s/var \
60 mv debian
/tmp
/userv-www-cgi debian
/tmp
/userv-cgi
61 mv debian
/tmp
/userv-groupmanage
/usr
/share
/doc
/groupmanage \
62 debian
/tmp
/userv-groupmanage
/usr
/share
/doc
/userv-groupmanage
64 set
-e
; for p in
$(packages
); do \
65 install -d
$t/$$p/DEBIAN
$t/$$p/usr
/share
/doc
/$$p; \
66 cp debian
/copyright debian
/changelog \
67 $t/$$p/usr
/share
/doc
/$$p/; \
69 $t/$$p/usr
/share
/doc
/$$p/changelog.Debian.gz
; \
70 gzip
-9v
$t/$$p/usr
/share
/doc
/$$p/changelog
; \
73 rename
's/\.example$$//' $t/userv-ipif
/etc
/userv
/vpn
/*.example \
74 $t/userv-dyndns
/etc
/userv
/dyndns-service-users.example \
75 $t/userv-groupmanage
/etc
/groupmanage.conf.example
76 rename
's/\.distrib$$//' $t/*/etc
/userv
/services.d
/*.distrib
77 rename
's/$$/\.disabled/' $t/userv-misc
/etc
/userv
/services.d
/mailq
78 set
-e
; for p in
$(packages
); do \
81 find etc
-type f
-exec printf
'/%s\n' '{}' ';' \
85 mv
$t/userv-misc
/usr
/bin
/mailq
$t/userv-misc
/usr
/bin
/mailq.userv
87 # gzip -9f $t/*/usr/share/man/man*/*
89 binary-hook-userv-misc
:
90 binary-hook-userv-groupmanage
:
91 binary-hook-userv-cgi
:
92 binary-hook-userv-dyndns
:
93 binary-hook-userv-ipif
:
94 binary-hook-userv-git-daemon
:
97 set
-e
; for f in preinst postinst prerm postrm conffiles
; do \
98 test -f debian
/$p/$$f || continue
; \
99 cp debian
/$p/$$f $t/$p/DEBIAN
/$$f; \
100 chmod u
=rwX
,go
=rX
$t/$p/DEBIAN
/$$f; \
102 dpkg-gencontrol
-p
$p -P
$t/$p -Tdebian
/sv-
$p
103 chown
-R root.root debian
/tmp
104 chmod
-R g-ws debian
/tmp
105 debian
/rules binary-hook-
$p
106 dpkg
--build
$t/$p ..
108 binary-indep
: checkroot build binary-prep
109 set
-e
; for p in
$(packages_indep
); do \
110 debian
/rules binary-one p
=$$p; done
112 binary-arch
: checkroot build binary-prep
114 dpkg-shlibdeps
-Tdebian
/sv-userv-ipif \
115 $t/userv-ipif
/usr
/bin
/udptunnel-forwarder \
116 $t/userv-ipif
/usr
/lib
/userv
/ipif
117 dpkg-shlibdeps
-Tdebian
/sv-userv-cgi \
118 $t/userv-cgi
/usr
/lib
/userv
/cgi
/target \
119 $t/userv-cgi
/usr
/lib
/userv
/cgi
/cgi
/ucgi
120 set
-e
; for p in
$(packages_arch
); \
121 do debian
/rules binary-one p
=$$p; done
124 test -f ipif
/service.c
127 # Below here is fairly generic really
129 binary
: binary-indep binary-arch
132 @echo
>&2 'source and diff are obsolete - use dpkg-source -b'; false
136 test root
= "`whoami`"
138 .PHONY
: binary binary-arch binary-indep
clean checkroot