#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
BUILDDIR := $(CURDIR)/debian/tmp

%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean -- -C src
	rm -f src/version.texinfo

override_dh_auto_build:
	dh_auto_build -- -Wall -C src PREFIX=/usr NE_GLOBAL_DIR=/usr/share/ne LIBS=-ltinfo

override_dh_auto_install:
	dh_auto_install -- DESTDIR=$(BUILDDIR) PREFIX=/usr
	# upstream does not ship ne.info.gz maximally compressed, so
	# uncompress it here and let dh_compress later do the job right
	gunzip $(BUILDDIR)/usr/share/info/ne.info*.gz
