#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/maven.mk

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

# Extract everything after "svn" in DEB_UPSTREAM_VERSION
SVN_EXPORT_DATE      := $(shell echo $(DEB_UPSTREAM_VERSION) | sed 's/.*svn//')

# Export from SVN and remove externals JAR in lib/
get-orig-source:
	mkdir orig_tmp
	(cd orig_tmp && \
	svn export -r {${SVN_EXPORT_DATE}} \
	http://svn.apache.org/repos/asf/commons/sandbox/javaflow/trunk/ \
	commons-javaflow-$(DEB_UPSTREAM_VERSION) && \
	rm -rf commons-javaflow-$(DEB_UPSTREAM_VERSION)/lib && \
	tar -czf ../../${DEB_SOURCE_PACKAGE}_$(DEB_UPSTREAM_VERSION).orig.tar.gz commons-javaflow-$(DEB_UPSTREAM_VERSION))
	rm -rf orig_tmp

