#!/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 =

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 -- \
	        --with-python=/usr/bin/python3 \
	        --enable-opencc

execute_after_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
