#!/usr/bin/make -f

export DH_VERBOSE=1

# The magic debhelper  rule
%:
	dh $@ 

DESTDIR:=`pwd`/debian/tmp/
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH)

# For the moment, serial hdf5 only
WITH_HDF5:=--with-hdf5=/usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/serial

override_dh_auto_configure:
	./configure --prefix=/usr --libdir=$(LIBDIR) \
		--enable-python \
		$(WITH_HDF5)  \
		HDF4_INCLUDE=/usr/include/hdf \
		UDUNITS2LIBS=-ludunits2 \
		PYTHON=python3

override_dh_auto_install:
	dh_auto_install
	find debian -name '*.la' -delete
	rm debian/tmp/usr/share/harp/doc/html/_static/jquery*
	rm debian/tmp/usr/share/harp/doc/html/_static/underscore*
	rm -rf debian/tmp/usr/share/harp/doc/html/_static/fonts
