#!/usr/bin/make -f

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

# Decide whether we need native jars.
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
include /usr/share/gcj/debian_defaults
ifneq (,$(filter $(DEB_HOST_ARCH), $(gcj_native_archs)))
  with_gcj_native := yes
endif

PACKAGE   := $(DEB_SOURCE_PACKAGE)
VERSION   := $(DEB_UPSTREAM_VERSION)
JAVA_HOME := /usr/lib/jvm/default-java
ANT_HOME  := /usr/share/ant
DEB_JARS  := gnumail activation
DEB_ANT_BUILD_TARGET := jar javadoc

clean::
	-$(RM) -r docs
	-rm -rf debian/tmp

install/liblog4j1.2-java::
	mh_installpoms -pliblog4j1.2-java
	mh_installjar -pliblog4j1.2-java -l --usj-name=log4j-1.2 pom.xml dist/lib/log4j-$(VERSION).jar

ifeq ($(with_gcj_native),yes)
install/liblog4j1.2-java-gcj:: install/liblog4j1.2-java
	dh_nativejava -pliblog4j1.2-java-gcj
endif

get-orig-source:
	-uscan --upstream-version 0
