#!/usr/bin/make -f
# -*- makefile -*-

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

DEBVERS        := $(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')
VERSION        := $(shell echo '$(DEBVERS)' | sed -e 's/^[0-9]*://' -e 's/-.*//')

%:	
	dh $@ --with javahelper


override_dh_auto_build:
	mkdir -p classes
	javac -cp src -source 1.5 -target 1.5 -d  classes   $(shell find src -name "*.java")
	jar -cf neobio-$(VERSION).jar -C classes neobio -C bin neobio/gui/icons

override_dh_clean:
	rm -f neobio*.jar
	rm -rf classes
	dh_clean

override_dh_installdocs:
	dh_installdocs
	# remove sflogo which triggers privacy-breach-logo lintian error
	sed -i  -e 's#<IMG SRC="http://sourceforge.net/sflogo.php?.* ALT="\([^"]\+\)" />#\1#' \
		-e '/http:\/\/m1.nedstatbasic.net\//,/http:\/\/v1.nedstatbasic.net\//d' \
		debian/*/usr/share/doc/*/html/*.html \
		debian/*/usr/share/doc/*/html/*/*/*.html

get-orig-source:
	. debian/get-orig-source
