#!/usr/bin/make -f

# See debhelper(7) (uncomment to enable).
# Output every command that modifies files on the build system.
#export DH_VERBOSE = 1


# See FEATURE AREAS in dpkg-buildflags(1).
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# See ENVIRONMENT in dpkg-buildflags(1).
# Package maintainers to append CFLAGS.
#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
# Package maintainers to append LDFLAGS.
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

UPSTREAM_VERSION := $(shell dpkg-parsechangelog --show-field Version | sed -e 's/^0.0~repack//' | sed -e 's/-[^-]*$$//')

%:
	dh $@

override_dh_auto_build:
	dh_auto_build
	./debian/convert_dictd.py cedict_ts.u8 > cc-cedict-utf8.txt
	dictfmt -s "CC-CEDICT Chinese-English dictionary version $(UPSTREAM_VERSION)" -f --utf8 cc-cedict < cc-cedict-utf8.txt
	dictzip cc-cedict.dict
