File: rules

package info (click to toggle)
pyevolve 0.6~rc1%2Bsvn398%2Bdfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,060 kB
  • ctags: 832
  • sloc: python: 5,119; xml: 183; sh: 71; makefile: 38
file content (61 lines) | stat: -rwxr-xr-x 2,067 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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# For svn-orig-source.sh
PKGDIR = $(dir $(firstword $(MAKEFILE_LIST)))
UPNAME = $(shell dpkg-parsechangelog -l$(PKGDIR)/changelog | \
                sed -nre 's,^Source:\s+(.*),\1,p')
UPVER = $(shell dpkg-parsechangelog -l$(PKGDIR)/changelog | \
                sed -nre 's,^Version:\s+(.*)\+svn([0-9]+)\+dfsg-.*,\1,p')
SVNREV = $(shell dpkg-parsechangelog -l$(PKGDIR)/changelog | \
                sed -nre 's,^Version:\s+(.*)\+svn([0-9]+)\+dfsg-.*,\2,p')
SVNURL = https://pyevolve.svn.sourceforge.net/svnroot/pyevolve/trunk/
export UPNAME UPVER SVNURL SVNREV

LAST_CHANGE = $(shell dpkg-parsechangelog -S Date)
BUILD_DATE = $(shell LC_ALL=C date -u "+%B %d, %Y" -d "$(LAST_CHANGE)")

%:
	dh  $@ --with python2,sphinxdoc --buildsystem=pybuild

# Override needed for docs and egg-info
override_dh_auto_clean:
	dh_auto_clean
	rm -rf Pyevolve.egg-info
	rm -rf docs/html

# Override needed for building documentation; jquery link
override_dh_auto_build:
	dh_auto_build
	cd docs && sphinx-build -E -a -b html -D today="$(BUILD_DATE)" ./source ./html

# Run the autopkgtest as unit test
override_dh_auto_test:
	# Simulate partial autopkgtest run by providing an ADTTMP and letting
	# pybuild drive the test
	testrundir=$$(mktemp -d) ;\
		ADTTMP=$$testrundir \
		PYBUILD_SYSTEM=custom \
		PYBUILD_TEST_ARGS="/bin/sh $(CURDIR)/debian/tests/run-most-examples" \
	dh_auto_test ;\
	res=$$? ;\
	rm -rf "$$testrundir" ;\
	[ $$res -eq 0 ] || exit $$res

# Override needed for multiple binary package;
# script must be renamed, line endings converted to Unix
override_dh_auto_install:
	dh_auto_install --destdir=debian/python-pyevolve
	tr -d '\r' < debian/python-pyevolve/usr/bin/pyevolve_graph.py \
	           > debian/python-pyevolve/usr/bin/pyevolve-graph
	rm -f debian/python-pyevolve/usr/bin/pyevolve_graph.py

# Don't compress sphinx's javascript and Python example files
override_dh_compress:
	dh_compress -X.js -X.py

get-orig-source:
	sh $(PKGDIR)/svn-orig-source.sh