TASKPM/debian/rules
2010-04-15 17:11:37 +02:00

122 lines
3.1 KiB
Makefile
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#! /usr/bin/make -f
#export DH_VRBOSE=1
export DH_OPTIONS
export CURDIR
MAKEFLAGS += s
JAVA_HOME := /usr/lib/jvm/java-6-openjdk
MAVEN_REPO := $(CURDIR)/debian/maven-repo
MAVEN_OPTS := -Pprod,postgresql -Dmaven.test.skip=true -B \
-s $(CURDIR)/debian/maven-settings.xml
JTA_JAR ?= $(CURDIR)/debian/jta-1_0_1B-classes.zip
define NFO
@echo "$1"
endef
ifneq ($V,0)
define CMD
@echo "$1"
@$1
endef
else
define CMD
@$1
endef
endif
configure: configure-stamp
configure-stamp:
$(call NFO,Configuring...)
$(call CMD,dh_testdir)
# Configure package here
$(call CMD,touch $@)
build: build-arch
build-arch: build-arch-stamp
build-arch-stamp: configure-stamp maven-import-jta
$(call NFO,Building sources...)
# Build arch-dependant stuff
$(call CMD,mkdir -p $(MAVEN_REPO))
$(call CMD,mvn $(MAVEN_OPTS) install)
$(call CMD,touch $@)
clean:
$(call NFO,Cleaning up...)
$(call CMD,dh_testdir)
$(call CMD,dh_testroot)
# Cleanup commands
$(call CMD,$(RM) build-arch-stamp build-indep-stamp configure-stamp)
$(call CMD,mkdir -p $(MAVEN_REPO))
# This is likely to fail, e.g. if JTA jar file was not imported
-$(call CMD,mvn $(MAVEN_OPTS) clean)
$(call CMD,$(RM) -r $(CURDIR)/maven-repo)
$(call CMD,dh_clean)
install:
$(call NFO,Installing objects...)
$(call CMD,dh_testdir)
$(call CMD,dh_testroot)
$(call CMD,dh_clean -k)
$(call CMD,dh_installdirs)
# Commands to install arch-dependant stuff
$(call CMD,mkdir -p $(CURDIR)/debian/tmp/var/lib/tomcat6/webapps/)
$(call CMD,cp $(CURDIR)/navalplanner-webapp/target/navalplanner-webapp.war \
$(CURDIR)/debian/tmp/var/lib/tomcat6/webapps)
# Install Policy file
$(call CMD,mkdir -p $(CURDIR)/debian/tmp/etc/tomcat6/policy.d)
$(call CMD,cp $(CURDIR)/debian/51navalplan.policy \
$(CURDIR)/debian/tmp/etc/tomcat6/policy.d/)
$(call CMD,dh_install)
binary-indep: build install
binary-arch: build install
$(call NFO,Making binary package...)
$(call CMD,dh_testdir)
$(call CMD,dh_testroot)
$(call CMD,dh_installchangelogs)
$(call CMD,dh_installdocs)
$(call CMD,dh_installexamples)
# $(call CMD,dh_installmenu)
$(call CMD,dh_installdebconf)
# $(call CMD,dh_installlogrotate)
# $(call CMD,dh_installemacsen)
# $(call CMD,dh_installpam)
# $(call CMD,dh_installmime)
# $(call CMD,dh_python)
# $(call CMD,dh_installinit)
# $(call CMD,dh_installcron)
# $(call CMD,dh_installinfo)
$(call CMD,dh_installman)
$(call CMD,dh_link)
$(call CMD,dh_strip)
$(call CMD,dh_compress)
$(call CMD,dh_fixperms)
# $(call CMD,dh_perl)
$(call CMD,dh_makeshlibs)
$(call CMD,dh_installdeb)
$(call CMD,dh_shlibdeps)
$(call CMD,dh_gencontrol)
$(call CMD,dh_md5sums)
$(call CMD,dh_builddeb)
binary: binary-indep binary-arch
maven-import-jta: maven-import-jta-stamp
maven-import-jta-stamp: $(JTA_JAR)
$(call NFO,Importing $(notdir $<)...)
$(call CMD,mvn $(MAVEN_OPTS) install:install-file \
-DgroupId=javax.transaction -DartifactId=jta \
-Dversion=1.0.1B -Dpackaging=jar -Dfile="$<")
$(call CMD,touch $@)
.PHONY: build clean binary-indep binary-arch binary install install-indep
.PHONY: install-arch configure maven-import-jta