#!/usr/bin/make -f
-subdirs_build= ipif www-cgi
+# Copyright 1996-2013 Ian Jackson <ijackson@chiark.greenend.org.uk>
+# Copyright 1998 David Damerell <damerell@chiark.greenend.org.uk>
+# Copyright 1999,2003
+# Chancellor Masters and Scholars of the University of Cambridge
+# Copyright 2010 Tony Finch <fanf@dotat.at>
+#
+# This is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with userv-utils; if not, see http://www.gnu.org/licenses/.
+
+subdirs_build= ipif www-cgi git-daemon
subdirs_nobuild=dyndns groupmanage misc
package= userv-utils
-packages_indep= userv-dyndns userv-groupmanage userv-misc
+packages_indep= userv-dyndns userv-groupmanage userv-misc userv-git-daemon
packages_arch= userv-ipif userv-cgi
packages= $(packages_indep) $(packages_arch)
cwd= $(shell pwd)
d= $(cwd)/debian
-t= $d/tmp
-build:
- $(checkdir)
- set -e; for s in $(subdirs_build); do $(MAKE) -C $$s all; done
- touch build
+%:
+ dh $@
-clean:
+override_dh_auto_configure:
+
+override_dh_auto_build:
$(checkdir)
- rm -f build
set -e; for s in $(subdirs_build); do \
- $(MAKE) -C $$s -i distclean || \
- $(MAKE) -C $$s -f Makefile.in distclean; \
+ $(MAKE) -C $$s all depr=disable; \
done
- rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars*
+ touch build
-binary-prep:
+override_dh_auto_install:
$(checkdir)
- rm -rf debian/tmp*
- #
- #
+ -
+ set -e; for p in $(packages); do rm -rf $d/$$p; done
+ -
set -e; for s in $(subdirs_build) $(subdirs_nobuild); do \
+ t=$d/userv-$$s; \
+ rm -rf $$t; \
$(MAKE) -C $$s install install-docs install-examples \
- prefix=$t/userv-$$s/usr \
- etcdir=$t/userv-$$s/etc \
- varlib=$t/userv-$$s/var/lib; \
- done
- #
- mv debian/tmp/userv-www-cgi debian/tmp/userv-cgi
- mv debian/tmp/userv-groupmanage/usr/share/doc/groupmanage \
- debian/tmp/userv-groupmanage/usr/share/doc/userv-groupmanage
- #
- set -e; for p in $(packages); do \
- install -d $t/$$p/DEBIAN $t/$$p/usr/share/doc/$$p; \
- cp debian/copyright debian/changelog \
- $t/$$p/usr/share/doc/$$p/; \
- ln -s changelog.gz \
- $t/$$p/usr/share/doc/$$p/changelog.Debian.gz; \
- gzip -9v $t/$$p/usr/share/doc/$$p/changelog; \
- done
- #
- rename 's/\.example$$//' $t/userv-ipif/etc/userv/vpn/*.example \
- $t/userv-dyndns/etc/userv/dyndns-service-users.example \
- $t/userv-groupmanage/etc/groupmanage.conf.example
- rename 's/\.distrib$$//' $t/*/etc/userv/services.d/*.distrib
- rename 's/$$/\.disabled/' $t/userv-misc/etc/userv/services.d/mailq
- set -e; for p in $(packages); do \
- cd $t/$$p; \
- test ! -d etc || \
- find etc -type f -exec printf '/%s\n' '{}' ';' \
- >>DEBIAN/conffiles; \
- done
- #
- mv $t/userv-misc/usr/bin/mailq $t/userv-misc/usr/bin/mailq.userv
- #
-# gzip -9f $t/*/usr/share/man/man*/*
-
-binary-hook-userv-misc:
-binary-hook-userv-groupmanage:
-binary-hook-userv-cgi:
-binary-hook-userv-dyndns:
-binary-hook-userv-ipif:
-
-binary-one:
- set -e; for f in preinst postinst prerm postrm conffiles; do \
- test -f debian/$p/$$f || continue; \
- cp debian/$p/$$f $t/$p/DEBIAN/$$f; \
- chmod u=rwX,go=rX $t/$p/DEBIAN/$$f; \
+ prefix=$$t/usr \
+ etcdir=$$t/etc \
+ vardir=$$t/var \
+ depr=disable \
+ gituser=root \
+ ; \
done
- dpkg-gencontrol -p$p -P$t/$p -Tdebian/sv-$p
- chown -R root.root debian/tmp
- chmod -R g-ws debian/tmp
- debian/rules binary-hook-$p
- dpkg --build $t/$p ..
+ -
+ mv debian/userv-www-cgi debian/userv-cgi
+ mv debian/userv-groupmanage/usr/share/doc/groupmanage \
+ debian/userv-groupmanage/usr/share/doc/userv-groupmanage
+ -
+ rename 's/\.example$$//' $d/userv-ipif/etc/userv/vpn/*.example \
+ $d/userv-dyndns/etc/userv/dyndns-service-users.example \
+ $d/userv-groupmanage/etc/groupmanage.conf.example
+ rename 's/\.distrib$$//' $d/*/etc/userv/services.d/*.distrib
+ rename 's/$$/\.disabled/' $d/userv-misc/etc/userv/services.d/mailq
+ -
+ mv $d/userv-misc/usr/bin/mailq $d/userv-misc/usr/bin/mailq.userv
-binary-indep: checkroot build binary-prep
- set -e; for p in $(packages_indep); do \
- debian/rules binary-one p=$$p; done
+override_dh_install:
-binary-arch: checkroot build binary-prep
+override_dh_auto_clean:
$(checkdir)
- dpkg-shlibdeps -Tdebian/sv-userv-ipif \
- $t/userv-ipif/usr/bin/udptunnel-forwarder \
- $t/userv-ipif/usr/lib/userv/ipif
- dpkg-shlibdeps -Tdebian/sv-userv-cgi \
- $t/userv-cgi/usr/lib/userv/cgi/target \
- $t/userv-cgi/usr/lib/userv/cgi/cgi/ucgi
- set -e; for p in $(packages_arch); \
- do debian/rules binary-one p=$$p; done
+ rm -f build
+ set -e; for s in $(subdirs_build); do \
+ $(MAKE) -C $$s -i distclean || \
+ $(MAKE) -C $$s -f Makefile.in distclean; \
+ done
+ rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars*
define checkdir
test -f ipif/service.c
# Below here is fairly generic really
-binary: binary-indep binary-arch
-
-source diff:
- @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
-
checkroot:
$(checkdir)
test root = "`whoami`"
-
-.PHONY: binary binary-arch binary-indep clean checkroot