#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

ifneq (,$(or $(filter noopt,$(DEB_BUILD_OPTIONS)),\
             $(filter nostrip,$(DEB_BUILD_OPTIONS))))
	FLAGS += debug=1
endif

PKGNAME := open-xchange-documents-help
ROOT := $(CURDIR)/debian/$(PKGNAME)

override_dh_auto_install:
	ant -Dbasedir=build -DdestDir=$(ROOT)-common -DpackageName=$(PKGNAME) -Dlanguages=false -DkeepCache=true -f build/build.xml build
	for LANG in de_DE en_GB en_US es_ES es_MX fr_FR it_IT ja_JP nl_NL pl_PL zh_CN zh_TW; do \
		PACKAGE_EXTENSION=$$(echo $${LANG} | tr '[:upper:]_' '[:lower:]-'); \
		ant -Dbasedir=build -DdestDir=$(ROOT)-$${PACKAGE_EXTENSION} -DpackageName=$(PKGNAME) -DinstallTarget=$${LANG} -DkeepCache=true -Dnoclean=true -f build/build.xml build; \
	done

override_dh_auto_clean:
	ant -Dbasedir=build -f build/build.xml clean

%:
	dh $@
