File: rules

package info (click to toggle)
python-tblib 0.1.0-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 224 kB
  • ctags: 55
  • sloc: python: 224; makefile: 35
file content (42 lines) | stat: -rwxr-xr-x 1,023 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
#! /usr/bin/make -f
%:
	dh $@ --with python2,python3

# Keep pristine copies of some files that setup.py likes to modify.
BACKUP = \
	PKG-INFO \
	src/tblib.egg-info/PKG-INFO \
	src/tblib.egg-info/SOURCES.txt

override_dh_auto_build:
	mkdir -p debian/backup
	set -e; for x in $(BACKUP); do \
		mkdir -p debian/backup/$$(dirname $$x); \
		cp -a $$x debian/backup/$$x; \
	done
	dh_auto_build
	set -e; for python in $$(py3versions -r); do \
		$$python setup.py build; \
	done

override_dh_auto_test:
	HOME=$(CURDIR) tox -e py,py3

override_dh_auto_clean:
	dh_auto_clean
	find -name \*.pyc -print0 | xargs -0r rm -f
	find -name __pycache__ -print0 | xargs -0r rm -rf
	rm -rf build .tox
	if [ -e debian/backup ]; then \
		set -e; for x in $(BACKUP); do \
			cp -a debian/backup/$$x $$x; \
		done; \
		rm -rf debian/backup; \
	fi

override_dh_auto_install:
	dh_auto_install
	set -e; for python in $$(py3versions -r); do \
		$$python setup.py install --root=$(CURDIR)/debian/tmp \
			--no-compile -O0 --install-layout=deb; \
	done