#!/usr/bin/make -f
# debian/rules for Commons Fileupload (uses CDBS)

include /usr/share/cdbs/1/rules/debhelper.mk
#include /usr/share/cdbs/1/class/javahelper.mk
include /usr/share/cdbs/1/class/ant.mk

JAVA_HOME_DIRS       := /usr/lib/jvm/default-java

ANT_HOME             := /usr/share/ant
DEB_ANT_BUILD_TARGET := jar
DEB_BUILDDIR         := osgi/framework
# DEB_INSTALL_DOCS_ALL = -Xlicense
# DEB_DH_INSTALL_ARGS := -XLICENSE.txt
DEB_COMPRESS_EXCLUDE := .java .html

clean::
	-$(DEB_ANT_INVOKE) $(DEB_ANT_CLEAN_TARGET)
	-rm -f osgi/framework/resources/tstamp
	-rm -fr api/
	-rm -f osgi/framework-5.1.0.jar
	-rm -f framework.html frameworkcommands.html

build/libknopflerfish-osgi-java-doc::
	javadoc -encoding "UTF-8" -sourcepath osgi/framework/src -d api -subpackages org.knopflerfish:org.osgi
	cp docs/bundledoc/framework/index.html framework.html
	cp docs/bundledoc/frameworkcommands/index.html frameworkcommands.html

# Get original sources directly using uscan
get-orig-source:
	uscan --force-download

# we don't need jh_manifest and it has a bug:
#JH_MANIFEST_ARGS := -V
#override_jh_manifest:
#	-echo no jh_manifest
