#!/usr/bin/make -f

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- \
		--prefix=/usr/share

override_dh_auto_install:
	$(MAKE) install prefix=$(CURDIR)/debian/dxsamples/usr/share

	# We don't need no precompiled binaries.
	$(RM) -f $(CURDIR)/debian/dxsamples/usr/share/dx/samples/data/externalfilter_*
	
	# Some scripts are not marked executable by mistake.  Need to
	# fixup.
	for i in `find $(CURDIR)/debian/dxsamples/usr/share/dx/samples -type f`; do \
		m_head=`head -1 $$i`; \
		test -n "$$m_head" || continue; \
		echo "$$m_head" | egrep -qv '#![[:space:]]*/bin/.*sh' || chmod a+x "$$i"; \
	done
