#!/usr/bin/make -f # -*- makefile -*- # The name of the package package := $(shell sed -n -e 's/Package: *\([a-z]\)/\1/p' debian/control) doc := usr/share/doc/$(package) share := usr/share/$(package) man := usr/share/man/man8 menu := usr/share/menu tmp := debian/tmp DPKG_EXPORT_BUILDTOOLS=1 include /usr/share/dpkg/buildtools.mk CFLAGS = -Wall -g LDFLAGS= ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -Os endif # Set -ffile-prefix-map for reproducible builds regardless of build path CFLAGS += -ffile-prefix-map=$(CURDIR)=. build: ln -sf /usr/share/misc/config.sub . ln -sf /usr/share/misc/config.guess . rm -f config.cache GZIP=/bin/gzip BZIP2=/bin/bzip2 ./configure --prefix=/usr \ --infodir=/usr/share/info \ --mandir=/usr/share/man \ --bindir=/usr/sbin make CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" bindir=/usr/sbin && \ touch build clean: rm -f config.sub config.guess rm -f build [ ! -f Makefile ] || $(MAKE) distclean || $(MAKE) -f Makefile.in distclean rm -rf *~ filters/*~ $(tmp) debian/*~ debian/files debian/substvars rm -rf debian/tmp binary-indep: build # There are no architecture-independent files to be uploaded # generated by this package. If there were any they would be # made here. binary-arch: build rm -rf $(tmp) install -d $(tmp) cd $(tmp) &&\ install -d usr/sbin $(share) $(doc) $(man) $(menu) etc/magicfilter $(MAKE) install prefix=$(tmp)/usr\ bindir=$(tmp)/usr/sbin infodir=$(tmp)/$(info) mandir=$(tmp)/$(man) ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS))) $(STRIP) --remove-section=.comment --remove-section=.note --strip-unneeded $(tmp)/usr/sbin/magicfilter endif install -p -m 755 magicfilterconfig $(tmp)/usr/sbin/magicfilterconfig install -m 644 filters/README* $(tmp)/$(doc)/ install -m 644 debian/menu $(tmp)/$(menu)/$(package) install -m 644 quiet.ps $(tmp)/$(share)/quiet.ps cd filters && install -p -m 755 *-filter ../$(tmp)/etc/magicfilter install -p -m 644 debian/changelog $(tmp)/$(doc)/changelog.Debian install -p -m 644 ChangeLog $(tmp)/$(doc)/changelog cd $(tmp)/$(doc) && gzip -9nf changelog.Debian README* changelog install -p -m 644 debian/copyright $(tmp)/$(doc) install -p -m 644 magicfilterconfig.8 $(tmp)/$(man) gzip -9nf $(tmp)/$(man)/* dpkg-shlibdeps $(tmp)/usr/sbin/$(package) install -d $(tmp)/DEBIAN cd $(tmp) &&\ md5sum `find * -name DEBIAN -prune -o -type f -print`\ | LC_ALL=C sort > DEBIAN/md5sums dpkg-gencontrol -isp install -m 755 debian/prerm debian/postrm debian/postinst $(tmp)/DEBIAN cd filters && ls -1 *-filter|sed -e 's,^,/etc/magicfilter/,'\ | LC_ALL=C sort > ../$(tmp)/DEBIAN/conffiles chmod 644 $(tmp)/DEBIAN/conffiles chmod -R g-ws,og=rX $(tmp) dpkg-deb --build --root-owner-group $(tmp) .. chmod a+r debian/files # 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 .PHONY: binary binary-arch binary-indep clean build-arch: build build-indep: