#!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 package=scribus-template DEBIAN_DIR = $(shell pwd)/debian patchdir = $(DEBIAN_DIR)/patches patches = $(shell ls $(patchdir) | sort) rev_patches = $(shell ls $(patchdir) | sort -r) build: build-stamp build-stamp: dh_testdir dh_clean @for file in $(patches); do \ if [ ! -f $(patchdir)/$$file.stamp ]; then \ echo Applying $$file...; \ patch -p1 < $(patchdir)/$$file; \ touch $(patchdir)/$$file.stamp; \ fi; \ done ./configure \ --prefix=/usr touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp install-stamp config.status config.log @for file in $(rev_patches); do \ if [ -f $(patchdir)/$$file.stamp ]; then \ echo Reversing $$file...; \ patch -R -p1 < $(patchdir)/$$file; \ rm -f $(patchdir)/$$file.stamp; \ fi; \ done dh_clean install: build dh_testdir dh_testroot dh_prep dh_installdirs $(MAKE) install \ prefix=$(DEBIAN_DIR)/$(package)/usr binary-indep: build install dh_testdir dh_testroot dh_installdocs dh_installchangelogs dh_link dh_compress dh_fixperms dh_installdeb dh_gencontrol dh_md5sums dh_builddeb binary-arch: build install binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install