File: rules

package info (click to toggle)
datalad 0.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,076 kB
  • sloc: python: 29,937; sh: 491; makefile: 210
file content (57 lines) | stat: -rwxr-xr-x 2,164 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
#!/usr/bin/make -f
#export DH_VERBOSE = 1

srcpkg = $(shell LC_ALL=C dpkg-parsechangelog | grep '^Source:' | cut -d ' ' -f 2,2)
# 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 upstream's
# master or whatever other source branch.
gitver = $(shell [ -x /usr/bin/git ] && git describe --tags --match '[0-9].*' $$(git merge-base -a HEAD master) | sed -e 's/-/+git/')

export DH_VERBOSE = 1
export PYBUILD_NAME = datalad
export DATALAD_TESTS_NONETWORK = 1
export http_proxy=http://127.0.0.1:9/
export https_proxy=http://127.0.0.1:9/

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

clean::
	dh_clean
	-rm -rf bin build .pybuild datalad.egg-info
	-find . -name '*.pyc' -delete

override_dh_auto_test:
	# cheap fake of an installed datalad
	$(MAKE) bin
	mkdir -p build; \
	    export HOME=$(CURDIR)/build;  \
        git config --global user.name "TESTING"; \
        git config --global user.email "TESTING@example.com"
	# Skipping a failing test for now: https://github.com/datalad/datalad/issues/357
	# Since pybuild overrides HOME for its own purposes, we will rely on our
	# setup_package placing it back into HOME
	GIT_HOME=$(CURDIR)/build PATH=$(CURDIR)/bin:$$PATH \
	    PYBUILD_TEST_ARGS="-s -v datalad" \
	    dh_auto_test -- --test-nose


override_dh_auto_install:
	dh_auto_install
	mkdir -p build/man
	mv debian/python-datalad/usr/bin/* debian/datalad/usr/bin
	# Building manpages. Overcoming #532 which creates some config file
	HOME=$(CURDIR)/build python setup.py build_manpage
	# Generating argcomplete helper for bash_completion.d
	register-python-argcomplete datalad > debian/datalad/usr/share/bash-completion/completions/datalad

override_dh_installchangelogs:
	dh_installchangelogs CHANGELOG.md

# 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