#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Aim for the top, adapt if anything should break on the buildds.
DEB_BUILD_MAINT_OPTIONS=	hardening=+all
export DEB_BUILD_MAINT_OPTIONS

# Large File Support
LFS_CFLAGS:=	$(shell getconf LFS_CFLAGS 2>/dev/null || echo "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64")
LFS_LDFLAGS:=	$(shell getconf LFS_LDFLAGS 2>/dev/null || true)

DEB_CFLAGS_MAINT_APPEND=	$(LFS_CFLAGS)
DEB_LDFLAGS_MAINT_APPEND=	-Wl,--as-needed $(LFS_LDFLAGS)
export DEB_CFLAGS_MAINT_APPEND DEB_LDFLAGS_MAINT_APPEND

AUTOPOINT=	intltoolize --automake --copy
export AUTOPOINT

ifeq (,$(filter werror,$(DEB_BUILD_OPTIONS)))
werror=		no
else
werror=		yes
endif

get-orig-source:
	. debian/get-orig-source.sh
	
override_dh_auto_configure:
	dh_auto_configure -- --with-werror=$(werror)

override_dh_auto_test:
	[ -f po/POTFILES.skip ] || cp debian/POTFILES.skip po/
	dh_auto_test

override_dh_installchangelogs:
	dh_installchangelogs NEWS

%:
	dh $@ --parallel --with autoreconf
