#!/usr/bin/make -f

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

# Magic debhelper 7 rule
%:
	dh   $@

override_dh_auto_clean:
	find . -type l -delete 
	rm -f libtool config.status config.log

override_dh_auto_configure:
	autoreconf
	dh_auto_configure -- --enable-shared --with-pic \
		CFLAGS="" CPPFLAGS="-Df2cFortran -I/usr/include/hdf"
	# FIXME: a sort of hack
	ln -sf testswath.f testdrivers/swath/testswath77.f
	ln -sf testpoint.f testdrivers/point/testpoint77.f
	# Delete the libtool crap and install debian libtool
	rm -f libtool
	ln -sf /usr/bin/libtool . 

override_dh_auto_install:
	dh_auto_install
	# Undo permissions we don't want
	$(MAKE) -C samples clean
	chmod -x samples/*
	rm config.status config.log
