#!/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