File: rules

package info (click to toggle)
cssutils 1.0-4.1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,376 kB
  • sloc: python: 20,145; sh: 102; makefile: 62
file content (72 lines) | stat: -rwxr-xr-x 3,027 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
#!/usr/bin/make -f

export PYBUILD_NAME=cssutils
export PYBUILD_DEST_DIR_python2=debian/python-cssutils
export PYBUILD_TEST_python2=--test-nose
export PYBUILD_INSTALL_ARGS_python2=--install-layout=deb
export PYBUILD_DEST_DIR_python3=debian/python3-cssutils
export PYBUILD_TEST_python3=--test-nose
export PYBUILD_INSTALL_ARGS_python3=--install-layout=deb

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

override_dh_auto_test:
	# Disable buggy tests.
	PYBUILD_SYSTEM=custom \
	    PYBUILD_TEST_ARGS_python2="nosetests -v \
	                                         --exclude=test_parseString \
					         --exclude=test_parseFile \
					         --exclude=test_parseUrl \
					         --exclude=test_combine \
					         --exclude=test_cssText2 \
					         --exclude=test_getMetaInfo \
					         --exclude=test_errorhandler.py \
					         --exclude=test_handlers \
					         --exclude=test_parseUrl \
					         --exclude=test_namespaces1 \
					         --where {build_dir}/cssutils/tests;" \
	    PYBUILD_TEST_ARGS_python3="nosetests3 -v \
	                                         --exclude=test_parseString \
					         --exclude=test_parseFile \
					         --exclude=test_parseUrl \
					         --exclude=test_combine \
					         --exclude=test_cssText2 \
					         --exclude=test_getMetaInfo \
					         --exclude=test_errorhandler.py \
					         --exclude=test_handlers \
					         --exclude=test_parseUrl \
					         --exclude=test_namespaces1 \
					         --py3where {build_dir}/cssutils/tests;" \
	    dh_auto_test

override_dh_auto_install:
	dh_auto_install
	# Remove py3 executables from py2 package
	rm $(PYBUILD_DEST_DIR_python2)/usr/bin/cssparse_py3
	rm $(PYBUILD_DEST_DIR_python2)/usr/bin/csscombine_py3
	rm $(PYBUILD_DEST_DIR_python2)/usr/bin/csscapture_py3
	# Remove py2 executables from py3 package
	rm $(PYBUILD_DEST_DIR_python3)/usr/bin/cssparse_py2
	rm $(PYBUILD_DEST_DIR_python3)/usr/bin/csscombine_py2
	rm $(PYBUILD_DEST_DIR_python3)/usr/bin/csscapture_py2

override_dh_installman:
	cp debian/man/cssparse.manpage1 debian/man/cssparse_py2.1
	dh_installman -p python-cssutils debian/man/cssparse_py2.1
	cp debian/man/csscombine.manpage1 debian/man/csscombine_py2.1
	dh_installman -p python-cssutils debian/man/csscombine_py2.1
	cp debian/man/csscapture.manpage1 debian/man/csscapture_py2.1
	dh_installman -p python-cssutils debian/man/csscapture_py2.1
	cp debian/man/cssparse.manpage1 debian/man/cssparse_py3.1
	dh_installman -p python3-cssutils debian/man/cssparse_py3.1
	cp debian/man/csscombine.manpage1 debian/man/csscombine_py3.1
	dh_installman -p python3-cssutils debian/man/csscombine_py3.1
	cp debian/man/csscapture.manpage1 debian/man/csscapture_py3.1
	dh_installman -p python3-cssutils debian/man/csscapture_py3.1

override_dh_auto_clean:
	rm -f debian/man/cssparse_py2.1 debian/man/csscombine_py2.1 \
		debian/man/csscapture_py2.1
	rm -f debian/man/cssparse_py3.1 debian/man/csscombine_py3.1 \
		debian/man/csscapture_py3.1