#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

# magic debhelper rule
%:
	dh  $@  --with=python-support


DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH)

override_dh_auto_build:
	$(MAKE) -C Src all
	dh_auto_build
	# For some reason, dh_strip isn't stripping this properly, according to lintian
	strip Src/libsphere.a

override_dh_auto_install:
	$(MAKE) -C Src install DESTDIR=`pwd`/debian/tmp PREFIX=/usr LIBDIR=$(LIBDIR)
	dh_auto_install
	dh_link -p libsphere-dev $(LIBDIR)/libsphere.so.0d $(LIBDIR)/libsphere.so
	dh_numpy

override_dh_auto_clean:
	dh_clean
	$(MAKE) -C Src clean || echo "No clean target in original Makefile"
	rm -rf build
