File: rules

package info (click to toggle)
python-pipeline 0.1.3-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 96 kB
  • sloc: python: 861; makefile: 48
file content (60 lines) | stat: -rwxr-xr-x 1,794 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
#!/usr/bin/make -f

include /usr/share/python3/python.mk

python_all = pyversions -r $(CURDIR)/debian/control | tr ' ' '\n' | xargs -t -I {} env {}
python3_all = $(patsubst py%,py3%,$(python_all))

test_program = import pipeline as p, doctest as d, sys; sys.exit(d.testmod(p, report=1)[0] > 0)

here = $(dir $(firstword $(MAKEFILE_LIST)))/..
upstream_version = $(shell cd $(here) && dpkg-parsechangelog | sed -n -r -e '/^Version: ([0-9.]+).*/ { s//\1/p }')
upstream_url_py2 = $(shell cd $(here) && uscan --dehs --download-version="$(upstream_version)" | sed -n -r -e '/<upstream-url>(.*)<.*/ { s//\1/p }')
upstream_url_py3 = $(subst /python-pipeline-,/python3-pipeline-,$(upstream_url_py2))

.PHONY: get-orig-source
get-orig-source:
	wget $(upstream_url_py2) -O python-pipeline_$(upstream_version).orig.tar.gz
	wget $(upstream_url_py3) -O python-pipeline_$(upstream_version).orig-py3k.tar.gz

.PHONY: clean
clean:
	dh_testdir
	dh_clean
	rm -rf build/ py3k/build/
	find -name '*.py[co]' -delete

.PHONY: build build-arch build-indep
build build-indep: build-stamp

build-stamp:
	dh_testdir
	python setup.py build
	cd py3k && python3 setup.py build
ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
	$(python_all) -c '$(test_program)'
	cd py3k && \
		$(python3_all) -c '$(test_program)'
endif
	touch $(@)

.PHONY: binary binary-arch binary-indep
binary binary-indep: build-stamp
	dh_testdir
	dh_testroot
	dh_prep
	python setup.py install $(py_setup_install_args) --root=$(CURDIR)/debian/tmp
	cd py3k && python3 setup.py install $(py_setup_install_args) --root=$(CURDIR)/debian/tmp
	dh_install
	dh_installdocs
	dh_installchangelogs
	dh_pysupport -p python-pipeline
	dh_python3 -p python3-pipeline
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# vim:ts=4 sw=4 noet