File: rules

package info (click to toggle)
python-ruffus 2.8.1-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 15,972 kB
  • sloc: python: 17,415; makefile: 214; sh: 17
file content (68 lines) | stat: -rwxr-xr-x 2,554 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
#!/usr/bin/make -f

DH_VERBOSE := 1

include /usr/share/dpkg/default.mk

docpkg:=$(DEB_SOURCE)-doc

export PYBUILD_NAME=ruffus

%:
	dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild

override_dh_auto_build:
	dh_auto_build
	make --directory=doc html

override_dh_installdocs:
	dh_installdocs -ppython-ruffus-doc doc/_build/html
	dh_installdocs -A

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test -- --test --system=custom \
		--test-args='set -e; \
			    cd {build_dir}/$(PYBUILD_NAME)/test ; \
			    if [ "{version.major}" = 2 ] ; then \
			        if [ -e $(CURDIR)/ruffus/test/Makefile ] ; then ln -s $(CURDIR)/ruffus/test/Makefile ; else \
			            echo "Expected file $(CURDIR)/ruffus/test/Makefile not found" ; \
			            echo "Use `find $(CURDIR) -name Makefile | grep test` instead" ; \
			            ln -s `find $(CURDIR) -name Makefile | grep test | head -n1` ; \
			        fi ; \
			        cp -a run_all_unit_tests.cmd /tmp/run_all_unit_tests.cmd ; \
			    else \
				sed "s/^python3/python{version}/" run_all_unit_tests3.cmd > /tmp/run_all_unit_tests.cmd ; \
			    fi ;\
                            PYTHONPATH={build_dir} HOME=`mktemp -d` bash /tmp/run_all_unit_tests.cmd'
	find . -name .ruffus_history.sqlite -delete
	find . -name "*.pyc" -delete
	find . -name __pycache__ | xargs rm -rf
	find .pybuild -name tmp | xargs rm -rf
endif

override_dh_auto_clean:
	dh_auto_clean
	rm -rf ruffus/test/temp_branching_dir \
	       ruffus/test/temp_filesre_combine \
	       ruffus/test/test_pausing_dir \
	       ruffus/test/tmp_test_job_history_with_exceptions \
	       ruffus/test/.ruffus_history.sqlite \
	       ruffus/__pycache__ \
	       doc/_build/html \
	       doc/_build/doctrees \
	       ruffus/test/*.log \
	       .ruffus_history.sqlite

override_dh_install:
	dh_install
	# test files have all #!/usr/bin/python which looks wrong in python3 package
	find debian/python3-$(PYBUILD_NAME)/usr/lib/python3*/dist-packages/ruffus/test -name "*.py" -exec sed -i 's+^\(#!/usr/bin/.*python\)[[:space:]]*$$+\13+' \{\} \;
	# leave only the test starter that fits Python version
	find debian/python3-$(PYBUILD_NAME) -name run_all_unit_tests.cmd -delete
	find debian/python-$(PYBUILD_NAME) -name run_all_unit_tests3.cmd -delete
	sed -i '1s?^#! */usr/bin/env *python *$$?#!/usr/bin/python3?' `grep -Rl '^#! */usr/bin/env *python *$$' debian/python3-$(PYBUILD_NAME)`

override_dh_fixperms:
	dh_fixperms
	find debian -name "run_all_unit_tests*.cmd" -executable -exec chmod -x \{\} \;