File: rules

package info (click to toggle)
cram 0.7-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 332 kB
  • sloc: python: 908; makefile: 52; sh: 20
file content (38 lines) | stat: -rwxr-xr-x 1,129 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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

PYTHON3S:=$(shell py3versions -vr)

override_dh_auto_install:
	dh_auto_install
	set -e && for pyvers in $(PYTHON3S); do \
		python$$pyvers setup.py install --install-layout=deb \
			--root $(CURDIR)/debian/python3-cram; \
	done
	# install Python 3 version with different name
	mv $(CURDIR)/debian/python3-cram/usr/bin/cram \
		$(CURDIR)/debian/python3-cram/usr/bin/cram3
	# run with any Python 3 version
	sed -i s/python3.[0-9]/python3/ \
		$(CURDIR)/debian/python3-cram/usr/bin/cram3

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test
	# accept any test result until the relation between cram and coverage is clarified
	# see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=897516#53
	PYTHON=python3 COVERAGE=python3-coverage $(MAKE) test || true
endif

override_dh_clean:
	dh_clean -O--buildsystem=python_distutils
	rm -rf $(CURDIR)/build
	rm -f $(CURDIR)/.coverage

%:
	dh $@ --buildsystem=pybuild --with python3

.PHONY: override_dh_clean override_dh_auto_install override_dh_auto_test