File: rules

package info (click to toggle)
brian 1.4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 23,416 kB
  • ctags: 18,571
  • sloc: python: 68,406; cpp: 29,040; ansic: 5,182; sh: 111; makefile: 58
file content (91 lines) | stat: -rwxr-xr-x 2,879 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
#!/usr/bin/make -f
# -*- makefile -*-

ifeq (,$(findstring get-orig-source, $(MAKECMDGOALS)))
export  http_proxy=http://127.0.0.1:9/
endif


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

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

# override HOME (setfor weave) and matplotlib config directory
# to allow building in chroots with read-only HOME
export HOME=$(CURDIR)/build
export MPLCONFIGDIR=$(HOME)

# Brian allows to install without extensions.  We want to assure that
# they are there
export BRIAN_SETUP_FAIL_ON_ERROR=1

%:
	dh $@

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


override_dh_auto_install:
	dh_auto_install
	echo "backend : Agg" >| $(MPLCONFIGDIR)/matplotlibrc

	: # Only now lets build docs
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	mkdir -p docs_sphinx/_static # to avoid crashes with older sphinx (e.g. on jaunty)
	export PYTHONPATH=$$(/bin/ls -d $(INSTALL_PATH)/usr/lib/$(PYTHON)/*-packages); \
	{ cd docs_sphinx; sphinx-build -a -E -b html . ../docs; }
	-rmdir docs_sphinx/_static	# remove directory possibly created above
	rm docs/_static/jquery.js
	rm -r docs/.doctrees
	: # objects inventory is of no use for the package
	rm docs/objects.inv
	# : # fresh PDF
	# { cd docs_sphinx/_latexbuild; make clean; make; }
endif

# All tests later on
# cd build to prevent use of local/not-built source tree
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	set -e; cd build; \
	for PYTHON in $(shell pyversions -r); do \
		echo "I: Running Brian unittests using $$PYTHON"; \
		PYTHONPATH=$$(/bin/ls -d $(INSTALL_PATH)/usr/lib/$$PYTHON/*-packages) \
			$$PYTHON /usr/bin/nosetests -v -s -P --exclude='(experimental|modelfitting)' brian; \
	done
endif

	: # Everything is relevant for python-brian pkg -- moving accordingly
	rm -rf debian/python-brian
	mv debian/tmp debian/python-brian

## move binary libraries into -lib
override_dh_pysupport:
	: # Move platform-specific libraries into -lib
	set -e; for lib in $$(find $(PACKAGE_ROOT_DIR)/usr -name '*.so'); do \
	   sdir=$$(dirname $$lib) ; \
	   tdir=$(PACKAGE_ROOT_DIR)-lib/$${sdir#*$(PACKAGE_NAME)/} ; \
	   mkdir -p $$tdir ; \
	   echo "Moving '$$lib' into '$$tdir'." ; \
	   mv $$lib $$tdir ; \
	done
	if [ -x /usr/bin/dh_numpy ]; then dh_numpy -ppython-brian-lib; fi
	dh_pysupport



## 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

## Some custom rules
test_examples: install
	set -e; cd examples; \
	for f in `find -iname *.py`; do echo -n "$$f: "; \
		PYTHONPATH=$$(/bin/ls -d $(CURDIR)/build/lib.*-$(PYTHON_VERSION)) MPLCONFIGDIR=../build \
		python $$f >& $$f.output && echo "Ok" || echo "Failed"; done