File: rules

package info (click to toggle)
python-avro 1.8.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,436 kB
  • ctags: 1,407
  • sloc: python: 9,113; xml: 3,822; java: 384; sh: 249; makefile: 44
file content (62 lines) | stat: -rwxr-xr-x 1,807 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f

#DH_VERBOSE = 1

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

export PYBUILD_NAME = avro

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

# The original sources have to be preprocessed by ant before we
# we can use them to actually build
export PYBUILD_BEFORE_CONFIGURE_python2 = ant build
py2srcdir=lang/py
py2blddir=lang/py/build

py2dir=$(py2blddir)

clean: py2dir=$(py2srcdir)
%:
	PYBUILD_DISABLE_python3=1               \
	dh $@                                   \
		--with python2                  \
		--buildsystem=pybuild           \
		--sourcedirectory=$(py2dir)     \
		--no-package=python3-avro
	PYBUILD_DISABLE_python2=1               \
	dh $@                                   \
		--with python3                  \
		--buildsystem=pybuild           \
		--sourcedirectory=lang/py3      \
		--no-package=python-avro

# This is necessary because there's no "dh configure" to allow us
# to simply set a target-specific variable like was done for "clean"
override_dh_auto_configure:
	PYBUILD_DISABLE_python3=1               \
	dh_auto_configure                       \
		--sourcedirectory=$(py2srcdir)  \
		--package=python-avro
	PYBUILD_DISABLE_python2=1               \
	dh_auto_configure                       \
		--sourcedirectory=lang/py3      \
		--package=python3-avro

override_dh_install:
# Only keep /usr/bin/avro that is provided by the python3 package
	rm -f debian/python-avro/usr/bin/avro
	find debian/ -name "*LICENSE*" -delete
	dh_install

override_dh_auto_clean:
	dh_auto_clean
# The python3 package doesn't clean up after itself properly
	$(RM)						\
		lang/py3/README.txt			\
		lang/py3/avro/HandshakeRequest.avsc	\
		lang/py3/avro/HandshakeResponse.avsc	\
		lang/py3/avro/VERSION.txt		\
		lang/py3/avro/tests/interop.avsc