#!/usr/bin/make -f

# set the MPLCONFIGDIR to avoid writing into non writable location
export HOME=$(CURDIR)/build
export MPLCONFIGDIR=$(CURDIR)/build

# Use agg Matplotlib backend for testing on headless machines.
export MPLBACKEND=agg

%:
	dh $@ --with python2

override_dh_auto_build:
	dh_auto_build -- --use-system-libraries

override_dh_shlibdeps:
	dh_shlibdeps
	dh_numpy

override_dh_installchangelogs:
	dh_installchangelogs docs/changelog.rst

override_dh_auto_clean:
	dh_auto_clean
	rm -rf build astropy.egg-info
	rm -rf astropy_helpers-*.egg
	rm -rf docs/_build docs/_generated

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	python setup.py test -vv --args "-vv --mpl"
endif

override_dh_strip_nondeterminism:
	dh_strip_nondeterminism -Xinvalid.dat.gz
