File: rules

package info (click to toggle)
python-greenlet 0.4.17-1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 488 kB
  • sloc: ansic: 2,421; python: 1,374; makefile: 173; cpp: 89; asm: 82; sh: 15
file content (69 lines) | stat: -rwxr-xr-x 1,975 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
#!/usr/bin/make -f
# -*- makefile -*-

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

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

PYTHON3 := $(shell py3versions -sv)

DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

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

override_dh_auto_clean:
	rm -rf build/ .pybuild/
	rm -f greenlet.egg-info/PKG-INFO
	find . \( -type f -or -type l \) \( -name '*.py[co]' -or -name '*.so' -or -name '*.log' \) -delete
	cd doc && make clean

build-python%:
	python$* setup.py build

override_dh_auto_build: $(PYTHON3:%=build-python%)
	dh_auto_build
	cd doc && PYTHONPATH=.. make html SPHINXBUILD=/usr/share/sphinx/scripts/python3/sphinx-build

install-python%:
	python$* setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb

override_dh_auto_install: $(PYTHON3:%=install-python%)
	dh_auto_install
	if [ -d $(CURDIR)/debian/tmp/usr/include/python3.7/ ]; then \
		mv $(CURDIR)/debian/tmp/usr/include/python3.7/ \
		$(CURDIR)/debian/tmp/usr/include/python3.7m/ ; \
	fi

override_dh_install:
	dh_install
	# remove debug files from main package
	$(RM) $(CURDIR)/debian/python3-greenlet/usr/lib/python3*/*-packages/*.cpython-3?d*-*.so

override_dh_auto_test: $(PYTHON3:%=test-%-stamp)
test-%-stamp:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	rm -rf build/test-$*
	mkdir build/test-$*
	python$* setup.py install_lib -d build/test-$*
  ifneq (,$(filter $(DEB_HOST_ARCH), ppc64el))
	-PYTHONPATH=build/test-$* python$* run-tests.py -n
  else
	PYTHONPATH=build/test-$* python$* run-tests.py -n
  endif
endif
	touch test-python-$*-stamp

override_dh_strip:
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
	dh_strip -p python3-greenlet --dbg-package=python3-greenlet-dbg
endif

override_dh_compress:
	dh_compress -X.html

.PHONY: override_dh_auto_clean override_dh_auto_build \
	override_dh_auto_install override_dh_install override_dh_auto_test \
	override_dh_strip override_dh_compress