File: rules

package info (click to toggle)
libmemcached-libmemcached-perl 1.001801%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 912 kB
  • ctags: 773
  • sloc: perl: 1,674; makefile: 25
file content (32 lines) | stat: -rwxr-xr-x 982 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/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";')
LMCV = $(shell apt-cache show libmemcached11 | sed -n -e 's/Version: \([[:digit:]\.]*\).*/\1/p')

%:
	dh $@

override_dh_auto_configure:
	cp -r debian/libmemcached/* ./
	dh_auto_configure

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	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)`
endif

override_dh_clean:
	dh_clean
	rm -rf $(BUILDHOME)
	rm -f `find debian/libmemcached/ -type f -printf "%P "`