[pkg-java] r7660 - in trunk/maven-debian-helper: . cdbs debian examples maven-debian-helper/src/main/resources/org/apache/maven/project

twerner at alioth.debian.org twerner at alioth.debian.org
Sun Dec 14 20:25:36 UTC 2008


Author: twerner
Date: 2008-12-14 20:25:36 +0000 (Sun, 14 Dec 2008)
New Revision: 7660

Added:
   trunk/maven-debian-helper/debian/examples
   trunk/maven-debian-helper/examples/
   trunk/maven-debian-helper/examples/mvn-debian
Modified:
   trunk/maven-debian-helper/cdbs/maven-vars.mk
   trunk/maven-debian-helper/cdbs/maven.mk
   trunk/maven-debian-helper/debian/rules
   trunk/maven-debian-helper/maven-debian-helper/src/main/resources/org/apache/maven/project/pom-4.0.0.xml
Log:
* enable automatic installation
* add example script for the command line


Modified: trunk/maven-debian-helper/cdbs/maven-vars.mk
===================================================================
--- trunk/maven-debian-helper/cdbs/maven-vars.mk	2008-12-14 19:40:07 UTC (rev 7659)
+++ trunk/maven-debian-helper/cdbs/maven-vars.mk	2008-12-14 20:25:36 UTC (rev 7660)
@@ -72,12 +72,16 @@
 		 -s/etc/maven2/settings-debian.xml \
 		 $(if $(MAVEN_ARGS_$(cdbs_curpkg)),$(MAVEN_ARGS_$(cdbs_curpkg)),$(MAVEN_ARGS))
 
+# The name of the binary package that gets the jar files installed. The
+# first package by default.
+DEB_JAR_PACKAGE = $(firstword $(shell dh_listpackages))
+
 # Targets to invoke for building, installing, testing and cleaning up.
 # Building uses the default target from build.xml, installing and testing is
 # only called if the corresponding variable is set. You can also specify
 # multiple targets for each step.
 DEB_MAVEN_BUILD_TARGET = compile jar:jar   # TODO: should be 'package'
-DEB_MAVEN_INSTALL_TARGET =
+DEB_MAVEN_INSTALL_TARGET = debian:install
 DEB_MAVEN_CHECK_TARGET =
 DEB_MAVEN_CLEAN_TARGET = clean
 

Modified: trunk/maven-debian-helper/cdbs/maven.mk
===================================================================
--- trunk/maven-debian-helper/cdbs/maven.mk	2008-12-14 19:40:07 UTC (rev 7659)
+++ trunk/maven-debian-helper/cdbs/maven.mk	2008-12-14 20:25:36 UTC (rev 7660)
@@ -62,9 +62,12 @@
 	-$(DEB_MAVEN_INVOKE) $(DEB_MAVEN_CLEAN_TARGET)
 	$(RM) debian/auto.properties debian/stamp-maven-build
 
+# extra arguments for the installation step
+PLUGIN_ARGS = -Ddebian.dir=$(CURDIR)/debian -Ddebian.package=$(DEB_JAR_PACKAGE)
+
 common-install-arch common-install-indep:: common-install-impl
 common-install-impl::
-	$(if $(DEB_MAVEN_INSTALL_TARGET),$(DEB_MAVEN_INVOKE) $(DEB_MAVEN_INSTALL_TARGET), at echo "DEB_MAVEN_INSTALL_TARGET unset, skipping default maven.mk common-install target")
+	$(if $(DEB_MAVEN_INSTALL_TARGET),$(DEB_MAVEN_INVOKE) $(DEB_MAVEN_INSTALL_TARGET) $(PLUGIN_ARGS), at echo "DEB_MAVEN_INSTALL_TARGET unset, skipping default maven.mk common-install target")
 
 ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
 common-build-arch common-build-indep:: debian/stamp-maven-check

Added: trunk/maven-debian-helper/debian/examples
===================================================================
--- trunk/maven-debian-helper/debian/examples	                        (rev 0)
+++ trunk/maven-debian-helper/debian/examples	2008-12-14 20:25:36 UTC (rev 7660)
@@ -0,0 +1 @@
+examples/*

Modified: trunk/maven-debian-helper/debian/rules
===================================================================
--- trunk/maven-debian-helper/debian/rules	2008-12-14 19:40:07 UTC (rev 7659)
+++ trunk/maven-debian-helper/debian/rules	2008-12-14 20:25:36 UTC (rev 7660)
@@ -3,15 +3,4 @@
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/class/maven.mk
 
-VERSION   := $(DEB_UPSTREAM_VERSION)
 JAVA_HOME := /usr/lib/jvm/java-6-openjdk
-
-DEST := $(DEB_MAVEN_REPO)/org/debian/maven/
-
-DEB_JAR_PACKAGE ?= $(firstword $(shell dh_listpackages))
-DEB_PLUGIN_VERSION = $(shell ls /usr/share/maven-repo/org/debian/maven/maven-debian-helper/)
-
-PLUGIN_GOAL = org.debian.maven:maven-debian-plugin:$(DEB_PLUGIN_VERSION):install
-PLUGIN_ARGS = -Ddebian.dir=$(CURDIR)/debian -Ddebian.package=$(DEB_JAR_PACKAGE)
-binary-post-install/$(DEB_JAR_PACKAGE)::
-	$(DEB_MAVEN_INVOKE) $(PLUGIN_GOAL) $(PLUGIN_ARGS)

Added: trunk/maven-debian-helper/examples/mvn-debian
===================================================================
--- trunk/maven-debian-helper/examples/mvn-debian	                        (rev 0)
+++ trunk/maven-debian-helper/examples/mvn-debian	2008-12-14 20:25:36 UTC (rev 7660)
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# This is an example script that allows running maven on the command
+# line in a similar way as our cdbs snippets work. Copy this script to
+# /usr/local/bin if you want to have it in the $PATH. Production use is
+# not supported by the maintainer of maven-debian-helper.
+
+DEB_CLASSPATH=/usr/share/java/classworlds.jar
+JAVA_OPTS=-Dclassworlds.conf=/etc/maven2/m2-debian.conf
+MAIN_CLASS=org.codehaus.classworlds.Launcher
+MAVEN_OPTS=-s/etc/maven2/settings-debian.xml
+MAVEN_REPO=/usr/share/maven-repo
+
+if [ -d debian ]; then
+  find $MAVEN_REPO -name "*.pom" | \
+    sed -e"s,^$MAVEN_REPO/,," \
+	-e"s,/\([0-9][^/]*\).*,.version = \1," \
+	-e"s,/,.,g"                            > debian/auto.properties
+  JAVA_OPTS="$JAVA_OPTS -Dproperties.file.auto=$PWD/debian/auto.properties"
+  MAVEN_OPTS="$MAVEN_OPTS -Ddebian.dir=$PWD/debian"
+fi
+
+if [ -r debian/control ]; then
+  JAR_PACKAGE=$(dh_listpackages | awk '{ print $1 }')
+  MAVEN_OPTS="$MAVEN_OPTS -Ddebian.package=$JAR_PACKAGE"
+fi
+
+
+exec java -cp $DEB_CLASSPATH $JAVA_OPTS $MAIN_CLASS "$@" $MAVEN_OPTS


Property changes on: trunk/maven-debian-helper/examples/mvn-debian
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/maven-debian-helper/maven-debian-helper/src/main/resources/org/apache/maven/project/pom-4.0.0.xml
===================================================================
--- trunk/maven-debian-helper/maven-debian-helper/src/main/resources/org/apache/maven/project/pom-4.0.0.xml	2008-12-14 19:40:07 UTC (rev 7659)
+++ trunk/maven-debian-helper/maven-debian-helper/src/main/resources/org/apache/maven/project/pom-4.0.0.xml	2008-12-14 20:25:36 UTC (rev 7660)
@@ -81,6 +81,15 @@
   </properties>
 
   <build>
+    <!-- load the correct version of maven-debian-plugin -->
+    <plugins>
+      <plugin>
+	<groupId>org.debian.maven</groupId>
+	<artifactId>maven-debian-plugin</artifactId>
+	<version>${org.debian.maven.maven-debian-plugin.version}</version>
+      </plugin>
+    </plugins>
+
     <directory>target</directory>
     <outputDirectory>target/classes</outputDirectory>
     <finalName>${project.artifactId}-${project.version}</finalName>




More information about the pkg-java-commits mailing list