#!/usr/bin/make -f

export CFLAGS += -fPIC
export AUTOMAKE = automake-1.11
export ACLOCAL = aclocal-1.11

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	# Disable python modules until we figure out how to build them properly
	F77=gfortran dh_auto_configure -- --with-png-support --disable-python

override_dh_auto_test:
	@echo Tests currently disabled to avoid downloading of data

override_dh_auto_install:
	dh_auto_install
	mv debian/tmp/usr/bin/parser debian/tmp/usr/bin/grib_parser

override_dh_auto_clean:
	dh_auto_clean
	-# Things that upstream leaves behind
	rm -f tests/bitmap.rules tests/out.grib1 tests/out.grib2 tests/out.gribidx \
	      tests/rules tests/simple_ieee_test.grib1.txt tests/statistics.filter \
	      tests/statistics.out tests/x.grib \
	      data/change_scanning_rotated_ll.filter examples/F90/index.idx

override_dh_fixperms:
	dh_fixperms
	test -e /usr/bin/dh_buildinfo && dh_buildinfo
