#!/usr/bin/make -f SHELL = /bin/bash package = fortunes-bg source = bgauthors intauthors bgproverb intproverb history others compiled = $(source:%=%.dat) u8 = $(source:%=%.u8) FORTUNEROOT=/usr/share/games/fortunes BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date) build-indep: $(compiled) $(u8) $(checkdir) rm -r bg/ mkdir bg cp -d $(source) $(compiled) $(u8) bg/ build-arch: $(checkdir) build: build-indep build-arch install: build cp -r bg/ $(FORTUNEROOT)/ %.dat: % strfile $< %.u8: % ln -s $< $@ clean: $(checkdir) -rm -rf *~ tmp files* substvars -rm -f *.dat *.u8 binary-indep: checkroot build-indep $(checkdir) -rm -rf tmp install -d tmp/DEBIAN install -d tmp/usr/share/doc/$(package) cp copyright tmp/usr/share/doc/$(package) cp changelog tmp/usr/share/doc/$(package)/changelog gzip -9nv tmp/usr/share/doc/$(package)/changelog install -d tmp/usr/share/games/fortunes/bg/ cp -d $(source) $(compiled) $(u8) tmp/usr/share/games/fortunes/bg/ dpkg-gencontrol -isp chown -R root.root tmp chmod -R go=rX,u=rwX tmp find debian/tmp -newermt '$(BUILD_DATE)' -print0 | \ xargs -0r touch --no-dereference --date='$(BUILD_DATE)' dpkg --build tmp .. binary-arch: checkroot build-arch define checkdir test -f bgauthors -a -f debian/rules endef binary: binary-indep binary-arch checkroot: $(checkdir) test root = "`whoami`" .PHONY: build-arch build-indep build \ binary binary-arch binary-indep \ clean checkroot