#!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS=hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk BUILDHOME = $(CURDIR)/debian/build PIDFILE = $(BUILDHOME)/memcached.pid WHOAMI = $(shell whoami) PORT := $(shell /bin/netstat -want | perl -w -e 'while (<>) { $$used{$$1}=1 if /127\.0\.0\.1:(\d+)/;}; $$port = 20000; while ($$used{$$port}) { $$port++ }; print "$$port\n";') %: dh $@ override_dh_auto_configure: cp -r debian/libmemcached/* ./ dh_auto_configure override_dh_auto_test: mkdir -p $(BUILDHOME) memcached -u $(WHOAMI) -p $(PORT) -P $(PIDFILE) -d export PERL_LIBMEMCACHED_TEST_SERVERS=127.0.0.1:$(PORT);\ dh_auto_test [ ! -s $(PIDFILE) ] || /bin/kill `cat $(PIDFILE)` override_dh_clean: dh_clean rm -rf $(BUILDHOME) rm -f `find debian/libmemcached/ -type f -printf "%P "`