#!/usr/bin/make -f
#DH_VERBOSE = 1

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

export V=1

# To ensure ./configure does not run twice.
export NOCONFIGURE=yes

%:
	dh $@ --with python3

override_dh_autoreconf:
	dh_autoreconf $(CURDIR)/autogen.sh

override_dh_auto_configure:
	dh_auto_configure -- --libexecdir=/usr/lib/ibus --with-python=/usr/bin/python3

override_dh_strip:
	dh_strip --ddeb-migration='ibus-libzhuyin-dbg (<< 1.7.6-2~)'

override_dh_auto_install:
	dh_auto_install
	rm -f $(CURDIR)/debian/*/usr/share/doc/ibus-libzhuyin/ChangeLog
	rm -f $(CURDIR)/debian/*/usr/share/doc/ibus-libzhuyin/COPYING
	rm -f $(CURDIR)/debian/*/usr/share/doc/ibus-libzhuyin/INSTALL
	rm -f $(CURDIR)/debian/*/usr/share/doc/ibus-libzhuyin/NEWS
