#!/usr/bin/make -f
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

%:
	dh $@

override_dh_autoreconf:
	touch ChangeLog
	glib-gettextize --copy --force
	dh_autoreconf --as-needed

override_dh_auto_configure:
	dh_auto_configure -- --with-default-keyboard=2

DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
XP=xsltproc -''-nonet

override_dh_auto_build:
	dh_auto_build
	$(XP) -o $(CURDIR)/debian/nabi.1 $(DB2MAN) $(CURDIR)/debian/nabi.dbk

override_dh_installdocs:
	dh_installdocs
	cd $(CURDIR)/debian/nabi/usr/share/nabi/themes/ && for D in *; do \
	  if [ -f $$D/README ]; then \
	    echo $$D/README; \
	    mv $$D/README ../../doc/nabi/README.themes.$$D || exit 1; \
	  fi; \
	done
