File: rules

package info (click to toggle)
zookeeper 3.9.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,872 kB
  • sloc: java: 122,772; cpp: 14,071; ansic: 12,468; javascript: 11,754; xml: 4,965; python: 2,829; sh: 2,444; makefile: 241; perl: 114
file content (107 lines) | stat: -rwxr-xr-x 4,031 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/usr/bin/make -f

export LC_ALL=C.UTF-8
export JAVA_HOME=/usr/lib/jvm/default-java

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

PYTHON3S:=$(shell py3versions -vr)

%:
	dh $@ --with javahelper --with python3

# The configure step is handled through Maven for -arch and -indep builds.
# It has to be run only once.
override_dh_auto_configure-arch override_dh_auto_configure-indep:
	if [ ! -f debian/mavenConfigureDone ]; then \
	        /usr/share/maven-debian-helper/copy-repo.sh $$(readlink -f debian) && \
	        mh_patchpoms -plibzookeeper-java --debian-build --keep-pom-version --maven-repo=$$(readlink -f debian/maven-repo) && \
	        touch debian/mavenConfigureDone; \
	fi

override_dh_auto_build-indep:
	dh_auto_build -- package javadoc:jar javadoc:aggregate -Pfull-build

# Running the Java build first, as it also builds the C++ part.
override_dh_auto_build-arch: override_dh_auto_build-indep
	# Build Python bindings in addition
	cd zookeeper-contrib/zookeeper-contrib-zkpython && \
		set -e ; set -x ; for i in $(PYTHON3S) ; do \
			python$$i src/python/setup.py build --build-base=$(CURDIR)/build ; \
		done

# Empty override: no need to call the Maven stuff for the arch-dependent packages
override_dh_auto_install-arch:

override_dh_auto_install-indep:
	dh_auto_install -i -- -Pfull-build

override_dh_install-arch:
	# Installing the Python artifacts in debian/tmp before calling dh_install
	cd zookeeper-contrib/zookeeper-contrib-zkpython && \
		set -e ; set -x ; for i in $(PYTHON3S) ; do \
			python$$i src/python/setup.py build --build-base=$(CURDIR)/build \
				install --root=$(CURDIR)/debian/tmp --install-layout=deb ;\
		done

	dh_install -a

override_dh_install-indep:
	dh_install -i
	# Also installing the configuration.xsl and zoo.cfg which are in conf/.
	cp conf/configuration.xsl debian/zookeeper/etc/zookeeper/conf_example/
	cp conf/zoo_sample.cfg debian/zookeeper/etc/zookeeper/conf_example/zoo.cfg

override_dh_auto_test-indep:
ifeq ($(ENABLE_TESTS),true)
	dh_auto_test -i
else
	echo "Skipping tests unless ENABLE_TESTS=true. See Debian bug #1102062"
endif

# Empty override for the -arch part, as we currently run no tests othen than
# the Java ones. See the commented block below for some perspective.
override_dh_auto_test-arch:

# In former versions a test could be run for the -arch part. To be reworked.
#ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
## Limit architectures which execute tests as some
## non x86 archs can be a bit racey.
#TEST_ARCH=i386 amd64
#ifneq (,$(findstring $(DEB_BUILD_ARCH), $(TEST_ARCH)))
#TEST_JARS=jline log4j-1.2 xercesImpl xmlParserAPIs netty slf4j-api slf4j-log4j12
#override_dh_auto_test-arch:
#	# C testing starts/stops zookeeper
#	# this ensures that all the right classes are found
#	for jar in $(TEST_JARS); do \
#		ln -sf /usr/share/java/$$jar.jar build/lib/$$jar.jar; \
#	done;
#	# Execute multi-threaded test suite
#	# Disable on Ubuntu and Debian due to glibc 2.17 incompatibility
#	# https://issues.apache.org/jira/browse/ZOOKEEPER-1646
#	if ! dpkg-vendor --derives-from debian; then \
#		$(MAKE) -C src/c zktest-mt; \
#		cd src/c && ./zktest-mt; \
#	fi;
#endif
#endif

override_dh_auto_clean:
	dh_auto_clean
	rm -rf build
	find . -name "*.jar" -delete
	-rm zookeeper-client/zookeeper-client-c/generated/*
	[ ! -f zookeeper-client/zookeeper-client-c/Makefile ] || $(MAKE) -C zookeeper-client/zookeeper-client-c distclean
	-rm -rf zookeeper-client/zookeeper-client-c/Makefile.in
	-rm -rf zookeeper-client/zookeeper-client-c/aclocal.m4
	-rm -rf zookeeper-client/zookeeper-client-c/autom4te.cache
	-rm -rf zookeeper-client/zookeeper-client-c/compile
	-rm -rf zookeeper-client/zookeeper-client-c/config.guess
	-rm -rf zookeeper-client/zookeeper-client-c/config.sub
	-rm -rf zookeeper-client/zookeeper-client-c/configure
	-rm -rf zookeeper-client/zookeeper-client-c/ltmain.sh
	-rm -rf zookeeper-client/zookeeper-client-c/TEST-*
	-rm debian/mavenConfigureDone

override_dh_installinit:
	dh_installinit --name=zookeeper