#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk

DEB_CONFIGURE_EXTRA_FLAGS = --disable-rpath --without-libcap \
	--enable-pinentry-curses --disable-pinentry-qt --enable-pinentry-qt4 --disable-pinentry-gtk --enable-pinentry-gtk2
DEB_INSTALL_DOCS_ALL = NEWS AUTHORS
DEB_DH_INSTALL_SOURCEDIR = debian/tmp

LDFLAGS += -Wl,--as-needed


pre-build:: debian/stamp-custom-prepare qt4/pinentryconfirm.moc qt4/pinentrydialog.moc qt4/qsecurelineedit.moc

debian/stamp-custom-prepare:
	dh_testdir
	make -C debian all
	touch $@

# I guess you're supposed to do this manually, per upstream: 
# <http://lists.gnupg.org/pipermail/gnupg-devel/2009-June/025197.html> 
# --petere@d.o
%.moc: %.h
	moc-qt4 $< >$@

clean::
	rm -f debian/stamp-custom-prepare
	make -C debian clean
	rm -f qt4/*.moc
