File: rules

package info (click to toggle)
pymvpa2 2.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 16,628 kB
  • sloc: python: 62,321; cpp: 2,711; makefile: 823; sh: 728; ansic: 521
file content (117 lines) | stat: -rwxr-xr-x 4,346 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-

srcpkg = $(shell LC_ALL=C dpkg-parsechangelog | grep '^Source:' | cut -d ' ' -f 2,2)
debver = $(shell LC_ALL=C dpkg-parsechangelog | grep '^Version:' | cut -d ' ' -f 2,2 )
upstreamver = $(shell echo $(debver) | sed -e 's/-[^-]*$$//' )

# this figures out the last merge point from 'master' into the 'dist' branch and
# then described this commit relative to the last release tag (upstream/...)
# If this should make any sense the local master branch must track remote
# master.
gitver = $(shell [ -x /usr/bin/git ] && git describe --tags --match 'upstream/*' $$(git merge-base -a HEAD master) | sed -e 's,^upstream/,,' -e 's/\.dev/~dev/' -e 's/\.rc/~rc/')

export HOME=$(CURDIR)/build
# so we could use custom symlinked swig2.0
export PATH:=$(PATH):$(HOME)

# one ring to rule them all ...
%:
# need to enforce distutils, since we also have a makefile
	dh $@ --with=python2 --buildsystem=python_distutils --builddirectory=build

override_dh_auto_configure:
	dh_auto_configure
	mkdir -p $(CURDIR)/build
	cp -rp debian/intersphinx doc/source/
	which swig >/dev/null || ln -s /usr/bin/swig2.0 $(CURDIR)/build/swig

override_dh_auto_build:
	dh_auto_build -- --with-libsvm
	$(MAKE) manpages
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	http_proxy=http://127.0.0.1:9/ https_proxy=http://127.0.0.1:9/ \
		$(MAKE) htmldoc
	-rm build/html/_static/jquery.js build/html/_static/underscore.js
	$(MAKE) notebooks
endif


# we run the test suite on the install
override_dh_auto_test:
	: # Tests will be ran later on against installed version

override_dh_auto_install:
	dh_auto_install -- --with-libsvm
	# run unit tests here to actually check the deployed package
	# whenever we don't have to build for python 2.5 anymore call
	# python with -B and remove the find for pyc files
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	for buildver in $(shell pyversions -vr); do \
		echo "I: Running PyMVPA unittests using python$$buildver"; \
		cd $(CURDIR)/debian/tmp/usr/lib/python$$buildver/*-packages && \
		PYTHONPATH=. MVPA_TESTS_LABILE=no MVPA_TESTS_LOWMEM=yes \
		MVPA_TESTS_QUICK=yes MVPA_TESTS_VERBOSITY=3 MVPA_MATPLOTLIB_BACKEND=agg \
		python$$buildver -m nose -s -v mvpa2 \
		|| exit 1 ; find . -type f -name '*.pyc' -delete ; \
	done
endif
	# and now move libraries into -lib package (account for snapshot name
	# as well)
	mkdir -p $(CURDIR)/debian/python-mvpa2-lib
	cd $(CURDIR)/debian/python-mvpa2-lib && \
		for so in $$(find ../tmp -name '*.so'); do \
			install -D $$so $${so#../tmp/*} ; \
			rm $$so ; \
		done
	: # Do not install some existing scripts yet for now
	find debian -wholename '*/bin/*' -o -wholename '*/man/*' \
	| grep -e 'pymvpa2-\(analysis\)' \
	| xargs -r rm -rf

override_dh_python2:
	dh_python2
	if [ -x /usr/bin/dh_numpy ]; then dh_numpy; fi

override_dh_installchangelogs:
	dh_installchangelogs Changelog

override_dh_auto_clean:
	$(MAKE) clean
	dh_auto_clean
	-rm -rf $(CURDIR)/build

# make orig tarball from repository content
get-orig-source:
	# orig tarball, turn directory into something nicer
	git archive --format=tar --prefix=$(srcpkg)-$(gitver)/ HEAD | \
		tar --delete $(srcpkg)-$(gitver)/debian | \
		gzip -9 > $(srcpkg)_$(gitver).orig.tar.gz

# same for dev snapshots, but here it produces a dev changelog entry first
# that converts the source package name to -snapshot
dev-source: dev-changelog get-orig-source
	mv $(srcpkg)_$(gitver).orig.tar.gz ..

# helper to create a new changelog entry for a development snapshot package
# go with default changelog item for each new snapshot, but fire up editor
# if there already was a changelog for this upstream version, as there is
# probably something to say about this new Debian snapshot package release
dev-changelog:
	@if [ "$(gitver)" = "$(upstreamver)" ]; then \
		dch -i --package pymvpa-snapshot ; \
	else \
		dch --newversion $(gitver)-1 --package pymvpa-snapshot \
			--allow-lower-version "PyMVPA development snapshot." ; \
	fi

## immediately useable documentation and exemplar scripts/data
override_dh_compress:
	dh_compress -X.py -X.html -X.pdf -X.css -X.jpg -X.txt -X.js -X.json -X.rtc -Xobjects.inv -X.ipynb -X.sh

cache_intersphinx:
	rm -rf debian/intersphinx
	-rm doc/cache_intersphinx-stamp
	make
	PYTHONPATH=$(CURDIR) make -C doc cache_intersphinx
	mv doc/source/intersphinx debian/