File: rules

package info (click to toggle)
mdp 3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,100 kB
  • sloc: python: 22,278; makefile: 31; sh: 6
file content (49 lines) | stat: -rwxr-xr-x 1,527 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
#!/usr/bin/make -f
#DH_VERBOSE=1

RSEED:=1029384756

PYTHON2:=$(shell pyversions -vr)

# Check if python3-numpy is available
# This is needed until python3-numpy is uploaded to sid to
# simplify backporting to squeeze and older ubuntus
DH_PYTHON3_STR:=$(shell python3 -c 'import numpy' > /dev/null 2>&1 && \
                  echo ",python3" || echo "")
PYTHON3:=$(shell python3 -c 'import numpy' > /dev/null 2>&1 && \
           py3versions -vr || echo "")


PYTHONALL:=$(PYTHON2) $(PYTHON3)

include /usr/share/python/python.mk

INSTALLPATH:=$(CURDIR)/debian/tmp

%:
	dh $@ --with python2$(DH_PYTHON3_STR)

# override dh_auto_install is not needed once dh_python3 knows
# how to install python3 modules... 
override_dh_auto_install: 
	dh_auto_install --destdir=$(INSTALLPATH)
	set -e && for v in $(PYTHON3); do \
	  python$$v setup.py install $(py_setup_install_args) \
	      --root=$(INSTALLPATH); \
	done
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	set -xe && for v in $(PYTHONALL); do \
	  LOC=$(INSTALLPATH)$(call py_libdir_sh, $$v); \
	  python$$v $$LOC/mdp/test/run_tests.py --seed $(RSEED) $$LOC/mdp $$LOC/bimdp; \
	done
	: # Prune compiled code which could have been generated during testing
	find \( -name __pycache__ -o -name \*.pyc -o -name \*.egg-info \) -delete
endif

override_dh_installchangelogs:
	dh_installchangelogs -k CHANGES

override_dh_auto_clean:
	dh_auto_clean
	find -name build -type d -print0 | xargs -0 /bin/rm -r -f
	find \( -name __pycache__ -o -name \*.pyc -o -name \*.egg-info \) -delete