#!/usr/bin/make -f

ifneq (,$(DEB_MAINTAINER_MODE))
  # Enable stuff not policy compliant (eg. unsuitable for build daemons)
  DEB_COPYRIGHT_CHECK_STRICT = yes
endif

include debian/cdbs/1/rules/copyright-check.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/cmake.mk

# Allow test programs that uses OpenMPI to run
export OMPI_MCA_plm_rsh_agent=/bin/false

DEB_COMPRESS_EXCLUDE := .py .cpp .h .pdf
DEB_INSTALL_DOCS_ALL += AUTHORS README TODO

DEB_CMAKE_EXTRA_FLAGS= \
	-D BUILD_SHARED_LIBS:BOOL=ON \
	-D CMAKE_SKIP_RPATH:BOOL=ON \
	-D CMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=OFF \
	-D DOLFIN_ENABLE_TRILINOS:BOOL=ON \
	-D Trilinos_DIR:PATH=/usr/include/trilinos \
	-D DOLFIN_ENABLE_CGAL:BOOL=OFF \
	-D DOLFIN_ENABLE_MTL4:BOOL=OFF \
	-D DOLFIN_ENABLE_PARMETIS:BOOL=OFF \
	-D DOLFIN_ENABLE_UNIT_TESTS:BOOL=OFF \
	..

USCAN_DESTDIR := $(CURDIR)

binary-install/python-dolfin::
	dh_pycentral -p$(cdbs_curpkg)

binary-install/dolfin-bin::
	dh_pycentral -p$(cdbs_curpkg)

get-orig-source:
	uscan --force-download --verbose --destdir $(USCAN_DESTDIR) \
	 --download-version $(DEB_UPSTREAM_VERSION) \
	 --upstream-version $(DEB_UPSTREAM_VERSION)
