File: rules

package info (click to toggle)
subunit 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 1,672 kB
  • sloc: sh: 11,426; python: 6,265; makefile: 1,276; ansic: 251; perl: 211; cpp: 56
file content (87 lines) | stat: -rwxr-xr-x 2,212 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

# Get the supported Python versions
PYVERS = $(shell pyversions -vr)
PY3VERS = $(shell py3versions -vr)

include /usr/share/openstack-pkg-tools/pkgos.make
export OSLO_PACKAGE_VERSION=$(VERSION)
UPSTREAM_GIT := https://github.com/testing-cabal/subunit.git

%:
	dh $@ --with python2,python3,autoreconf

export INSTALLDIRS=vendor

override_dh_auto_clean:
	rm -rf build python_subunit.egg-info
	rm -rf debian/tmp
	rm -f perl/MYMETA.yml
	cp -rf debian/upstream-orig-files/* .
	rm -rf .libs perl/blib \
		c++/.dirstamp \
		perl/pm_to_blib \
		c/lib/.dirstamp \
		c/tests/.dirstamp \
		c/tests/.libs \
		c++/.deps \
		c/lib/.deps \
		c/tests/.deps
	find . -iname '*.pyc' -delete
	find . -iname '*.o' -delete
	rm -f Makefile \
		c++/SubunitTestProgressListener.lo \
		c/lib/child.lo \
		c/tests/test_child \
		config.h \
		config.log \
		config.status \
		libcppunit_subunit.la \
		libcppunit_subunit.pc \
		libsubunit.la \
		libsubunit.pc \
		libtool \
		perl/Makefile \
		perl/Makefile.PL \
		stamp-h1 \
		c/tests/test_child.log \
		c/tests/test_child.trs \
		perl/MYMETA.json \
		test-suite.log
	rm -f Makefile.in \
		aclocal.m4 \
		compile \
		config.guess \
		config.sub \
		depcomp \
		install-sh \
		ltmain.sh \
		missing \
		py-compile
	rm -rf m4

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	dh_auto_test || true
	for vers in $(PYVERS) $(PY3VERS); do \
		SHELL_SHARE='./shell/share/' PYTHONPATH=./python${PYTHONPATH:+:$PYTHONPATH} python$$vers runtests.py || true; \
	done
endif

override_dh_auto_install-arch:
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
	find debian/tmp/ -name "*.pyc" | xargs rm -f
	find debian/tmp/ -name "__pycache__" | xargs rm -f
	find debian/tmp/ -name "*.pyo" | xargs rm -f


override_dh_auto_install-indep:
	set -e ; for vers in $(PY3VERS); do \
		python$$vers setup.py install --install-layout=deb --root=$(CURDIR)/debian/tmp; \
	done
	set -e ; for vers in $(PYVERS); do \
		python$$vers setup.py install --install-layout=deb --single-version-externally-managed --root=$(CURDIR)/debian/tmp; \
	done
	set -e && for i in $(CURDIR)/debian/tmp/usr/bin/* ; do \
		sed -i 's|#![ ]*/usr/bin/python.*|#!/usr/bin/env python|' $$i ; \
	done