#!/usr/bin/make -f
%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- --disable-werror

override_dh_auto_build:
	dh_auto_build
	cd pythonpath && \
		$(MAKE)
	cd java && \
		mkdir -p org/numbertext/data && \
		$(MAKE)
	zip -d java/numbertext.jar org/numbertext/Numbertext.java
	zip -d java/numbertext.jar org/numbertext/Soros.java


override_dh_auto_test:
	cd test && $(MAKE)
	cd java && $(MAKE) check

override_dh_install:
	cat description.xml.in | bin/shellhtml >description.xml
	dh_install
	rm -f debian/libreoffice-numbertext/usr/lib/libreoffice/share/extensions/numbertext/idl/buildrdb.sh

override_dh_auto_clean:
	rm -rf java/numbertext.jar java/org/numbertext/Numbertext.class java/org/numbertext/Soros.class java/org/numbertext/data
	rm -f src/Soros.pyc
	rm -f pythonpath/numbertext_*.py pythonpath/org/Numbertext/Soros.py pythonpath/org/Numbertext/locales.py pythonpath/org/Numbertext/places.py
	rm -f description.xml
	rm -rf test/testSubDir
	dh_auto_clean

