#!/usr/bin/make -f

USCAN_DESTDIR := $(CURDIR)

%:
	dh $@ --with python2

override_dh_python2:
	dh_numpy
	dh_python2

override_dh_compress:
	dh_compress -X.py -X.pdf -X.ufl

override_dh_auto_clean:
	rm -f cmake/templates/UFCConfig.cmake
	rm -f cmake/templates/UFCConfigVersion.cmake
	rm -f cmake/templates/UseUFC.cmake
	rm -f cmake/templates/ufc-1.pc

override_dh_auto_install:
	dh_auto_install
	sed -i "s/-Werror=format-security//g" $(CURDIR)/debian/python-ffc/usr/lib/pkgconfig/ufc-1.pc
	sed -i "s/-g//g" $(CURDIR)/debian/python-ffc/usr/lib/pkgconfig/ufc-1.pc
	sed -i "s/-O2//g" $(CURDIR)/debian/python-ffc/usr/lib/pkgconfig/ufc-1.pc
	sed -i "s/-Wformat//g" $(CURDIR)/debian/python-ffc/usr/lib/pkgconfig/ufc-1.pc
	sed -i "s|-I/usr/local/include||g" $(CURDIR)/debian/python-ffc/usr/lib/pkgconfig/ufc-1.pc

.PHONY: get-orig-source
get-orig-source:
	uscan --force-download --verbose --destdir $(USCAN_DESTDIR)
