File: rules

package info (click to toggle)
nitime 0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 12,328 kB
  • ctags: 1,421
  • sloc: python: 10,507; makefile: 105; sh: 34
file content (62 lines) | stat: -rwxr-xr-x 1,860 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
# -*- makefile -*-

PACKAGE_NAME = python-nitime
PACKAGE_ROOT_DIR = debian/${PACKAGE_NAME}
INSTALL_PATH = $(CURDIR)/debian/tmp

# default Python
PYTHON=$(shell pyversions -d)

# override matplotlib config directory
export MPLCONFIGDIR=$(CURDIR)/build
export HOME=$(CURDIR)/build

%:
	dh $@ --with python2

override_dh_auto_test:
	: # Do not test just after build, lets install and then test

override_dh_auto_install:
	dh_auto_install

	mkdir -p $(MPLCONFIGDIR)  # just in case
	echo "backend : Agg" >| $(MPLCONFIGDIR)/matplotlibrc
	: # Prune duplicate LICENSE file
	find debian/ -name LICENSE -delete
	: # Only now lets build docs
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	export PYTHONPATH=$$(/bin/ls -d $(INSTALL_PATH)/usr/lib/$(PYTHON)/*-packages); \
	$(MAKE) -C doc html
	-rm doc/_build/html/_static/jquery.js
	-rm doc/_build/html/_static/underscore.js
	-rm -r doc/_build/html/_sources
	: # objects inventory is of no use for the package
	-rm doc/_build/html/objects.inv
endif

# All tests later on
# cd build to prevent use of local/not-built source tree
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	cd build; \
	for PYTHON in $(shell pyversions -r); do \
		echo "I: Running NiTime unittests using $$PYTHON"; \
		PYTHONPATH=$$(/bin/ls -d $(INSTALL_PATH)/usr/lib/$$PYTHON/*-packages) \
		MPLCONFIGDIR=/tmp/ \
			$$PYTHON /usr/bin/nosetests '--exclude=test_(coherence_linear_dependence|lazy_reload)' nitime; \
	done
endif

## immediately useable documentation
## and exemplar data (they are small excerpts anyway)
override_dh_compress:
	dh_compress -X.py -X.html -X.css -X.jpg -X.txt -X.js -X.json -X.rtc -X.par -X.bin

override_dh_clean:
	dh_clean
	@echo "I: Removing other generated material"
	rm -rf build doc/_build doc/examples/fig doc/api/generated/ doc/examples/*rst

get-orig-source:
	-uscan --upstream-version 0 --rename