[med-svn] [artemis] 01/01: Refactor to allow tweaking CLASSPATH from within d/rules
Afif Elghraoui
afif-guest at moszumanska.debian.org
Thu Sep 24 08:02:25 UTC 2015
This is an automated email from the git hooks/post-receive script.
afif-guest pushed a commit to branch master
in repository artemis.
commit 3eb88cb9c7f697ad3d97c2a0e5dc568ee644f816
Author: Afif Elghraoui <afif at ghraoui.name>
Date: Wed Sep 23 22:00:11 2015 -0700
Refactor to allow tweaking CLASSPATH from within d/rules
This is better than to keep modifying the patch to the upstream
Makefile whenever we want to add/remove classes.
---
debian/patches/class-path.patch | 56 ++++++-----------------------------------
debian/patches/java6.patch | 2 +-
debian/rules | 24 ++++++++++++++++++
3 files changed, 32 insertions(+), 50 deletions(-)
diff --git a/debian/patches/class-path.patch b/debian/patches/class-path.patch
index b2cf540..cfcd25d 100644
--- a/debian/patches/class-path.patch
+++ b/debian/patches/class-path.patch
@@ -1,63 +1,21 @@
Description: Look for jars in /usr/share/java rather than ./lib
The bundled jar files in lib/ have been removed for Debian, so the
build system ought to find the packaged versions in /usr/share/java.
- This patch essentially implements s#lib#/usr/share/java# with some
- manual modifications afterwards.
+ This patch allows overriding the CLASSPATH while calling make. This
+ way, we can change it from within debian/rules.
Author: Afif Elghraoui <afif at ghraoui.name>
Forwarded: not-needed
-Last-Update: 2015-09-21
+Last-Update: 2015-09-23
--- artemis.orig/Makefile
+++ artemis/Makefile
-@@ -8,7 +8,7 @@
+@@ -8,7 +8,9 @@
JAVAC := javac -source 1.5 -target 1.5 $(OPT_FLAGS) $(EXTRA_FLAGS)
-REAL_CLASSPATH := CLASSPATH=lib/biojava.jar:lib/jemAlign.jar:lib/j2ssh/j2ssh-core.jar:lib/ibatis/ibatis-2.3.4.726.jar:lib/ibatis/log4j-1.2.14.jar:lib/postgresql-8.4-701.jdbc3.jar:lib/picard/picard.jar:lib/picard/sam.jar:lib/commons-net-2.2.jar:lib/batik/batik-awt-util.jar:lib/batik/batik-dom.jar:lib/batik/batik-ext.jar:lib/batik/batik-svggen.jar:lib/batik/batik-util.jar:lib/batik/batik-xml.jar:.
-+REAL_CLASSPATH := CLASSPATH=/usr/share/java/biojava.jar:/usr/share/java/jemAlign.jar:/usr/share/java/j2ssh/j2ssh-core.jar:/usr/share/java/ibatis.jar:/usr/share/java/log4j-1.2.jar:/usr/share/java/postgresql-jdbc3.jar:/usr/share/java/picard.jar:/usr/share/java/sam.jar:/usr/share/java/commons-net-2.2.jar:/usr/share/java/batik-awt-util.jar:/usr/share/java/batik-dom.jar:/usr/share/java/batik-ext.jar:/usr/share/java/batik-svggen.jar:/usr/share/java/batik-util.jar:/usr/share/java/batik-xml.jar:.
++CLASSPATH ?= lib/biojava.jar:lib/jemAlign.jar:lib/j2ssh/j2ssh-core.jar:lib/ibatis/ibatis-2.3.4.726.jar:lib/ibatis/log4j-1.2.14.jar:lib/postgresql-8.4-701.jdbc3.jar:lib/picard/picard.jar:lib/picard/sam.jar:lib/commons-net-2.2.jar:lib/batik/batik-awt-util.jar:lib/batik/batik-dom.jar:lib/batik/batik-ext.jar:lib/batik/batik-svggen.jar:lib/batik/batik-util.jar:lib/batik/batik-xml.jar:.
++
++REAL_CLASSPATH := CLASSPATH=$(CLASSPATH)
# NAMES:= \
# uk/ac/sanger/artemis/OptionChangeListener \
-@@ -279,7 +279,7 @@
- mkdir tar_build/artemis
- rm -f artemis_compiled_latest.tar.gz
- tar cf - $(OTHER_FILES) act art Makefile corba etc | (cd tar_build/artemis; tar xf -)
-- tar cf - artemis_sqlmap dnaplotter uk org nsdb type seqdb lib | (cd tar_build/artemis; tar xf -)
-+ tar cf - artemis_sqlmap dnaplotter uk org nsdb type seqdb /usr/share/java | (cd tar_build/artemis; tar xf -)
- (cd tar_build; find . -name 'CVS' -print | xargs rm -rf; find . -name '.svn' -print | xargs rm -rf; tar cvf ../artemis_compiled.tar artemis)
-
- jar : all artemis.jar
-@@ -289,28 +289,28 @@
- rm -f artemis.jar
- cd jar_build; \
- if [ ! -d org ]; then \
-- for fileJar in ../lib/*.jar; do \
-+ for fileJar in /usr/share/java/*.jar; do \
- jar xvf $$fileJar; \
- rm -rf META-INF/MANIFEST.MF; \
- done; \
-- for fileJar in ../lib/j2ssh/*.jar; do \
-+ for fileJar in /usr/share/java/j2ssh/*.jar; do \
- jar xvf $$fileJar; \
- rm -rf META-INF/MANIFEST.MF; \
- done; \
-- for fileJar in ../lib/ibatis/*.jar; do \
-+ for fileJar in /usr/share/java/ibatis/*.jar; do \
- jar xvf $$fileJar; \
- rm -rf META-INF/MANIFEST.MF; \
- done; \
-- for fileJar in ../lib/batik/*.jar; do \
-+ for fileJar in /usr/share/java/batik/*.jar; do \
- jar xvf $$fileJar; \
- rm -rf META-INF/MANIFEST.MF; \
- done; \
-- for fileJar in ../lib/picard/*.jar; do \
-+ for fileJar in /usr/share/java/picard/*.jar; do \
- jar xvf $$fileJar; \
- rm -rf META-INF/MANIFEST.MF; \
- done; \
- fi; \
-- cp -R ../lib/LICENSE.Apache ../uk ../org ../nsdb ../type ../seqdb ../etc ../images ../lib/j2ssh/j2ssh.properties \
-+ cp -R ../uk ../org ../nsdb ../type ../seqdb ../etc ../images \
- ../images/PSUlogo.gif ../images/icon.gif ../README ../artemis_sqlmap .
- find jar_build -name '*.java' -print | xargs rm -f
- find jar_build -name '.svn' -print | xargs rm -rf
diff --git a/debian/patches/java6.patch b/debian/patches/java6.patch
index a10bfa7..b2af374 100644
--- a/debian/patches/java6.patch
+++ b/debian/patches/java6.patch
@@ -11,5 +11,5 @@ Last-Update: 2015-09-21
-JAVAC := javac -source 1.5 -target 1.5 $(OPT_FLAGS) $(EXTRA_FLAGS)
+JAVAC := javac $(OPT_FLAGS) $(EXTRA_FLAGS)
- REAL_CLASSPATH := CLASSPATH=/usr/share/java/biojava.jar:/usr/share/java/jemAlign.jar:/usr/share/java/j2ssh/j2ssh-core.jar:/usr/share/java/ibatis.jar:/usr/share/java/log4j-1.2.jar:/usr/share/java/postgresql-jdbc3.jar:/usr/share/java/picard.jar:/usr/share/java/sam.jar:/usr/share/java/commons-net-2.2.jar:/usr/share/java/batik-awt-util.jar:/usr/share/java/batik-dom.jar:/usr/share/java/batik-ext.jar:/usr/share/java/batik-svggen.jar:/usr/share/java/batik-util.jar:/usr/share/java/batik-xml.jar:.
+ CLASSPATH ?= lib/biojava.jar:lib/jemAlign.jar:lib/j2ssh/j2ssh-core.jar:lib/ibatis/ibatis-2.3.4.726.jar:lib/ibatis/log4j-1.2.14.jar:lib/postgresql-8.4-701.jdbc3.jar:lib/picard/picard.jar:lib/picard/sam.jar:lib/commons-net-2.2.jar:lib/batik/batik-awt-util.jar:lib/batik/batik-dom.jar:lib/batik/batik-ext.jar:lib/batik/batik-svggen.jar:lib/batik/batik-util.jar:lib/batik/batik-xml.jar:.
diff --git a/debian/rules b/debian/rules
index 8513f81..7d8a100 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,11 +2,35 @@
#DH_VERBOSE = 1
+
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk
JAVA_HOME=/usr/lib/jvm/default-java
+CUPBOARD = biojava \
+ jemAlign \
+ j2ssh-core \
+ ibatis \
+ log4j-1.2 \
+ postgresql-jdbc3 \
+ picard \
+ sam \
+ commons-net-2.2 \
+ batik-awt \
+ batik-dom \
+ batik-ext \
+ batik-svggen \
+ batik-util \
+ batik-xml
+
+# hack to be able to use a space as an argument to the subst function
+space=
+space+=
+
+CLASSPATH := $(foreach jar, $(CUPBOARD), /usr/share/java/$(jar).jar)
+export CLASSPATH := $(subst $(space),:,$(strip $(CLASSPATH)))
+
%:
dh $@
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/artemis.git
More information about the debian-med-commit
mailing list