#!/usr/bin/make -f PROLOG_ABI = $(shell swipl --abi_version | sed 's/^swipl-abi-//') cmd = eye.pvm # generate manpage with help2man from --help option of executable _mkman = help2man $(if $3,--name "$(strip $3)") --no-info --no-discard-stderr --output $2 $1 \ || { $1 --help; false; } override_dh_auto_build: swipl -q -f eye.pl -g main -- --image $(cmd) $(call _mkman, ./$(cmd), debian/$(cmd).1, \ Euler Yet another proof Engine (EYE) semantic web reasoning engine) # fix hashbang override_dh_installexamples: dh_installexamples find debian/*/usr/share/doc/*/examples -type f -name test -print0 | \ xargs -r0 sed -i -e '2s|^eye |eye.pvm |' override_dh_gencontrol: dh_gencontrol -- -V"prolog:ABI=$(PROLOG_ABI)" %: dh $@