File: rules

package info (click to toggle)
pystemmer 1.3.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 940 kB
  • ctags: 482
  • sloc: python: 113; makefile: 65; sh: 27
file content (79 lines) | stat: -rwxr-xr-x 2,625 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
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/make -f

include /usr/share/python/python.mk

export CFLAGS=$(shell dpkg-buildflags --get CFLAGS)
export CPPFLAGS=$(shell dpkg-buildflags --get CPPFLAGS)
export LDFLAGS=$(shell dpkg-buildflags --get LDFLAGS)

PYVERS :=  $(shell pyversions -vr)
PY3VERS := $(shell py3versions -vr)

%:
	dh $@ --with python2,python3

override_dh_auto_build:
	# Rebuild from Cython source
	rm -f src/*.c
	set -e -x; \
	for py in $(PYVERS) $(PY3VERS); do \
		python$$py setup.py build; \
		python$$py-dbg setup.py build; \
	done
	mkdir -p debian/html/api
	epydoc --html -o debian/html/api --name="PyStemmer" \
	       --url=http://snowball.tartarus.org/ \
	       build/lib.*-$(shell pyversions -vd)/Stemmer.so

override_dh_auto_clean:
	rm -rf build debian/html
	rm -f src/*.c

override_dh_auto_test:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	set -e -x; \
	for py in $(PYVERS) $(PY3VERS); do \
		PYTHONPATH=$(call py_builddir_sh,$$py) \
			python$$py runtests.py; \
		PYTHONPATH=$(call py_builddir_sh,$$py-dbg) \
			python$$py-dbg runtests.py; \
	done
endif

override_dh_auto_install:
	set -e -x; \
	for py in $(PYVERS); do \
		python$$py setup.py install --skip-build --root debian/python-stemmer \
		                            --install-layout deb; \
		python$$py-dbg setup.py install --skip-build --root debian/python-stemmer-dbg \
		                                --install-layout deb; \
	done
	set -e -x; \
	for py in $(PY3VERS); do \
		python$$py setup.py install --skip-build --root debian/python3-stemmer \
		                            --install-layout deb; \
		python$$py-dbg setup.py install --skip-build --root debian/python3-stemmer-dbg \
		                                --install-layout deb; \
	done

override_dh_compress:
	dh_compress -X.js

override_dh_strip:
	dh_strip -p python-stemmer -p python-stemmer-dbg --dbg-package=python-stemmer-dbg
	dh_strip -p python3-stemmer -p python3-stemmer-dbg --dbg-package=python3-stemmer-dbg

override_dh_installdocs:
	dh_installdocs -p python-stemmer -p python-stemmer-dbg --link-doc=python-stemmer
	dh_installdocs -p python3-stemmer -p python3-stemmer-dbg --link-doc=python3-stemmer
	dh_installdocs -p python-stemmer-doc

get-packaged-orig-source:
	set -e; \
	VER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^+]+).*,\1,p'); \
	uscan --noconf --force-download --rename --download-version=$$VER --destdir=.; \
	tar -x --exclude=libstemmer_c -f pystemmer_$$VER.orig.tar.gz; \
	rm -f pystemmer_$$VER.orig.tar.gz; \
	GZIP=--best tar -cz --owner root --group root --mode a+rX \
	    -f pystemmer_$$VER+dfsg.orig.tar.gz PyStemmer-$$VER; \
	rm -rf PyStemmer-$$VER