#!/usr/bin/make -f subdirs= backup package= chiark-utils packages_indep= chiark-backup sync-accounts chiark-named-conf packages_arch= chiark-rwbuffer packages= $(packages_indep) $(packages_arch) cwd= $(shell pwd) d= $(cwd)/debian t= $d/tmp build: $(checkdir) set -e; for s in $(subdirs); do $(MAKE) -C $$s all; done touch build clean: $(checkdir) rm -f build set -e; for s in $(subdirs); do \ $(MAKE) -C $$s -i distclean || \ $(MAKE) -C $$s -f Makefile.in distclean; \ done rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars* binary-prep: $(checkdir) rm -rf debian/tmp* # 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 # $(MAKE) -C backup install install-docs install-examples \ prefix=$t/chiark-backup/usr \ etcdir=$t/chiark-backup/etc \ varlib=$t/chiark-backup/var/lib \ mandir=$t/chiark-backup/usr/share/man # $(MAKE) -C sync-accounts install install-docs install-examples \ prefix=$t/sync-accounts/usr \ etcdir=$t/sync-accounts/etc \ varlib=$t/sync-accounts/var/lib \ mandir=$t/sync-accounts/usr/share/man # $(MAKE) -C scripts install install-docs install-examples \ prefix=$t/chiark-named-conf/usr \ etcdir=$t/chiark-named-conf/etc \ varlib=$t/chiark-named-conf/var/lib \ mandir=$t/chiark-named-conf/usr/share/man # install -d $t/chiark-rwbuffer/usr/bin install -d $t/chiark-rwbuffer/usr/share/man/man1 cd $t/chiark-backup/usr/bin && \ mv readbuffer writebuffer $t/chiark-rwbuffer/usr/bin cd $t/chiark-backup/usr/share/man/man1 && \ mv readbuffer.1 writebuffer.1 $t/chiark-rwbuffer/usr/share/man/man1 gzip -9f $t/*/usr/share/man/man*/* binary-hook-chiark-backup: binary-hook-chiark-rwbuffer: binary-hook-sync-accounts: binary-hook-chiark-named-conf: 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; \ 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 .. binary-indep: checkroot build binary-prep set -e; for p in $(packages_indep); do \ debian/rules binary-one p=$$p; done binary-arch: checkroot build binary-prep $(checkdir) dpkg-shlibdeps -Tdebian/sv-chiark-rwbuffer $t/chiark-rwbuffer/usr/bin/* set -e; for p in $(packages_arch); \ do debian/rules binary-one p=$$p; done define checkdir test -f backup/writebuffer.c endef # 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