File: rules

package info (click to toggle)
pysurfer 0.3%2Bgit15-gae6cbb1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,032 kB
  • sloc: python: 1,947; makefile: 125
file content (45 lines) | stat: -rwxr-xr-x 1,675 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
#!/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 Debian branch and
# then described this commit relative to the last release tag (V...)
# If this should make any sense the local master branch must track upstreams
# master.
gitver = $(shell [ -x /usr/bin/git ] && git describe --tags $$(git merge-base -a HEAD master) | sed -e 's/-/+git/')


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

# tests need data files from Freesurfer -- need to wait
#override_dh_auto_test:
#ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
#	for buildver in $(shell pyversions -vr); do \
#		echo "I: Running PySurfer unittests using python$$buildver"; \
#		$(MAKE) unittest PYTHON=python$$buildver || exit 1 ;\
#	done
#endif

override_dh_installman:
	PYTHONPATH=. help2man --version-string="$(upstreamver)" -N \
		--no-discard-stderr \
		-n 'visualize cortical surface reconstruction from Freesurfer' \
		debian/python-surfer/usr/bin/pysurfer > build/pysurfer.1
	dh_installman build/pysurfer.1

override_dh_clean:
	rm -rf pysurfer.egg-info build
	dh_clean

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