chiark / gitweb /
ipif: Provide head comment of service.c as a txt docs.
[userv-utils] / debian / rules
CommitLineData
6362f12c 1#!/usr/bin/make -f
2
9028e234
IJ
3# Copyright 1996-2013 Ian Jackson <ijackson@chiark.greenend.org.uk>
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 22subdirs_build= ipif www-cgi git-daemon
6362f12c 23subdirs_nobuild=dyndns groupmanage misc
24package= userv-utils
4063cda3 25packages_indep= userv-dyndns userv-groupmanage userv-misc userv-git-daemon
6362f12c 26packages_arch= userv-ipif userv-cgi
27packages= $(packages_indep) $(packages_arch)
28
29cwd= $(shell pwd)
30d= $(cwd)/debian
31t= $d/tmp
32
33build:
34 $(checkdir)
97f318e0
IJ
35 set -e; for s in $(subdirs_build); do \
36 $(MAKE) -C $$s all depr=disable; \
37 done
6362f12c 38 touch build
39
40clean:
41 $(checkdir)
42 rm -f build
43 set -e; for s in $(subdirs_build); do \
44 $(MAKE) -C $$s -i distclean || \
45 $(MAKE) -C $$s -f Makefile.in distclean; \
46 done
47 rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars*
48
49binary-prep:
50 $(checkdir)
51 rm -rf debian/tmp*
52 #
53 #
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 \
4063cda3 58 vardir=$t/userv-$$s/var \
5e8cb121 59 depr=disable \
4063cda3 60 gituser=root; \
6362f12c 61 done
62 #
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
66 #
67 set -e; for p in $(packages); do \
68 install -d $t/$$p/DEBIAN $t/$$p/usr/share/doc/$$p; \
dea61a77 69 cp debian/copyright debian/changelog \
6362f12c 70 $t/$$p/usr/share/doc/$$p/; \
71 ln -s changelog.gz \
72 $t/$$p/usr/share/doc/$$p/changelog.Debian.gz; \
73 gzip -9v $t/$$p/usr/share/doc/$$p/changelog; \
74 done
75 #
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 \
82 cd $t/$$p; \
83 test ! -d etc || \
84 find etc -type f -exec printf '/%s\n' '{}' ';' \
85 >>DEBIAN/conffiles; \
86 done
87 #
88 mv $t/userv-misc/usr/bin/mailq $t/userv-misc/usr/bin/mailq.userv
89 #
90# gzip -9f $t/*/usr/share/man/man*/*
91
92binary-hook-userv-misc:
93binary-hook-userv-groupmanage:
94binary-hook-userv-cgi:
95binary-hook-userv-dyndns:
96binary-hook-userv-ipif:
ef974b1a 97binary-hook-userv-git-daemon:
6362f12c 98
99binary-one:
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; \
104 done
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 ..
110
111binary-indep: checkroot build binary-prep
112 set -e; for p in $(packages_indep); do \
113 debian/rules binary-one p=$$p; done
114
115binary-arch: checkroot build binary-prep
116 $(checkdir)
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
125
126define checkdir
127 test -f ipif/service.c
128endef
129
130# Below here is fairly generic really
131
132binary: binary-indep binary-arch
133
134source diff:
135 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
136
137checkroot:
138 $(checkdir)
139 test root = "`whoami`"
140
141.PHONY: binary binary-arch binary-indep clean checkroot