File: rules

package info (click to toggle)
python-schema-salad 8.4.20230213094415-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,440 kB
  • sloc: python: 14,250; cs: 1,771; java: 1,243; makefile: 189; xml: 184; sh: 108; javascript: 46
file content (54 lines) | stat: -rwxr-xr-x 1,885 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
#!/usr/bin/make -f

DH_VERBOSE := 1

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

export PYBUILD_NAME=schema-salad
#export PYBUILD_DISABLE=test
export SCHEMA_SALAD_USE_MYPYC=1
export MYPYPATH=$(CURDIR)/mypy-stubs
#export SETUPTOOLS_SCM_PRETEND_VERSION=${DEB_VERSION_UPSTREAM}

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

override_dh_auto_build:
	dh_auto_build
	PYTHONPATH=. help2man --no-info \
		   --version-string=${DEB_VERSION_UPSTREAM} \
		   --no-discard-stderr \
		--name="Schema Annotations for Linked Avro Data (SALAD)" \
		python3\ -m\ schema_salad > debian/schema-salad-tool.1
	sed -i 's/python3 -m schema_salad/schema-salad-tool/g' \
		debian/schema-salad-tool.1
	sed -i 's/__main__.py/schema-salad-tool/g' debian/schema-salad-tool.1
	sed -i 's/PYTHON/SCHEMA-SALAD-TOOL/g' debian/schema-salad-tool.1
	PYTHONPATH=. help2man --no-info \
		   --version-string=${DEB_VERSION_UPSTREAM} \
		   --no-discard-stderr \
		--name="Schema Annotations for Linked Avro Data (SALAD)" \
		python3\ -m\ schema_salad.makedoc > debian/schema-salad-doc.1
	sed -i 's/python3 -m schema_salad.makedoc/schema-salad-doc/g' \
		debian/schema-salad-doc.1
	sed -i 's/__main__.py/schema-salad-doc/g' debian/schema-salad-doc.1
	sed -i 's/PYTHON/SCHEMA-SALAD-DOC/g' debian/schema-salad-doc.1
	find . -name "*.coverage" -delete

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_install
	PYBUILD_SYSTEM=custom \
	PYBUILD_TEST_ARGS="cd {dir}; export PATH={destdir}/usr/bin:$$PATH ; \
	cd {build_dir}; export PYTHONPATH=$$(pwd); {interpreter} -m pytest \
		-rs -n auto -k 'not (test_secondaryFiles or test_outputBinding or test_yaml_tab_error or test_bad_schemas)' \
		--pyargs schema_salad" dh_auto_test
endif

override_dh_auto_install:
	dh_auto_install
	find debian -name LICENSE -delete
	find debian -name '*.cwl' -exec chmod a+x {} \;

override_dh_auto_clean:
	rm -f debian/*.1