File: rules

package info (click to toggle)
python-xmlschema 1.10.0-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,536 kB
  • sloc: python: 30,419; xml: 698; makefile: 56
file content (59 lines) | stat: -rwxr-xr-x 1,737 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
#!/usr/bin/make -f
# -*- makefile -*-

include /usr/share/dpkg/pkg-info.mk


# Copy/generate three artifacts needed by the test suite
export PYBUILD_NAME=xmlschema
define PYBUILD_BEFORE_TEST
  cp setup.py {build_dir}/
  mkdir {build_dir}/doc
  cp doc/conf.py {build_dir}/doc/
endef
export PYBUILD_BEFORE_TEST
export PYBUILD_AFTER_TEST=rm -f {build_dir}/setup.py {build_dir}/doc/conf.py


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

override_dh_auto_build: export http_proxy='127.0.0.1:9'
override_dh_auto_build: export https_proxy='127.0.0.1:9'
override_dh_auto_build:
	dh_auto_build
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=$(CURDIR) $(MAKE) -C doc html
endif

override_dh_auto_install:
	dh_auto_install
	for CMD in xmlschema-json2xml xmlschema-validate xmlschema-xml2json ; \
	do \
		PYTHONPATH=debian/python3-xmlschema/usr/lib/$(shell py3versions -d)/dist-packages/ \
		help2man \
			--version-string $(DEB_VERSION_UPSTREAM) \
			--no-info \
			--output $$CMD.1  \
			--name "REPLACE" \
			debian/python3-xmlschema/usr/bin/$$CMD ;\
	done
	sed -i -e 's/REPLACE/XML to JSON converter/' xmlschema-xml2json.1
	sed -i -e 's/REPLACE/XML validator/' xmlschema-validate.1
	sed -i -e 's/REPLACE/JSON to XML converter/' xmlschema-json2xml.1

override_dh_installdocs:
	dh_installdocs --package=python-xmlschema-doc --doc-main-package=python3-xmlschema
	dh_installdocs --remaining-packages

override_dh_auto_clean:
	dh_auto_clean
	rm -rf doc/_build
	rm -f unicode_categories.json xmlschema/unicode_categories.json
	rm -f *.1

BUILDDIR = $(shell find . -name 'build')
override_dh_auto_test:
	cp mypy.ini requirements-dev.txt $(BUILDDIR)
	dh_auto_test
	rm -f $(BUILDDIR)/mypy.ini $(BUILDDIR)/requirements-dev.txt