X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=userv.git;a=blobdiff_plain;f=debian%2Frules;fp=debian%2Frules;h=225bcfc90bcdd379f9741c04ae4f061cab88bc49;hp=0000000000000000000000000000000000000000;hb=6e782fc203ab33307e4a984b26e6aed8f632fff1;hpb=e3d70efb65e00b292e73210d6fe6f2cb81632746 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..225bcfc --- /dev/null +++ b/debian/rules @@ -0,0 +1,69 @@ +#!/usr/bin/make -f + +package=userv +revision=$(shell dpkg-parsechangelog | sed -n 's/^Version:.*-//p') +verext=-$(revision)deb + +build: + $(checkdir) + ./configure --prefix=/usr + $(MAKE) VEREXT=$(verext) + $(MAKE) spec.html VEREXT=$(verext) + touch build + +clean: + $(checkdir) + -rm -f build + -$(MAKE) -i distclean || $(MAKE) -f Makefile.in distclean + -rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars* + +binary-indep: checkroot build + $(checkdir) +# There are no architecture-independent files to be uploaded +# generated by this package. If there were any they would be +# made here. + +binary-arch: checkroot build + $(checkdir) + -rm -rf debian/tmp + install -d debian/tmp/{DEBIAN,etc/init.d} debian/tmp/usr/{sbin,bin} + install -d debian/tmp/etc/userv/{override,default}.d + install -d debian/tmp/usr/doc/$(package)/examples/ + install -d debian/tmp/var/run/$(package)/ + cp debian/{postinst,prerm,postrm,conffiles} debian/tmp/DEBIAN/. + cp debian/initd debian/tmp/etc/init.d/userv + chmod +x debian/tmp/DEBIAN/{postinst,prerm,postrm} + chmod +x debian/tmp/etc/init.d/userv + $(MAKE) LDFLAGS=-s INSTALL_PROGRAM='install -c -s' \ + VEREXT=$(verext) \ + prefix=debian/tmp/usr etcdir=debian/tmp/etc install + cp debian/copyright debian/tmp/usr/doc/$(package)/. + cp debian/changelog debian/tmp/usr/doc/$(package)/changelog.Debian + cp README debian/tmp/usr/doc/$(package)/README.upstream + cp Changelog debian/tmp/usr/doc/$(package)/changelog + cp system.default system.override debian/tmp/usr/doc/$(package)/examples + gzip -9v debian/tmp/usr/doc/$(package)/changelog{,.Debian} + cp -a spec.html debian/tmp/usr/doc/$(package)/ + dpkg-shlibdeps daemon client + dpkg-gencontrol + chown -R root.root debian/tmp + chmod -R g-ws debian/tmp + chmod 700 debian/tmp/var/run/userv + dpkg --build debian/tmp .. + +define checkdir + test -f overlord.c -a -f lexer.l.m4 -a -f debian/rules +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