File: rules

package info (click to toggle)
nibabel 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 66,580 kB
  • ctags: 3,973
  • sloc: python: 34,788; makefile: 272; ansic: 202; sh: 73
file content (65 lines) | stat: -rwxr-xr-x 2,248 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
63
64
65
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-

PYVERS = $(shell pyversions -vr)
PYVER = $(shell pyversions -vd)
PY3VERS = $(shell py3versions -vr)
PY3VER = $(shell py3versions -vd)

BINDIR=$(CURDIR)/debian/tmp/usr/bin/

# Setting MPLCONFIGDIR to please matplotlib demanding writable HOME
# on older systems (e.g. 12.04)
export MPLCONFIGDIR=$(CURDIR)/build

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

override_dh_auto_build:
	dh_auto_build
	# and docs
	$(MAKE) htmldoc
	# but remove jquery copy (later on link to Debian's version)
	-rm build/html/_static/jquery.js
	# objects inventory is of no use for the package
	-rm build/html/objects.inv
	# also doc source files only consume space
	-rm -r build/html/_sources

override_dh_auto_install: ${PY3VERS:%=python-install%} ${PYVERS:%=python-install%} 
python-install%:
	: # Remove those possibly installed scripts with incorrect shebangs
	rm -f $(CURDIR)/debian/tmp/usr/bin/*
	python$* setup.py install --install-layout=deb --root=$(CURDIR)/debian/tmp

# enable when we believe that the tests should pass
override_dh_auto_test: ${PYVERS:%=python-test%} ${PY3VERS:%=python-test%}

python-test%:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	@echo "I: Running NiBabel unittests using python$*"
	$(MAKE) unittest PYTHON=python$*
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_installman:
	PYTHONPATH=build/lib:$(PYTHONPATH) help2man -N \
		-n 'convert PARREC image to NIfTI' $(BINDIR)/parrec2nii > build/parrec2nii.1
	PYTHONPATH=build/lib:$(PYTHONPATH) help2man -N \
		-n 'FUSE filesystem on top of a directory with DICOMs' $(BINDIR)/nib-dicomfs > build/nib-dicomfs.1
	PYTHONPATH=build/lib:$(PYTHONPATH) help2man -N \
		-n "'ls' for neuroimaging files" $(BINDIR)/nib-ls > build/nib-ls.1
	PYTHONPATH=build/lib:$(PYTHONPATH) help2man -N \
		-n "header diagnostic tool" $(BINDIR)/nib-nifti-dx > build/nib-nifti-dx.1

	dh_installman build/*.1

override_dh_clean:
	$(MAKE) clean
	dh_clean