File: rules

package info (click to toggle)
libapache-session-memcached-perl 0.03-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 136 kB
  • sloc: perl: 82; makefile: 15
file content (21 lines) | stat: -rwxr-xr-x 596 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
#!/usr/bin/make -f
#Inspired by libmongodb-perl

BUILDHOME = $(CURDIR)/debian/build
PIDFILE   = $(BUILDHOME)/mongod.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_test:
	mkdir -p $(BUILDHOME)
	memcached -u $(WHOAMI) -p $(PORT) -P $(PIDFILE) -d
	export MEMCACHED_Servers=127.0.0.1:$(PORT);\
	dh_auto_test
	[ ! -s $(PIDFILE) ] || /bin/kill `cat $(PIDFILE)`

override_dh_clean:
	dh_clean
	rm -rf $(BUILDHOME)