File: rules

package info (click to toggle)
mako 1.1.3%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,308 kB
  • sloc: python: 12,072; makefile: 170
file content (74 lines) | stat: -rwxr-xr-x 2,033 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
#!/usr/bin/make -f

#export DH_VERBOSE=1

PY3VERS=$(shell py3versions -vs)
pkgdir = $(CURDIR)/debian/python$(if $(patsubst 3.%,,$(1)),,3)-mako
-include /usr/share/python/python.mk

clean:
	dh_testdir
	dh_testroot
	rm -f build-*
	rm -rf build
	find . -name '*\.py[co]' -delete
	rm -rf .pytest_cache
	rm -rf Mako.egg-info
	dh_clean

build:
build-indep: build-docs
build-arch:

test: $(PY3VERS:%=test-python%)
test-python%:
	-
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	python$* -m pytest -Wignore
endif

build-docs:
ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
	dh_testdir
	dh_installdirs -i
	cd doc/build && sphinx-build -N -q -E -b html . \
	 $(call pkgdir,2.X)-doc/usr/share/doc/python-mako-doc/html/
	rm -rf $(call pkgdir,2.X)-doc/usr/share/doc/python-mako-doc/html/.doctrees
	touch $@
endif

install: $(PY3VERS:%=install-python%) build-docs test
	dh_install
ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
	mv $(CURDIR)/debian/python-mako-doc/usr/share/vim/addons/indent/mako_indent.vim \
	   $(CURDIR)/debian/python-mako-doc/usr/share/vim/addons/indent/mako.vim
	#rm -rf debian/python-mako-doc/usr/share/doc/python-mako/doc/build
endif

install-python%:
	python$* setup.py build_scripts	--executable=/usr/bin/python3
	python$* setup.py install $(py_setup_install_args) \
		--root $(call pkgdir,$*) --prefix=/usr
	([ -d build/lib ] && mv build/lib $(shell python$* -c 'from distutils.command.build import build; from distutils.core import Distribution; b = build(Distribution()); b.finalize_options(); print(b.build_platlib)')) || true

binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installchangelogs -i doc/build/changelog.rst
	dh_installdocs -i
	dh_installexamples -i
	dh_link -i
	dh_installman -i
	dh_python3 -i --shebang=/usr/bin/python3
	dh_compress -i -X.py -X.js -Xmakotemplates.txt
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch:

binary: binary-indep binary-arch

.PHONY: clean build-arch build-indep binary binary-arch binary-indep install