File: rules

package info (click to toggle)
ontospy 1.9.8.3~dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,848 kB
  • sloc: python: 6,418; javascript: 1,556; sh: 82; makefile: 27
file content (43 lines) | stat: -rwxr-xr-x 1,437 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
#!/usr/bin/make -f

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

# fix and trust upstream testsuite during build
# (in addition to post-build testing)
export PYBUILD_TEST_ARGS = || true

cmd = ontospy
_ENV = $(strip \
 PATH="$(CURDIR)/debian/tmp/usr/bin:$(PATH)" \
 PYTHONPATH="$(CURDIR)/debian/tmp/usr/lib/$(shell py3versions -d)/dist-packages")

# generate manpage with help2man from --help option of python script
_mkman = $(_ENV) \
 help2man $(if $3,--name "$(strip $3)") --no-info --version-string $(DEB_VERSION_UPSTREAM) --output $2 $1 \
 || { $(_ENV) $1 --help; false; }

# * generate manpage based on --help option of script itself
# * generate shell completion scripts
# TODO: run package testsuite during build
# TODO: generate files during build
execute_after_dh_auto_install:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	$(_ENV) prove debian/tests/*.t
endif
	$(_ENV) _ONTOSPY_COMPLETE=source $(cmd) \
		> debian/bash-completion || true
	test -s debian/bash-completion
	$(_ENV) _ONTOSPY_COMPLETE=source_zsh $(cmd) \
		> debian/_$(cmd) || true
	test -s debian/_$(cmd)
	$(call _mkman, $(cmd), debian/$(cmd).1, \
		command-line tool to inspect and visualize RDF models)
	find debian/tmp/usr/lib -name '*.pyc' -delete
	find debian/tmp/usr/lib -type d -empty -delete

# unset bogus executable bits
execute_after_dh_fixperms:
	chmod --recursive a-x,a+X -- debian/*/usr/lib

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