#!/usr/bin/make -f

DEB_CONFIGURE_EXTRA_FLAGS := \
	--disable-shared \
	--disable-utilities \
	--disable-doc-install \
	--enable-netcdf-4 \
	--with-hdf5=/usr \
	--with-udunits \
	--with-libcf \
	--with-enable-dap \
	--disable-dap-remote-tests \
	--disable-cxx \
	--enable-f77 \
	--enable-f90 \
	--enable-separate-fortran \
	--includedir=/usr/include/netcdf-g95 \
	--with-gnu-ld
OPT_FFLAGS := -g -O2 -fPIC
DEB_CONFIGURE_SCRIPT_ENV := FC="g95"
DEB_CONFIGURE_SCRIPT_ENV += FCFLAGS="$(OPT_FFLAGS)"
DEB_CONFIGURE_SCRIPT_ENV += F77="g95"
DEB_CONFIGURE_SCRIPT_ENV += FFLAGS="$(OPT_FFLAGS)"
DEB_CONFIGURE_SCRIPT_ENV += F90="g95"
DEB_CONFIGURE_SCRIPT_ENV += F90FLAGS="$(OPT_FFLAGS)"
DEB_CONFIGURE_SCRIPT_ENV += CXX="g++"
DEB_CONFIGURE_SCRIPT_ENV += CXXFLAGS="$(OPT_FFLAGS)"
DEB_CONFIGURE_SCRIPT_ENV += CC="gcc"
DEB_CONFIGURE_SCRIPT_ENV += CFLAGS="$(OPT_FFLAGS)"

#DEB_DH_INSTALL_SOURCEDIR = debian/tmp
%:
	dh $@ --with quilt

override_dh_auto_configure:
	dh_auto_configure -- \
	  $(DEB_CONFIGURE_SCRIPT_ENV) $(DEB_CONFIGURE_EXTRA_FLAGS)
