#!/usr/bin/make -f
# Copyright 2008 Sylvestre Ledru <sylvestre.ledru@inria.fr>

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk

debian/stamp-autotools-files:
	autoreconf -i
	touch debian/stamp-autotools-files

ifneq ($(wildcard /usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/serial/libhdf5.so),)
  WITH_HDF5:=--with-hdf5=/usr/include/hdf5/serial,/usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/serial
else
  WITH_HDF5:=--with-hdf5=/usr/include,/usr/lib/$(DEB_HOST_MULTIARCH)
endif

JAVA_HOME := /usr/lib/jvm/default-java

# Workaround #760301
export CPPFLAGS+="-I$(JAVA_HOME)/include/linux"

DEB_CONFIGURE_EXTRA_FLAGS := CC=gcc

DEB_CONFIGURE_NORMAL_ARGS += --with-jdk=$(JAVA_HOME)/include/,$(JAVA_HOME)/lib/ --with-classpath=$(JAVA_HOME)/lib/ --with-javabin=$(JAVA_HOME)/bin/  --with-libz=yes,/usr/lib --with-libsz=yes,/usr/lib --with-libjpeg=yes,/usr/lib/   $(WITH_HDF5) --with-hdf4=/usr/include/hdf/,/usr/lib/
DEB_CONFIGURE_PREFIX := $(CURDIR)/debian/tmp/

get-orig-source:
	uscan --verbose --force-download --repack --compression xz
