#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

# minimise needless linking
export DEB_LDFLAGS_MAINT_APPEND= -Wl,--as-needed

%:
	dh $@ --buildsystem=cmake

override_dh_clean:
	dh_clean
	chmod -x *.png *.desktop

#override_dh_makeshlibs:
#	dh_makeshlibs -V

zint.1:
	help2man --no-info --name="command line utility to encode data in barcode symbols" \
                 --version-string $$(./debian/tmp/usr/bin/zint |sed -n 's/^Zint version *//p') \
            ./debian/tmp/usr/bin/zint > $@
	perl \
             -E 's{\s+(It was generated by help2man)}{ $$1}sm;   # correcting help2man comment'               \
             -E 's{^Zint\sversion\s+[\d.]+\s+}{}sm;              # correcting DESCRIPTION section'            \
             -E 's{^(\.TP$$)}{.SH OPTIONS\n$$1}sm;               # create OPTIONS section'                    \
          -0pi $@
