#!/usr/bin/make -f
# -*- makefile -*-

#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

LDFLAGS+= -Wl,--as-needed

%:
	dh $@ --with autoreconf

override_dh_auto_clean:
	dh_auto_clean
	find . -name Makefile.in -type f -delete \
	&& $(RM) aclocal.m4

override_dh_autoreconf:
	dh_autoreconf -v --as-needed
	intltoolize --copy --force && aclocal

override_dh_auto_configure:
	dh_auto_configure -- \
		--prefix=/usr \
		--datadir=/usr/share \
		--mandir=/usr/share/man \
		--libdir=/usr/lib/giggle \
		--infodir=/usr/share/info \
		--host=$(DEB_HOST_GNU_TYPE) \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--with-help-dir=/usr/share/help
		# note: --with-help-dir breaks (y|h)elp if it's not '/usr/share/help'

override_dh_auto_install:
	dh_auto_install --destdir=$(CURDIR)/debian/tmp

override_dh_installchangelogs:
	dh_installchangelogs NEWS

override_dh_makeshlibs:
	dh_makeshlibs --noscripts --exclude=giggle-personal-details-plugin --exclude=giggle-terminal-view-plugin

get-orig-source:
	uscan --noconf --force-download --repack --rename --download-current-version --verbose --destdir=.
