#!/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

JAVA_HOME=/usr/lib/jvm/default-java
export CLASSPATH=/usr/share/java/commons-compress.jar:/usr/share/java/commons-lang.jar:/usr/share/java/rome.jar:/usr/share/java/jdom1.jar

%:
	dh --with javahelper,quilt $@

#override_jh_build:
	# So far this doesn't work as well as building with a build.xml file (provided by a patch).
	# However in the long run we should make it work as upstream doesn't provide a buildsystem.
	# Due to a bug in javahelper (<< 0.29) the --javadoc-opts won't get passed.
	# We either workaround by using "--no-javadoc" or depend on a higher javahelper version.
	#jh_build --javacopts="-encoding UTF-8" --javadoc-opts="-encoding UTF-8" --main=mediathek.Main mediathek.jar .

override_dh_auto_install:
	install --mode=755 $(CURDIR)/mediathekview.jar $(CURDIR)/debian/mediathekview/usr/share/mediathekview/mediathekview.jar

override_dh_compress:
	dh_compress --exclude=.pdf

override_dh_link:
	dh_link usr/share/mediathekview/mediathekview.jar usr/bin/mediathekview

