#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

DEBPKGNAME     := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

Changes: README
	sed -ne '/License terms/q; /^Changes/,$$p' < $< > $@

build: Changes
	dh $@ --with autoreconf

clean:
	rm -f Changes
	dh $@ --with autoreconf

%:
	dh $@ --with autoreconf

override_dh_clean:
	dh_clean
	rm -rf *.lo *.la *.o .libs
	rm -rf *.c libtool stamp-h1 Makefile

override_dh_install:
	dh_install
	d-shlibmove --commit \
		    --multiarch \
		    --exclude-la \
		    --movedev debian/tmp/usr/include/* usr/include \
		    debian/tmp/usr/lib/*/$(DEBPKGNAME).so

override_dh_strip:
	dh_strip --dbg-package=libzerg0-dbg
