[maven-debian-helper] 03/07: Changed the debian/rules template to use DH by default instead of CDBS

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Thu Nov 12 18:21:20 UTC 2015


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository maven-debian-helper.

commit decfaca36aea53eac579b5e61e6a440283b178d4
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Thu Nov 12 17:26:57 2015 +0100

    Changed the debian/rules template to use DH by default instead of CDBS
---
 bin/mh_make                                                   |  6 ++++--
 debian/changelog                                              |  3 +++
 .../org/debian/maven/packager/GenerateDebianFilesMojo.java    | 11 +++++++++++
 maven-packager-utils/src/main/resources/control.vm            |  2 +-
 .../src/main/resources/{rules.vm => rules.cdbs.vm}            |  0
 maven-packager-utils/src/main/resources/rules.vm              |  9 +++------
 6 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/bin/mh_make b/bin/mh_make
index bb5325f..62fe036 100755
--- a/bin/mh_make
+++ b/bin/mh_make
@@ -21,6 +21,7 @@ syntax()
    echo -e "\t-t<true|false> --run-tests=<true|false>: include or not the tests"
    echo -e "\t-d<true|false> --javadoc=<true|false>: include or not the javadoc"
    echo -e "\t  during the build"
+   echo -e "\t--cdbs: use CDBS as the build helper instead of DH"
    echo -e "\t-a --ant: use Ant for the packaging instead of Maven"
    echo -e "\t-v --verbose: show more information while running"
    echo -e ""
@@ -38,7 +39,7 @@ syntax()
    exit 1
 }
 
-ARGS="p package b bin-package t run-tests d javadoc a ant v verbose s from-svn" parseargs "$@"
+ARGS="p package b bin-package t run-tests d javadoc a ant v verbose s from-svn cdbs" parseargs "$@"
 
 if [ -z "$DEBFULLNAME" ]; then
   echo "Please define the environment variable DEBFULLNAME, e.g."
@@ -67,6 +68,7 @@ BIN_PACKAGE=$(getarg b bin-package)
 RUN_TESTS=$(getarg t run-tests)
 GEN_JAVADOC=$(getarg d javadoc)
 ANT=$(getarg a ant)
+CDBS=$(getarg cdbs)
 FROM_SVN=$(getarg s from-svn)
 VERBOSE=$(getarg v verbose)
 
@@ -194,7 +196,7 @@ eval $(cat debian/$BIN_PACKAGE.substvars | sed -e 's/maven\./maven_/' | grep mav
 
 mh_patchpoms ${VERBOSE:+--verbose} -p$BIN_PACKAGE -rdebian/maven.rules -idebian/maven.ignoreRules --keep-pom-version
 
-mvn org.debian.maven:maven-packager-utils:$MH_VERSION:generate -Demail="$DEBEMAIL" -Dpackager="$DEBFULLNAME" -DpackagerLicense="$DEBLICENSE" -Dpackage="$PACKAGE" -Dbin.package="$BIN_PACKAGE" -DrunTests="$RUN_TESTS" -DgenerateJavadoc="$GEN_JAVADOC" -Dmaven.repo.local=/usr/share/maven-repo ${ANT:+-DpackageType=ant} ${FROM_SVN:+-DdownloadUrl=scm:svn:$FROM_SVN} --offline
+mvn org.debian.maven:maven-packager-utils:$MH_VERSION:generate -Demail="$DEBEMAIL" -Dpackager="$DEBFULLNAME" -DpackagerLicense="$DEBLICENSE" -Dpackage="$PACKAGE" -Dbin.package="$BIN_PACKAGE" -DrunTests="$RUN_TESTS" -DgenerateJavadoc="$GEN_JAVADOC" -Dmaven.repo.local=/usr/share/maven-repo ${ANT:+-DpackageType=ant} ${CDBS:+-Dhelper=cdbs} ${FROM_SVN:+-DdownloadUrl=scm:svn:$FROM_SVN} --offline
 
 if [ $? != 0 ]; then
     if [ -f debian/$BIN_PACKAGE.poms ]; then
diff --git a/debian/changelog b/debian/changelog
index cd96a56..4002fca 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,9 @@ maven-debian-helper (1.6.14) UNRELEASED; urgency=medium
   * Ignore the 'maven clean' errors when building with debhelper
   * Do not run the tests when DEB_BUILD_OPTIONS=nocheck is specified
     (Closes: #737988)
+  * Changed the debian/rules template to use DH by default instead of CDBS.
+    A rules file using CDBS can still be generated by adding the --cdbs
+    parameter to mh_make (Closes: #786340)
 
  -- Emmanuel Bourg <ebourg at apache.org>  Thu, 12 Nov 2015 10:10:31 +0100
 
diff --git a/maven-packager-utils/src/main/java/org/debian/maven/packager/GenerateDebianFilesMojo.java b/maven-packager-utils/src/main/java/org/debian/maven/packager/GenerateDebianFilesMojo.java
index 528b555..207fa6e 100644
--- a/maven-packager-utils/src/main/java/org/debian/maven/packager/GenerateDebianFilesMojo.java
+++ b/maven-packager-utils/src/main/java/org/debian/maven/packager/GenerateDebianFilesMojo.java
@@ -156,6 +156,13 @@ public class GenerateDebianFilesMojo extends AbstractMojo {
      */
     protected boolean generateJavadoc;
 
+    /**
+     * The packaging helper used to build the package (CDBS or DH).
+     *
+     * @parameter expression="${helper}" default-value="dh"
+     */
+    protected String helper;
+
     private PackageScanner scanner = new PackageScanner(false);
     private LicensesScanner licensesScanner = new LicensesScanner();
 
@@ -167,6 +174,9 @@ public class GenerateDebianFilesMojo extends AbstractMojo {
 
         String controlTemplate = "control.vm";
         String rulesTemplate = "rules.vm";
+        if ("cdbs".equals(helper)) {
+            rulesTemplate = "rules.cdbs.vm";
+        }
         if ("ant".equals(packageType)) {
             controlTemplate = "control.ant.vm";
             rulesTemplate = "rules.ant.vm";
@@ -185,6 +195,7 @@ public class GenerateDebianFilesMojo extends AbstractMojo {
             context.put("package", packageName);
             context.put("packageType", packageType);
             context.put("binPackage", binPackageName);
+            context.put("helper", helper);
             context.put("packager", packager);
             context.put("packagerEmail", email);
             context.put("project", project);
diff --git a/maven-packager-utils/src/main/resources/control.vm b/maven-packager-utils/src/main/resources/control.vm
index 3ad6152..d10bcdc 100644
--- a/maven-packager-utils/src/main/resources/control.vm
+++ b/maven-packager-utils/src/main/resources/control.vm
@@ -18,7 +18,7 @@ Section: java
 Priority: optional
 Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
 Uploaders: ${packager} <${packagerEmail}>
-Build-Depends: debhelper (>= 9), cdbs, default-jdk, maven-debian-helper (>= 1.5)
+Build-Depends: debhelper (>= 9),#if ($helper == "cdbs") cdbs,#end default-jdk, maven-debian-helper (>= 1.5)
 #if(!$buildDependencies.isEmpty())
 Build-Depends-Indep:#printDependencies($buildDependencies)$space
 #end
diff --git a/maven-packager-utils/src/main/resources/rules.vm b/maven-packager-utils/src/main/resources/rules.cdbs.vm
similarity index 100%
copy from maven-packager-utils/src/main/resources/rules.vm
copy to maven-packager-utils/src/main/resources/rules.cdbs.vm
diff --git a/maven-packager-utils/src/main/resources/rules.vm b/maven-packager-utils/src/main/resources/rules.vm
index 719e55d..9867785 100644
--- a/maven-packager-utils/src/main/resources/rules.vm
+++ b/maven-packager-utils/src/main/resources/rules.vm
@@ -1,12 +1,9 @@
 #!/usr/bin/make -f
 
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/class/maven.mk
+export JAVA_HOME = /usr/lib/jvm/default-java
 
-JAVA_HOME := /usr/lib/jvm/default-java
-#if ($project.Packaging == "pom")
-DEB_MAVEN_DOC_TARGET := javadoc:javadoc javadoc:aggregate
-#end
+%:
+	dh $@ --buildsystem=maven
 
 get-orig-source:
 	uscan --download-current-version --force-download --no-symlink

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/maven-debian-helper.git



More information about the pkg-java-commits mailing list