[latexdraw] 145/147: Use maven to build package

Stuart Prescott stuart at debian.org
Thu Nov 24 23:53:42 UTC 2016


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

stuart pushed a commit to branch master
in repository latexdraw.

commit d39c63eba474c4fd627e718dfa0518c42c92f5bd
Author: Stuart Prescott <stuart at debian.org>
Date:   Sun Nov 20 00:22:29 2016 +1100

    Use maven to build package
---
 debian/control                              |  4 +-
 debian/docs                                 |  1 -
 debian/install                              |  1 -
 debian/latexdraw.doc-base                   | 11 -----
 debian/latexdraw.poms                       | 28 +++++++++++
 debian/maven.cleanIgnoreRules               |  1 +
 debian/maven.ignoreRules                    |  8 +++
 debian/maven.properties                     |  4 ++
 debian/maven.publishedRules                 |  1 +
 debian/maven.rules                          |  3 ++
 debian/patches/disable_update_checker.patch | 11 -----
 debian/patches/latexdraw_shell_script.patch | 17 +++++--
 debian/patches/local-jars.patch             |  4 ++
 debian/patches/series                       |  1 -
 debian/patches/top-pom.patch                |  3 ++
 debian/rules                                | 76 ++++++++---------------------
 debian/watch                                |  2 +-
 17 files changed, 90 insertions(+), 86 deletions(-)

diff --git a/debian/control b/debian/control
index 3bc14be..87334f0 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,6 @@ Build-Depends-Indep:
  default-jdk (>= 2:1.8),
  libjlibeps-java,
  libpdfrenderer-java,
- maven-debian-helper (>= 1.5),
  libmalai-java,
  scala,
  junit4
@@ -22,7 +21,10 @@ Depends:
  default-jre (>= 2:1.8),
  java-wrappers,
  libjlibeps-java,
+ libmalai-java,
  libpdfrenderer-java,
+ scala-library,
+ scala-parser-combinators,
  ${maven:Depends},
  ${misc:Depends}
 Recommends:
diff --git a/debian/docs b/debian/docs
deleted file mode 100644
index a87bf43..0000000
--- a/debian/docs
+++ /dev/null
@@ -1 +0,0 @@
-help
diff --git a/debian/install b/debian/install
index f9ae1ac..af4ac25 100644
--- a/debian/install
+++ b/debian/install
@@ -1,6 +1,5 @@
 latexdraw-core/net.sf.latexdraw/target/latexdraw.core-3.3.4.jar usr/share/java
 latexdraw usr/bin
 latexdraw-core/net.sf.latexdraw/templates/templates/ usr/share/latexdraw/
-#out/*.xpm usr/share/pixmaps
 debian/latexdraw.desktop usr/share/applications
 debian/x-latexdraw-project.desktop usr/share/mimelnk/application
diff --git a/debian/latexdraw.doc-base b/debian/latexdraw.doc-base
deleted file mode 100644
index 129c42a..0000000
--- a/debian/latexdraw.doc-base
+++ /dev/null
@@ -1,11 +0,0 @@
-Document: latexdraw
-Title: LaTeXDraw User Documentation
-Author: Arnaud BLOUIN <arno_b at users.sourceforge.net>
-Abstract: This manual contains the user documentation for LaTeXDraw
- which is a vector drawing program that uses the LaTeX PStricks
- package.
-Section: Graphics
-
-Format: HTML
-Index: /usr/share/doc/latexdraw/help/index.html
-Files: /usr/share/doc/latexdraw/help/*.html
diff --git a/debian/latexdraw.poms b/debian/latexdraw.poms
new file mode 100644
index 0000000..4a57d6b
--- /dev/null
+++ b/debian/latexdraw.poms
@@ -0,0 +1,28 @@
+# List of POM files for the package
+# Format of this file is:
+# <path to pom file> [option]*
+# where option can be:
+#   --ignore: ignore this POM and its artifact if any
+#   --ignore-pom: don't install the POM. To use on POM files that are created
+#     temporarily for certain artifacts such as Javadoc jars. [mh_install, mh_installpoms]
+#   --no-parent: remove the <parent> tag from the POM
+#   --package=<package>: an alternative package to use when installing this POM
+#      and its artifact
+#   --has-package-version: to indicate that the original version of the POM is the same as the upstream part
+#      of the version for the package.
+#   --keep-elements=<elem1,elem2>: a list of XML elements to keep in the POM
+#      during a clean operation with mh_cleanpom or mh_installpom
+#   --artifact=<path>: path to the build artifact associated with this POM,
+#      it will be installed when using the command mh_install. [mh_install]
+#   --java-lib: install the jar into /usr/share/java to comply with Debian
+#      packaging guidelines
+#   --usj-name=<name>: name to use when installing the library in /usr/share/java
+#   --usj-version=<version>: version to use when installing the library in /usr/share/java
+#   --no-usj-versionless: don't install the versionless link in /usr/share/java
+#   --dest-jar=<path>: the destination for the real jar.
+#     It will be installed with mh_install. [mh_install]
+#   --classifier=<classifier>: Optional, the classifier for the jar. Empty by default.
+#   --site-xml=<location>: Optional, the location for site.xml if it needs to be installed.
+#     Empty by default. [mh_install]
+#
+latexdraw-core/net.sf.latexdraw/pom.xml --java-lib
diff --git a/debian/maven.cleanIgnoreRules b/debian/maven.cleanIgnoreRules
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/debian/maven.cleanIgnoreRules
@@ -0,0 +1 @@
+
diff --git a/debian/maven.ignoreRules b/debian/maven.ignoreRules
new file mode 100644
index 0000000..41cd663
--- /dev/null
+++ b/debian/maven.ignoreRules
@@ -0,0 +1,8 @@
+
+org.apache.maven.plugins maven-assembly-plugin * * * *
+org.apache.maven.plugins maven-surefire-plugin * * * *
+org.codehaus.mojo cobertura-maven-plugin * * * *
+org.codehaus.mojo osxappbundle-maven-plugin * * * *
+org.mockito mockito-all * * * *
+org.scala-tools maven-scala-plugin * * * *
+sh.tak.appbundler appbundle-maven-plugin * * * *
diff --git a/debian/maven.properties b/debian/maven.properties
new file mode 100644
index 0000000..7c29bd7
--- /dev/null
+++ b/debian/maven.properties
@@ -0,0 +1,4 @@
+# Include here properties to pass to Maven during the build.
+# For example:
+# maven.test.skip=true
+
diff --git a/debian/maven.publishedRules b/debian/maven.publishedRules
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/debian/maven.publishedRules
@@ -0,0 +1 @@
+
diff --git a/debian/maven.rules b/debian/maven.rules
new file mode 100644
index 0000000..d3efbac
--- /dev/null
+++ b/debian/maven.rules
@@ -0,0 +1,3 @@
+
+junit junit jar s/4\..*/4.x/ * *
+org.scala-lang * * s/2\.11.*/2.11.x/ * *
diff --git a/debian/patches/disable_update_checker.patch b/debian/patches/disable_update_checker.patch
deleted file mode 100644
index 0b497ab..0000000
--- a/debian/patches/disable_update_checker.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/main/net/sf/latexdraw/util/VersionChecker.java
-+++ b/src/main/net/sf/latexdraw/util/VersionChecker.java
-@@ -49,7 +49,7 @@
- 	public static final String ID_BUILD = "20141123";//$NON-NLS-1$
- 
- 	/** To change if update is needed or not. */
--	public static final boolean WITH_UPDATE = true;
-+	public static final boolean WITH_UPDATE = false;
- 
-     /** The path of the file containing the news */
-     public static final String PATH_MSG = "http://latexdraw.sourceforge.net/news.txt"; //$NON-NLS-1$
diff --git a/debian/patches/latexdraw_shell_script.patch b/debian/patches/latexdraw_shell_script.patch
index 3a66ae4..245cb20 100644
--- a/debian/patches/latexdraw_shell_script.patch
+++ b/debian/patches/latexdraw_shell_script.patch
@@ -1,8 +1,11 @@
-Description: Create a script for /usr/bin/latexdraw with a sensible JRE (regardless of how the alternatives have been set).
+Description: Create a script for latexdraw(1)
+  Creates a /usr/bin/latexdraw with a sensible JRE (regardless of how the
+  alternatives have been set).
+Author: Stuart Prescott <stuart at debian.org>
 
 --- /dev/null
 +++ b/latexdraw
-@@ -0,0 +1,20 @@
+@@ -0,0 +1,26 @@
 +#!/bin/sh
 +
 +# latexdraw wrapper script
@@ -16,10 +19,16 @@ Description: Create a script for /usr/bin/latexdraw with a sensible JRE (regardl
 +# We need openjdk6, openjdk7 or sun6 runtime.
 +find_java_runtime sun6 openjdk
 +
-+find_jars LaTeXDraw net.sourceforge.jiu net.sourceforge.jlibeps
++find_jars \
++    latexdraw.core \
++    net.sourceforge.jlibeps \
++    scala-library \
++    scala-parser-combinators \
++    malai.core \
++    malai.swing
 +
 +# Add /usr/share/doc/latexdraw/ to the classpath as it is used to
 +# locate help files
 +JAVA_CLASSPATH=$JAVA_CLASSPATH:/usr/share/doc/latexdraw/
 +
-+run_java latexDraw.ui.LaTeXDraw "$@"
++run_java net.sf.latexdraw.LaTeXDraw "$@"
diff --git a/debian/patches/local-jars.patch b/debian/patches/local-jars.patch
index 99d4173..598128b 100644
--- a/debian/patches/local-jars.patch
+++ b/debian/patches/local-jars.patch
@@ -1,3 +1,7 @@
+Description: Use packages for jar libraries
+  Help maven find the Debian packaged versions of these jars
+Author: Stuart Prescott <stuart at debian.org>
+
 --- a/latexdraw-core/net.sf.latexdraw/pom.xml
 +++ b/latexdraw-core/net.sf.latexdraw/pom.xml
 @@ -303,6 +303,8 @@
diff --git a/debian/patches/series b/debian/patches/series
index 129c9f7..e951ea1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,3 @@
 local-jars.patch
 latexdraw_shell_script.patch
-#disable_update_checker.patch
 top-pom.patch
diff --git a/debian/patches/top-pom.patch b/debian/patches/top-pom.patch
index 4634df6..a3cc274 100644
--- a/debian/patches/top-pom.patch
+++ b/debian/patches/top-pom.patch
@@ -1,3 +1,6 @@
+Description: Add a master pom.xml for the projects
+Author: Stuart Prescott <stuart at debian.org>
+
 --- /dev/null
 +++ b/pom.xml
 @@ -0,0 +1,13 @@
diff --git a/debian/rules b/debian/rules
index 459fddf..e7df3b0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,62 +1,28 @@
 #!/usr/bin/make -f
 
-# Uncomment this to turn on verbose mode.
-# export DH_VERBOSE=1
+export DH_VERBOSE = 1
 
-# If the user has not explicitly set JAVA_HOME, export sensible value
-# to make sure that the correct compiler is used by ant.
-# * prefer openjdk-6 then sun-java6;
-# * include both multi-arch and non-multi-arch paths for ease of backporting
-#   "export JAVA_HOME=/usr/lib/jvm/java-6-openjdk-i386" or similar if you want
-#   to build locally using openjdk-7.
-JAVA_HOME ?= $(shell echo \
-  ` for jre in \
-      /usr/lib/jvm/default-java \
-      /usr/lib/jvm/java-7-openjdk-\`dpkg-architecture -qDEB_BUILD_ARCH\` \
-      /usr/lib/jvm/java-6-openjdk-\`dpkg-architecture -qDEB_BUILD_ARCH\` \
-      /usr/lib/jvm/java-6-openjdk \
-      ; do \
-      test -d $$jre && test -f $$jre/bin/javac && echo $$jre && break ; \
-    done ` \
-  )
-export JAVA_HOME
+#JAVA_HOME := /usr/lib/jvm/default-java
 
 %:
-	dh $@
+	dh $@ --buildsystem maven
 
 override_dh_auto_build:
-	ant -Dlib.dir=/usr/share/java compile
-	ant -Dlib.dir=/usr/share/java jar
-	convert -geometry 32x32 res/LaTeXDrawIcon.png out/latexdraw32.xpm
-	convert -geometry 16x16 res/LaTeXDrawIcon.png out/latexdraw16.xpm
-
-override_dh_auto_clean:
-	rm -f build-stamp
-	find . -name \*.jar -exec rm -f {} \;
-	find . -name \*.class -exec rm -f {} \;
-	rm -rf out/ api/
-	dh_clean
-
-# A target for building the API docs with javadoc is provided here
-# but is not actually used in the Debian package. To successfully
-# build the API documentation, the packages
-#         libjiu-java-doc, libjlibeps-java-doc
-# must be installed too.
-apidocs: build
-	ant -Dlib.dir=/usr/share/java doc
-
-override_dh_installchangelogs:
-	dh_installchangelogs -k release_note.txt
-
-# Be explicit given that there is plenty of confusion about what this target means
-get-orig-source: get-latest-source
-
-get-latest-source:
-	cd $(dir $_).. && \
-	uscan=$$(uscan --report --dehs --upstream-version 0) && \
-	uver=$$(echo "$$uscan" | sed -n 's,<upstream-version>\(.*\)</.*>,\1,p') && \
-	uurl=$$(echo "$$uscan" | sed -n 's,<upstream-url>\(.*\)</.*>,\1,p') && \
-	echo debian/repackage --upstream-version "$${uver}" "$${uurl}" $(CURDIR) &&\
-	sh debian/repackage --upstream-version "$${uver}" "$${uurl}" $(CURDIR)
-
-.PHONY: get-orig-source get-latest-source
+	# First build the scala part
+	cd latexdraw-core/net.sf.latexdraw && \
+	mkdir -p target/classes && \
+	CLASSPATH=.:\
+	/usr/share/java/malai.core.jar:\
+	/usr/share/java/malai.swing.jar:\
+	/usr/share/java/pdfrenderer.jar \
+	  scalac \
+	    -d target/classes \
+	    `find -name \*.scala -type f` \
+	    `find -name \*.java -type f`
+	# Then get maven to build the java part
+	dh_auto_build
+
+
+# (cd latexdraw-core/net.sf.latexdraw; CLASSPATH=.:/usr/share/java/:/usr/share/java/malai.core.jar:/usr/share/java/malai.swing.jar:/usr/share/java/pdfrenderer.jar scalac -d target/classes $(find -name \*scala) $(find -name \*java))
+
+# (cd latexdraw-core/net.sf.latexdraw; CLASSPATH=.:/usr/share/java/:/usr/share/java/malai.core.jar:/usr/share/java/malai.swing.jar:/usr/share/java/pdfrenderer.jar:/usr/share/java/scala-library.jar:/usr/share/java/net.sourceforge.jlibeps.jar:/usr/share/java/junit4.jar:/usr/share/java/scala-parser-combinators_2.11.jar:target/classes javac -d target/classes $(find -name \*java))
diff --git a/debian/watch b/debian/watch
index 48f21a9..400cd3b 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,4 +1,4 @@
 version=3
 
-opts="dversionmangle=s/\+\d+$//,filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/latexdraw-$1\.tar\.gz/,repacksuffix=+ds1" \
+opts="dversionmangle=s/\+ds\d+$//,filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/latexdraw-$1\.tar\.gz/,repacksuffix=+ds1" \
   https://github.com/arnobl/latexdraw/tags .*/v?(\d\S+)\.tar\.gz

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



More information about the pkg-java-commits mailing list