Commit | Line | Data |
---|---|---|
6362f12c | 1 | #!/usr/bin/make -f |
2 | ||
be9d5573 | 3 | # Copyright 1996-2013,2016 Ian Jackson <ijackson@chiark.greenend.org.uk> |
9028e234 IJ |
4 | # Copyright 1998 David Damerell <damerell@chiark.greenend.org.uk> |
5 | # Copyright 1999,2003 | |
6 | # Chancellor Masters and Scholars of the University of Cambridge | |
7 | # Copyright 2010 Tony Finch <fanf@dotat.at> | |
8 | # | |
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. | |
13 | # | |
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. | |
18 | # | |
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/. | |
21 | ||
ef974b1a | 22 | subdirs_build= ipif www-cgi git-daemon |
6362f12c | 23 | subdirs_nobuild=dyndns groupmanage misc |
24 | package= userv-utils | |
b943240f | 25 | packages_indep= userv-dyndns userv-groupmanage userv-utils userv-git-daemon |
6362f12c | 26 | packages_arch= userv-ipif userv-cgi |
27 | packages= $(packages_indep) $(packages_arch) | |
28 | ||
29 | cwd= $(shell pwd) | |
30 | d= $(cwd)/debian | |
6362f12c | 31 | |
0b0a2c11 IJ |
32 | %: |
33 | dh $@ | |
34 | ||
35 | override_dh_auto_configure: | |
36 | ||
37 | override_dh_auto_build: | |
6362f12c | 38 | $(checkdir) |
97f318e0 | 39 | set -e; for s in $(subdirs_build); do \ |
84e9bd3c | 40 | $(MAKE) -C $$s all; \ |
97f318e0 | 41 | done |
6362f12c | 42 | touch build |
43 | ||
0b0a2c11 | 44 | override_dh_auto_install: |
6362f12c | 45 | $(checkdir) |
3b122384 IJ |
46 | - |
47 | set -e; for p in $(packages); do rm -rf $d/$$p; done | |
48 | - | |
6362f12c | 49 | set -e; for s in $(subdirs_build) $(subdirs_nobuild); do \ |
3b122384 IJ |
50 | t=$d/userv-$$s; \ |
51 | rm -rf $$t; \ | |
6362f12c | 52 | $(MAKE) -C $$s install install-docs install-examples \ |
3b122384 IJ |
53 | prefix=$$t/usr \ |
54 | etcdir=$$t/etc \ | |
55 | vardir=$$t/var \ | |
3b122384 IJ |
56 | gituser=root \ |
57 | ; \ | |
6362f12c | 58 | done |
3b122384 | 59 | - |
b943240f | 60 | mv debian/userv-misc debian/userv-utils |
0b0a2c11 IJ |
61 | mv debian/userv-www-cgi debian/userv-cgi |
62 | mv debian/userv-groupmanage/usr/share/doc/groupmanage \ | |
63 | debian/userv-groupmanage/usr/share/doc/userv-groupmanage | |
3b122384 IJ |
64 | - |
65 | rename 's/\.example$$//' $d/userv-ipif/etc/userv/vpn/*.example \ | |
66 | $d/userv-dyndns/etc/userv/dyndns-service-users.example \ | |
67 | $d/userv-groupmanage/etc/groupmanage.conf.example | |
68 | rename 's/\.distrib$$//' $d/*/etc/userv/services.d/*.distrib | |
3b122384 | 69 | - |
b943240f IJ |
70 | mv $d/userv-utils/usr/bin/mailq $d/userv-utils/usr/bin/mailq.userv |
71 | - | |
72 | set -e; cd $d/userv-utils/etc/userv; \ | |
73 | mkdir services-available; \ | |
74 | mv services.d/* services-available/ | |
3b122384 IJ |
75 | |
76 | override_dh_install: | |
6362f12c | 77 | |
0b0a2c11 | 78 | override_dh_auto_clean: |
6362f12c | 79 | $(checkdir) |
0b0a2c11 IJ |
80 | rm -f build |
81 | set -e; for s in $(subdirs_build); do \ | |
82 | $(MAKE) -C $$s -i distclean || \ | |
83 | $(MAKE) -C $$s -f Makefile.in distclean; \ | |
84 | done | |
85 | rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars* | |
6362f12c | 86 | |
87 | define checkdir | |
88 | test -f ipif/service.c | |
89 | endef | |
90 | ||
91 | # Below here is fairly generic really | |
92 | ||
6362f12c | 93 | checkroot: |
94 | $(checkdir) | |
95 | test root = "`whoami`" |