File: rules

package info (click to toggle)
pygpgme 0.3-1.2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 548 kB
  • ctags: 526
  • sloc: ansic: 2,871; python: 1,389; makefile: 54; sh: 14
file content (65 lines) | stat: -rwxr-xr-x 2,031 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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this line to make output verbose
#export DH_VERBOSE=1

PYTHON2=$(shell pyversions -vr)
PYTHON3=$(shell py3versions -vr)
#PKGDIR=$(CURDIR)/debian/python-gpgme

override_dh_clean:
	# Enforce removal of *.pyc files. Apparently dh_clean does
	# not perform find on provided filename patterns.
	rm -rf build/
	find . -name *.pyc -exec rm -f {} \;
	find . -name *.so -exec rm -f {} \;
	dh_clean install-stamp build-stamp \
		$(PYVERS:%=install-python%) $(PYVERS:%=build-python%) \
		$(PYVERS:%=install-debug-python%) $(PYVERS:%=build-debug-python%)

override_dh_auto_clean:
	./setup.py clean
	dh_clean

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
test-python%:
	make PYTHON=python$* check

override_dh_auto_test: $(PYTHON2:%=test-python%) $(PYTHON3:%=test-python%)
endif

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

override_dh_auto_build: $(PYTHON3:%=build-python%)

override_dh_auto_install:
	set -e; \
	for py in $(PYTHON2); do \
		python$$py setup.py install --root=$(CURDIR)/debian/python-gpgme --install-layout=deb; \
		python$$py-dbg setup.py install --root=$(CURDIR)/debian/python-gpgme-dbg --install-layout=deb; \
	done
	set -e; \
	for py in $(PYTHON3); do \
		python$$py setup.py install --root=$(CURDIR)/debian/python3-gpgme --install-layout=deb; \
		python$$py-dbg setup.py install --root=$(CURDIR)/debian/python3-gpgme-dbg --install-layout=deb; \
	done
	dh_install

override_dh_strip:
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
	# Stripped symbols go into python-gpgme-dbg
	dh_strip -ppython-gpgme --dbg-package=python-gpgme-dbg
	dh_strip -ppython3-gpgme --dbg-package=python3-gpgme-dbg
endif

get-orig-source:
	REV=$(shell dpkg-parsechangelog | sed -rne 's,^Version: .*bzr([0-9]{4})([0-9]{2})([0-9]{2}).*,\1-\2-\3,p'); \
	VER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p'); \
	bzr export --root=pygpgme-$$VER -r date:$$REV ../pygpgme_$$VER.orig.tar.gz lp:pygpgme

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