X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=trc6500-master-file%2FMakefile;fp=trc6500-master-file%2FMakefile;h=dabfe20bd58cbe6f44c8e3bae2ca07f6d8404c82;hb=7cf8d4b77c1be839986f26cbd946ba28ae6a464e;hp=0000000000000000000000000000000000000000;hpb=1a388d7d89aa3e2b3333b71829e02c68003c886b;p=debian6500.git diff --git a/trc6500-master-file/Makefile b/trc6500-master-file/Makefile new file mode 100644 index 0000000..dabfe20 --- /dev/null +++ b/trc6500-master-file/Makefile @@ -0,0 +1,64 @@ +# -*- Makefile -*- + +DIR = ../master/ + +CONFIGDIR = debian/ + +FILES = $(shell cd $(DIR); find etc/ -type f) + +TARGET = ../$(MODULE)_$(VERSION)_$(ARCH).deb + +OBJECTS = deb/DEBIAN/preinst \ + deb/DEBIAN/postrm \ + deb/DEBIAN/postinst \ + deb/opt/script + +SHELL=/bin/bash +MODULE = $(shell basename `pwd`) +ARCH = all + +.DEFAULT: all +.PHONY: clean deb all + +VERSION = $(shell awk '/^$(MODULE)/ { gsub(/[()]/, ""); print $$2; exit }' debian/debian-changelog) + + +all: $(TARGET) deb + +clean: + rm -rf deb $(OBJECTS) $(TARGETS) + +deb: + rm -rf deb + mkdir --parent deb/etc/webconfig/ deb/etc/default/ deb/DEBIAN + +deb/DEBIAN/preinst: debian/debian-preinst deb $(addprefix $(DIR)/, $(FILES)) $(MAKEFILE_LIST) + rm -f $@ + cat $< > $@~ + for f in $(FILES); do echo '[ -f "/'$$f'" ] && dpkg-divert --add /'$$f; done >>$@~ + echo "exit 0" >>$@~ + chmod +x $@~ + mv $@~ $@ + +deb/DEBIAN/postrm: debian/debian-postrm deb $(addprefix $(DIR)/, $(FILES)) $(MAKEFILE_LIST) + rm -f $@ + cat $< > $@~ + for f in $(FILES); do echo '[ -f "/'$$f'" ] && dpkg-divert --remove /'$$f; done >>$@~ + echo "exit 0" >>$@~ + chmod +x $@~ + mv $@~ $@ + +deb/DEBIAN/postinst: debian/debian-postinst deb + cp $< $@ + +deb/opt/script: script deb + mkdir -p $@ + cp $ deb/DEBIAN/control + mkdir -p deb/usr/share/doc/$(MODULE) + cp debian/debian-changelog deb/usr/share/doc/$(MODULE)/changelog + cp -r $(DIR)/* deb/ + fakeroot dpkg --build deb + mv deb.deb $@