File: rules

package info (click to toggle)
spymemcached 2.12.3+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 2,072 kB
  • sloc: java: 19,420; xml: 920; sh: 87; makefile: 17
file content (23 lines) | stat: -rwxr-xr-x 797 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
#!/usr/bin/make -f
#Inspired by libmongodb-perl

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 $@ --buildsystem=maven

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	mkdir -p $(BUILDHOME)
	memcached -u $(WHOAMI) -p $(PORT) -P $(PIDFILE) -d
	export SPY_MC_TEST_SERVER=localhost:$(PORT) SPYMC_TEST_SERVER_V4=localhost:$(PORT) SPYMC_TEST_SERVER_v6=::1:$(PORT);\
	dh_auto_test -- -Dserver.port_number=$(PORT) -Dtest.type=ci test
	[ ! -s $(PIDFILE) ] || /bin/kill `cat $(PIDFILE)`
endif

override_dh_clean:
	dh_clean
	rm -rf $(BUILDHOME)