#!/usr/bin/make -f DH_OPTIONS = -O--buildsystem=pybuild cmd = silkaj _ENV = $(strip \ PATH="$(CURDIR)/build/scripts-$(shell py3versions -dv):$(PATH)" \ PYTHONPATH="$(CURDIR)/.pybuild/cpython3_$(shell py3versions -dv)/build") _ENV_staged = $(strip \ PATH="$(CURDIR)/debian/silkaj/usr/bin:$(PATH)" \ PYTHONPATH="$(CURDIR)/debian/silkaj/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 --output $2 $1 \ || { $(_ENV) $1 --help; false; } # generate shell completion scripts override_dh_auto_build: dh_auto_build $(_ENV) \ _SILKAJ_COMPLETE=source $(cmd) \ > debian/bash-completion || true test -s debian/bash-completion $(_ENV) \ _SILKAJ_COMPLETE=source_zsh $(cmd) \ > debian/_$(cmd) || true test -s debian/_$(cmd) # check shell script override_dh_auto_test: dh_auto_test $(_ENV) prove debian/tests/*.t # generate manpage based on --help option of script itself # * Fix encode special Duniter signature "Ğ" override_dh_auto_install: _ENV = $(_ENV_staged) override_dh_auto_install: dh_auto_install $(call _mkman, $(cmd), debian/$(cmd).1, \ command-line client for Duniter) perl -i -pe 's/\?\?(?=1|Test)/ \\\[u011E\]/g' \ debian/$(cmd).1 find debian/silkaj/usr/lib -name '*.pyc' -delete find debian/silkaj/usr/lib -type d -empty -delete %: dh $@ --with python3,bash-completion $(DH_OPTIONS:-O%=%)