File: rules

package info (click to toggle)
python-pysam 0.7.7-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 11,096 kB
  • ctags: 10,802
  • sloc: ansic: 25,638; python: 3,882; makefile: 157; sh: 12
file content (46 lines) | stat: -rwxr-xr-x 1,207 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
#!/usr/bin/make -f

export PYBUILD_NAME=pysam

DEBPKGNAME := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')
TESTPKG    := $(DEBPKGNAME)-tests

%:
	dh $@ --with python2 --buildsystem=pybuild

# Cython is recreating some c-files.  To enable building twice in a row these
# will be saved in advance and restored afterwards
debian/savefiles:
	mkdir -p debian/savefiles
	cp -a `grep -l "Generated by Cython" pysam/*.c` debian/savefiles

override_dh_clean:
	dh_clean
	# restore cython generated files
	if [ -d debian/savefiles ] ; then \
	    mv debian/savefiles/* pysam ; \
	    rm -rf debian/savefiles ; \
	fi

override_dh_auto_build: debian/savefiles
	dh_auto_build

override_dh_auto_test:
	dh_auto_test  # default tests
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	PYBUILD_SYSTEM=custom \
	PYBUILD_TEST_ARGS="cd tests && PYTHONPATH={build_dir} {interpreter} ./pysam_test_offline.py" \
	dh_auto_test --buildsystem=pybuild
endif

override_dh_install-indep:
	dh_install -p $(TESTPKG)
	cd debian/$(TESTPKG)/usr/share/doc/python-pysam/tests; \
	    make clean; \
	    rm -f log.txt ; \
	    chmod a+x tabix_test.py

override_dh_auto_clean:
	dh_auto_clean
	cd tests; make clean
	rm -f tests/log.txt