#!/usr/bin/make -f

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

LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)

override_dh_clean:
	dh_clean
	find $(CURDIR) -name Makefile -delete
	for filename in common/config.h common/stamp-h1 dpkg/copyright libtool po/Makefile.in po/POTFILES\
		include/libewf/features.h macosx/libewf.pmdoc/*.xml;\
	do rm -f $$filename; done

override_dh_auto_configure:
	dh_auto_configure -- --enable-python LDFLAGS="-Wl,--as-needed $(LDFLAGS)"

override_dh_strip:
	dh_strip --dbg-package=libewf-dbg

override_dh_makeshlibs:
	dh_makeshlibs -a -V

override_dh_install:
	find debian/tmp/usr/lib  -name "*.la" -exec \
	sed -i -e "s,^dependency_libs=.*,dependency_libs=''," {} +
	dh_install
	rm -f debian/python-libewf/usr/lib/python2.7/dist-packages/*.a

%:
	dh $@  --with autoreconf,python2

