#!/usr/bin/make -f
# debian/rules file for libregexp-java (uses cdbs)

# DEB_TAR_SRCDIR has to be defined (It's the directory that is unpacked from
# the tarball).
#UPSTREAM_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f2 -\d' ' | cut -f1 -d- | sed -e "s/\./_/g")
UPSTREAM_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f2 -\d' ' | cut -f1 -d- )
DEB_TAR_SRCDIR   := jakarta-regexp-$(UPSTREAM_VERSION)

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk
include /usr/share/cdbs/1/rules/tarball.mk
include /usr/share/cdbs/1/class/ant.mk

# Directories to look for JAVA_HOME (JDK 1.4+ required!)
JAVA_HOME_DIRS := /usr/lib/kaffe
ANT_HOME := /usr/share/ant1.6

# Additional JARs to add to the class path, either full path or just the
# basename for JARs in /usr/share/java. The ".jar" suffix may also be ommitted
DEB_JARS := /usr/share/ant1.6/lib/ant-launcher.jar 

# Build compiler
DEB_ANT_COMPILER := jikes

# Ant targets to call
DEB_ANT_BUILD_TARGET := jar

pre-build:: 

install/libregexp-java::
	mkdir -p debian/libregexp-java/usr/share/java
                                           
	install -m 644 $(DEB_SRCDIR)/jakarta-regexp-1.3.jar debian/libregexp-java/usr/share/java/regexp-1.3.jar

#install/libregexp-java::
#	mkdir -p debian/libregexp-java-doc/usr/share/doc/libregexp-java-doc
#	cp -r $(DEB_SRCDIR)/build/docs/apidocs debian/libregexp-java-doc/usr/share/doc/libregexp-java-doc


