#!/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 CFLAGS = -Wall -g LDFLAGS= ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -Os endif build: ln -sf /usr/share/misc/config.sub . ln -sf /usr/share/misc/config.guess . rm -f config.cache ./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`\ > 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/,'\ > ../$(tmp)/DEBIAN/conffiles chmod 644 $(tmp)/DEBIAN/conffiles chown -R root.root $(tmp) chmod -R g-ws,og=rX $(tmp) dpkg --build $(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: