#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

PYTHON3=$(shell py3versions -vr)
PKGDIR=$(CURDIR)/debian/python3-sympy

%:
	dh  $@ --with python3

build-python%:
	python$* setup.py build

override_dh_auto_build: $(PYTHON3:%=build-python%)

install-python%:
	python$* setup.py install --root=$(PKGDIR) --install-layout=deb

override_dh_auto_install: $(PYTHON3:%=install-python%)
	mv $(PKGDIR)/usr/bin/isympy $(PKGDIR)/usr/bin/isympy3
	mv $(PKGDIR)/usr/share/man/man1/isympy.1 $(PKGDIR)/usr/share/man/man1/isympy3.1

MPMATHDIR = sympy/mpmath
override_dh_clean:
	dh_clean
	for f in torture.py extratest_gamma.py; do \
	  rm -f $(MPMATHDIR)/tests/$$f; \
	done
