File: rules

package info (click to toggle)
python-levenshtein 0.12.0-3
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 368 kB
  • sloc: ansic: 5,422; python: 96; makefile: 35
file content (48 lines) | stat: -rwxr-xr-x 1,957 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
#!/usr/bin/make -f
# -*- makefile -*-

PY2VERS=$(shell pyversions -vr)
PY3VERS=$(shell py3versions -vr)
PYLIBPATH := $(shell python -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print b.build_platlib")

%:
	dh $@ --with python2,python3

override_dh_auto_build:
	set -e ; \
	for py in $(PY2VERS) $(PY3VERS); do \
		python$$py setup.py build ; \
		python$$py-dbg setup.py build ; \
	done

override_dh_auto_install:
	set -e ; \
	for py in $(PY2VERS); do \
		python$$py setup.py install --root $(CURDIR)/debian/python-levenshtein --install-layout=deb ; \
		python$$py-dbg setup.py install --root $(CURDIR)/debian/python-levenshtein-dbg --install-layout=deb ; \
	done
	for py in $(PY3VERS); do \
		python$$py setup.py install --root $(CURDIR)/debian/python3-levenshtein --install-layout=deb ; \
		python$$py-dbg setup.py install --root $(CURDIR)/debian/python3-levenshtein-dbg --install-layout=deb ; \
	done
	find $(CURDIR)/debian/python-levenshtein-dbg -type f -name "*.egg-info" -delete
	find $(CURDIR)/debian/python3-levenshtein-dbg -type f -name "*.egg-info" -delete

	# https://github.com/ztane/python-Levenshtein/issues/20
	rm -f $(CURDIR)/debian/python*-levenshtein*/usr/lib/python*/dist-packages/Levenshtein/_levenshtein.c
	rm -f $(CURDIR)/debian/python*-levenshtein*/usr/lib/python*/dist-packages/Levenshtein/_levenshtein.h

	# https://github.com/ztane/python-Levenshtein/issues/21
	rm -f $(CURDIR)/debian/python*-levenshtein*/usr/lib/python*/dist-packages/Levenshtein/StringMatcher.py

override_dh_installdocs:
	dh_installdocs README.rst NEWS docs/Levenshtein.html

override_dh_installexamples:
	dh_installexamples Levenshtein/StringMatcher.py

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