Commit | Line | Data |
---|---|---|
6362f12c | 1 | #!/usr/bin/make -f |
2 | ||
ef974b1a | 3 | subdirs_build= ipif www-cgi git-daemon |
6362f12c | 4 | subdirs_nobuild=dyndns groupmanage misc |
5 | package= userv-utils | |
4063cda3 | 6 | packages_indep= userv-dyndns userv-groupmanage userv-misc userv-git-daemon |
6362f12c | 7 | packages_arch= userv-ipif userv-cgi |
8 | packages= $(packages_indep) $(packages_arch) | |
9 | ||
10 | cwd= $(shell pwd) | |
11 | d= $(cwd)/debian | |
12 | t= $d/tmp | |
13 | ||
14 | build: | |
15 | $(checkdir) | |
16 | set -e; for s in $(subdirs_build); do $(MAKE) -C $$s all; done | |
17 | touch build | |
18 | ||
19 | clean: | |
20 | $(checkdir) | |
21 | rm -f build | |
22 | set -e; for s in $(subdirs_build); do \ | |
23 | $(MAKE) -C $$s -i distclean || \ | |
24 | $(MAKE) -C $$s -f Makefile.in distclean; \ | |
25 | done | |
26 | rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars* | |
27 | ||
28 | binary-prep: | |
29 | $(checkdir) | |
30 | rm -rf debian/tmp* | |
31 | # | |
32 | # | |
33 | set -e; for s in $(subdirs_build) $(subdirs_nobuild); do \ | |
34 | $(MAKE) -C $$s install install-docs install-examples \ | |
35 | prefix=$t/userv-$$s/usr \ | |
36 | etcdir=$t/userv-$$s/etc \ | |
4063cda3 IJ |
37 | vardir=$t/userv-$$s/var \ |
38 | gituser=root; \ | |
6362f12c | 39 | done |
40 | # | |
41 | mv debian/tmp/userv-www-cgi debian/tmp/userv-cgi | |
42 | mv debian/tmp/userv-groupmanage/usr/share/doc/groupmanage \ | |
43 | debian/tmp/userv-groupmanage/usr/share/doc/userv-groupmanage | |
44 | # | |
45 | set -e; for p in $(packages); do \ | |
46 | install -d $t/$$p/DEBIAN $t/$$p/usr/share/doc/$$p; \ | |
dea61a77 | 47 | cp debian/copyright debian/changelog \ |
6362f12c | 48 | $t/$$p/usr/share/doc/$$p/; \ |
49 | ln -s changelog.gz \ | |
50 | $t/$$p/usr/share/doc/$$p/changelog.Debian.gz; \ | |
51 | gzip -9v $t/$$p/usr/share/doc/$$p/changelog; \ | |
52 | done | |
53 | # | |
54 | rename 's/\.example$$//' $t/userv-ipif/etc/userv/vpn/*.example \ | |
55 | $t/userv-dyndns/etc/userv/dyndns-service-users.example \ | |
56 | $t/userv-groupmanage/etc/groupmanage.conf.example | |
57 | rename 's/\.distrib$$//' $t/*/etc/userv/services.d/*.distrib | |
58 | rename 's/$$/\.disabled/' $t/userv-misc/etc/userv/services.d/mailq | |
59 | set -e; for p in $(packages); do \ | |
60 | cd $t/$$p; \ | |
61 | test ! -d etc || \ | |
62 | find etc -type f -exec printf '/%s\n' '{}' ';' \ | |
63 | >>DEBIAN/conffiles; \ | |
64 | done | |
65 | # | |
66 | mv $t/userv-misc/usr/bin/mailq $t/userv-misc/usr/bin/mailq.userv | |
67 | # | |
68 | # gzip -9f $t/*/usr/share/man/man*/* | |
69 | ||
70 | binary-hook-userv-misc: | |
71 | binary-hook-userv-groupmanage: | |
72 | binary-hook-userv-cgi: | |
73 | binary-hook-userv-dyndns: | |
74 | binary-hook-userv-ipif: | |
ef974b1a | 75 | binary-hook-userv-git-daemon: |
6362f12c | 76 | |
77 | binary-one: | |
78 | set -e; for f in preinst postinst prerm postrm conffiles; do \ | |
79 | test -f debian/$p/$$f || continue; \ | |
80 | cp debian/$p/$$f $t/$p/DEBIAN/$$f; \ | |
81 | chmod u=rwX,go=rX $t/$p/DEBIAN/$$f; \ | |
82 | done | |
83 | dpkg-gencontrol -p$p -P$t/$p -Tdebian/sv-$p | |
84 | chown -R root.root debian/tmp | |
85 | chmod -R g-ws debian/tmp | |
86 | debian/rules binary-hook-$p | |
87 | dpkg --build $t/$p .. | |
88 | ||
89 | binary-indep: checkroot build binary-prep | |
90 | set -e; for p in $(packages_indep); do \ | |
91 | debian/rules binary-one p=$$p; done | |
92 | ||
93 | binary-arch: checkroot build binary-prep | |
94 | $(checkdir) | |
95 | dpkg-shlibdeps -Tdebian/sv-userv-ipif \ | |
96 | $t/userv-ipif/usr/bin/udptunnel-forwarder \ | |
97 | $t/userv-ipif/usr/lib/userv/ipif | |
98 | dpkg-shlibdeps -Tdebian/sv-userv-cgi \ | |
99 | $t/userv-cgi/usr/lib/userv/cgi/target \ | |
100 | $t/userv-cgi/usr/lib/userv/cgi/cgi/ucgi | |
101 | set -e; for p in $(packages_arch); \ | |
102 | do debian/rules binary-one p=$$p; done | |
103 | ||
104 | define checkdir | |
105 | test -f ipif/service.c | |
106 | endef | |
107 | ||
108 | # Below here is fairly generic really | |
109 | ||
110 | binary: binary-indep binary-arch | |
111 | ||
112 | source diff: | |
113 | @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false | |
114 | ||
115 | checkroot: | |
116 | $(checkdir) | |
117 | test root = "`whoami`" | |
118 | ||
119 | .PHONY: binary binary-arch binary-indep clean checkroot |