#!/usr/bin/make -f #DH_VERBOSE = 1 ifndef PERL PERL="/usr/bin/perl" endif DEB_PACKAGES=Image-Base Image-Xbm Image-Xpm DESTDIR=$(CURDIR)/debian/libimage-base-bundle-perl # Since Image;:X{p,b}m requires Image::Base, add Image::Base to @INC # so we can test. export PERL5LIB=$(CURDIR)/build-tree/$(subst .tar.gz,,$(wildcard Image-Base-*.tar.gz))/blib/lib unpack: $(foreach foo,$(DEB_PACKAGES),unpack-$(foo)-stamp) unpack-%-stamp: dh_testdir mkdir -p build-tree tar -C build-tree -xzf $*-*.tar.gz touch $@ patch: unpack $(foreach foo,$(DEB_PACKAGES),patch-$(foo)-stamp) patch-%-stamp: dh_testdir if [ -e debian/patches/$* ]; then \ for a in `ls debian/patches/$*/*.diff`; do \ patch -f -d build-tree/$*-* -p1 < $$a; \ done; \ fi; rm -f unpatch-$*-stamp; touch $@ unpatch: $(foreach foo,$(DEB_PACKAGES),unpatch-$(foo)-stamp) unpatch-%-stamp: dh_testdir if [ -e debian/patches/$* ]; then \ for a in `ls debian/patches/$*/*.diff`; do \ patch -f -d build-tree/$*-* -p1 -R < $$a; \ done; \ fi; rm -f patch-$*-stamp touch $@ build-indep: unpack patch $(foreach foo,$(DEB_PACKAGES),build-$(foo)-stamp) build-%-stamp: dh_testdir cd build-tree/$*-*;\ $(PERL) Makefile.PL INSTALLDIRS=vendor; \ $(MAKE) ; \ $(MAKE) test touch $@ # do nothing build-arch: build: build-indep clean: dh_testdir dh_testroot rm -f unpack-*-stamp rm -f build-*-stamp rm -f unpatch-*-stamp rm -f patch-*-stamp rm -rf build-tree dh_clean install: build $(foreach foo,$(DEB_PACKAGES),install-$(foo)-stamp) install-%-stamp: dh_testdir dh_testroot # dh_clean -k dh_installdirs $(MAKE) -C build-tree/$*-* install DESTDIR=$(DESTDIR) # MURDER DUMB /usr/lib DIRECTORY rm -rf $(DESTDIR)/usr/lib # do nothing binary-arch: binary-indep: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installman dh_compress dh_fixperms dh_installdeb dh_perl dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep .PHONY: unpack build-indep build-arch build clean binary-indep binary-arch binary install