#! /usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 PKG=tuxmath # minimise needless linking export DEB_LDFLAGS_MAINT_APPEND= -Wl,--as-needed %: dh $@ override_dh_autoreconf: dh_autoreconf --as-needed override_dh_auto_configure: dh_auto_configure -- \ --host=$(DEB_HOST_GNU_TYPE) \ --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr \ --mandir=\$${prefix}/share/man \ --infodir=\$${prefix}/share/info \ --bindir=\$${prefix}/lib/tuxmath override_dh_auto_install: dh_auto_install --destdir=$(CURDIR)/debian/tmp override_dh_install: dh_install -X*.ico -X*.icns override_dh_installchangelogs: dh_installchangelogs doc/changelog MAN_NAME=a math game for kids with Tux tuxmath.6: help2man --no-discard-stderr --no-info --name="$(MAN_NAME)" src/tuxmath > $@ perl -0 \ -E 's{\s+(It was generated by help2man)}{ $$1}; # correct help2man comment' \ -E 's{^Tux,}{$(MAN_NAME)}; # correct DESCRIPTION section' \ -E 's{^\.PP\s*Run the game with:}{\n.SH OPTIONS}sm; # create OPTIONS section' \ -E 's{^(\\fB\\-\\-)}{.TP\n$$1}mg; # prepend each option with .TP' \ -E 's{\\fR(?:\s\w+)?\K\s*\\-\s*}{\n}mg; # separate options and their descriptions' \ -E 's{^.IP\s*(?!\\)}{}smg; # merge short lines' \ -E 's{^([a-z\\-]+:\s)}{ $$1}mg; # pad list elements' \ -E 's{^\.PP\s*\.TP}{.TP}mg; # clean-up redundant .PP before .TP' \ -pi $@