[med-svn] r18579 - in trunk/packages/rdp-classifier/trunk/debian: . scripts
Timothy Booth
tbooth-guest at moszumanska.debian.org
Mon Jan 19 13:29:29 UTC 2015
Author: tbooth-guest
Date: 2015-01-19 13:29:28 +0000 (Mon, 19 Jan 2015)
New Revision: 18579
Added:
trunk/packages/rdp-classifier/trunk/debian/bin/
trunk/packages/rdp-classifier/trunk/debian/junit.xml
trunk/packages/rdp-classifier/trunk/debian/patches/
trunk/packages/rdp-classifier/trunk/debian/rdp-classifier-doc.examples
trunk/packages/rdp-classifier/trunk/debian/rdp-classifier-doc.javadoc
trunk/packages/rdp-classifier/trunk/debian/rdp-classifier.examples
trunk/packages/rdp-classifier/trunk/debian/rdp-classifier.manifest
trunk/packages/rdp-classifier/trunk/debian/scripts/fetch_fungal_data.sh
Removed:
trunk/packages/rdp-classifier/trunk/debian/MANIFEST.MF
trunk/packages/rdp-classifier/trunk/debian/examples
trunk/packages/rdp-classifier/trunk/debian/rdp-classifier-doc.install
Modified:
trunk/packages/rdp-classifier/trunk/debian/README.Debian
trunk/packages/rdp-classifier/trunk/debian/README.source
trunk/packages/rdp-classifier/trunk/debian/changelog
trunk/packages/rdp-classifier/trunk/debian/control
trunk/packages/rdp-classifier/trunk/debian/get-orig-source
trunk/packages/rdp-classifier/trunk/debian/rdp-classifier.install
trunk/packages/rdp-classifier/trunk/debian/rules
trunk/packages/rdp-classifier/trunk/debian/scripts/rdp_classifier
trunk/packages/rdp-classifier/trunk/debian/watch
Log:
This is a work in progress. I'm committing now to save Andreas from
repeating my work. In particular I have working packages for the
dependencies - librdp-readseq-java (>= 0.1.20140425),
librdp-alignment-java ( >= 0.1.20140606),
librdp-taxonomy-tree-java ( >= 0.1.20140606)
But this all needs updating. Also, I'm not sure my fetcher script is
really a good idea.
Deleted: trunk/packages/rdp-classifier/trunk/debian/MANIFEST.MF
===================================================================
--- trunk/packages/rdp-classifier/trunk/debian/MANIFEST.MF 2015-01-19 12:50:09 UTC (rev 18578)
+++ trunk/packages/rdp-classifier/trunk/debian/MANIFEST.MF 2015-01-19 13:29:28 UTC (rev 18579)
@@ -1,5 +0,0 @@
-X-COMMENT: Manifest made by Tim Booth for Debian packaging
-Manifest-Version: 1.0
-Class-Path: /usr/share/java/commons-cli.jar /usr/share/rdp-classifier/ReadSeq.jar /usr/share/java/junit.jar
-Main-Class: edu.msu.cme.rdp.classifier.ClassifierCmd
-
Modified: trunk/packages/rdp-classifier/trunk/debian/README.Debian
===================================================================
--- trunk/packages/rdp-classifier/trunk/debian/README.Debian 2015-01-19 12:50:09 UTC (rev 18578)
+++ trunk/packages/rdp-classifier/trunk/debian/README.Debian 2015-01-19 13:29:28 UTC (rev 18579)
@@ -10,3 +10,11 @@
parallel installation of multiple versions.
-- Steffen Moeller <moeller at debian.org> Wed, 02 Mar 2011 22:50:51 +0100
+
+For Bio-Linux
+-------------
+
+RDP classifier ships with an increasing number of data files, which are too
+big to fit sensibly in a DEB. My best solution for now is to leave just the 16S
+data in the main package and put the fungal data into a tarball which can
+be unpacked into /usr/share/rdp-classifier/data/classifier/.
Modified: trunk/packages/rdp-classifier/trunk/debian/README.source
===================================================================
--- trunk/packages/rdp-classifier/trunk/debian/README.source 2015-01-19 12:50:09 UTC (rev 18578)
+++ trunk/packages/rdp-classifier/trunk/debian/README.source 2015-01-19 13:29:28 UTC (rev 18579)
@@ -2,15 +2,46 @@
-------------------------
All .jar files were manually removed from the archive.
-THe macos-resource-fork-file-in-package (files starting
-with ._ ) were removed.
+The macos-resource-fork-file-in-package (files starting with ._ ) were also removed.
-Note for 2.5 - The source for the contents of the ReadSeq.jar file is missing.
-In the hope that this will be rectified (tbooth contacted the author on 13/8/12) I
-have made a package that builds using the pre-compiled ReadSeq.jar. This could go
-into non-free.
-(Note that having the package like this contravenes the SourceForge TOS so the
-author is very naughty!)
+The upstream contains a pre-compiled .jar and that jar contains a data folder that we need.
+Therefore the repack script needs to extract the data from the .jar, and if you don't
+have the jar binary available at this point it will fail.
+I could pack the data directory back into rdp_classifier.jar but it should be possible to leave
+it under /usr/share/rdp-classifier and just add that directory to the classpath. Yes, done this
+and tested, and set the Class-Path: in the JAR manifest. Note that the trailing slash is
+essential - see http://todayguesswhat.blogspot.co.uk/2011/03/jar-manifestmf-class-path-referencing.html
-I also noticed that Steffen started packaging this as a Java library, but I think it's
-a Java application.
+Since 2.7 the classifier now needs these deps:
+
+https://github.com/rdpstaff/TaxonomyTree
+https://github.com/rdpstaff/ReadSeq
+
+These are now packaged as.
+librdp-taxonomy-tree-java
+librdp-readseq-java
+
+Since 2.9
+
+RDP classifier ships with an increasing number of data files, which are too
+big to fit sensibly in a DEB. My best solution for now is to leave just the 16S
+data in the main package and put the fungal data into a tarball which can
+be unpacked into /usr/share/rdp-classifier/data/classifier/.
+
+Or alternatively, make a script which can do the unpacking. Hmmm.
+
+Old notes...
+
+rdp-classifier for Debian
+-------------------------
+
+This packaging was yet performed only for internal use. Please
+complete it. To do:
+ * license check
+ * description in debian/control
+ * separation of documentation
+ * separation of symbolic links in separate packages to prepare
+ parallel installation of multiple versions.
+
+ -- Steffen Moeller <moeller at debian.org> Wed, 02 Mar 2011 22:50:51 +0100
+
Modified: trunk/packages/rdp-classifier/trunk/debian/changelog
===================================================================
--- trunk/packages/rdp-classifier/trunk/debian/changelog 2015-01-19 12:50:09 UTC (rev 18578)
+++ trunk/packages/rdp-classifier/trunk/debian/changelog 2015-01-19 13:29:28 UTC (rev 18579)
@@ -1,3 +1,25 @@
+rdp-classifier (2.9+dfsg-0biolinux1) trusty; urgency=medium
+
+ * New upstream
+ * Needs updated librdp-readseq-java, librdp-taxonomy-tree-java and new
+ librdp-alignment-java
+ * The new distribution includes too much identification data to package.
+ * Just include the 16S data in the package. Provide a script to get the
+ fungal data and put it in the right place. Modify the command line to
+ see data in ~/rdp_classifier/data
+
+ -- Tim Booth <tbooth at ceh.ac.uk> Mon, 06 Oct 2014 15:46:58 +0100
+
+rdp-classifier (2.7+dfsg-0biolinux1) trusty; urgency=low
+
+ * New upstream and build for Trusty
+ * Add deps on two librdp packages
+ * Add unit tests
+ * Move data out of the .jar
+ * Move some things around
+
+ -- Tim Booth <tbooth at ceh.ac.uk> Wed, 30 Apr 2014 18:04:30 +0100
+
rdp-classifier (2.5+dfsg-1) UNRELEASED; urgency=low
* debian/watch: Enable '+dfsg' suffix
Modified: trunk/packages/rdp-classifier/trunk/debian/control
===================================================================
--- trunk/packages/rdp-classifier/trunk/debian/control 2015-01-19 12:50:09 UTC (rev 18578)
+++ trunk/packages/rdp-classifier/trunk/debian/control 2015-01-19 13:29:28 UTC (rev 18579)
@@ -3,7 +3,12 @@
Priority: extra
Maintainer: Steffen Moeller <steffen_moeller at gmx.de>
Uploaders: Tim Booth <tbooth at ceh.ac.uk>
-Build-Depends: debhelper (>= 8), default-jdk, junit, libcommons-cli-java, javahelper
+Build-Depends: debhelper (>= 8), default-jdk, junit4, libcommons-cli-java, javahelper,
+ librdp-readseq-java (>= 0.1.20140425),
+ librdp-alignment-java ( >= 0.1.20140606),
+ librdp-taxonomy-tree-java ( >= 0.1.20140606),
+ libjfreechart-java,
+ ant, ant-optional
Standards-Version: 3.9.3
Homepage: http://rdp.cme.msu.edu/.
Vcs-Browser: http://svn.debian.org/wsvn/debian-med/trunk/packages/rdp-classifier/trunk/
Deleted: trunk/packages/rdp-classifier/trunk/debian/examples
===================================================================
--- trunk/packages/rdp-classifier/trunk/debian/examples 2015-01-19 12:50:09 UTC (rev 18578)
+++ trunk/packages/rdp-classifier/trunk/debian/examples 2015-01-19 13:29:28 UTC (rev 18579)
@@ -1 +0,0 @@
-sampledata
Modified: trunk/packages/rdp-classifier/trunk/debian/get-orig-source
===================================================================
--- trunk/packages/rdp-classifier/trunk/debian/get-orig-source 2015-01-19 12:50:09 UTC (rev 18578)
+++ trunk/packages/rdp-classifier/trunk/debian/get-orig-source 2015-01-19 13:29:28 UTC (rev 18579)
@@ -27,22 +27,27 @@
fi
set -x
-TARDIR=${NAME}-${VERSION}
+TARDIR=src
mkdir -p ../tarballs
cd ../tarballs
# need to clean up the tarballs dir first because upstream tarball might
# contain a directory with unpredictable name
rm -rf *
unzip -q ../${UNAME}_${VERSION}.zip
-mv ${UNAME}_${VERSION} ${TARDIR}
rm -rf __MACOSX
+mv * $TARDIR
+#Unpack data before dispensing with the .jar
+echo "Retrieving data folder from .jar"
+( cd ${TARDIR} ; jar xvf dist/classifier.jar data )
+rm -rf ${TARDIR}/data/*/fungal*
# Remove JAR files with the exception of ReadSeq.jar
-for jar in `find ${TARDIR} -type f -name "*.jar"` ; do
- if ! echo $jar | grep -q "ReadSeq.jar$" ; then
- rm -rf $jar
- fi
-done
+# for jar in `find ${TARDIR} -type f -name "*.jar"` ; do
+# if ! echo $jar | grep -q "ReadSeq.jar$" ; then
+# rm -rf $jar
+# fi
+# done
+find ${TARDIR} -type f -name "*.jar" -delete
GZIP="--best --no-name" tar --owner=root --group=root --mode=a+rX -caf "$NAME"_"$VERSION"~dfsg.orig.tar.${COMPRESS} "${TARDIR}"
rm -rf ${TARDIR}
Added: trunk/packages/rdp-classifier/trunk/debian/junit.xml
===================================================================
--- trunk/packages/rdp-classifier/trunk/debian/junit.xml (rev 0)
+++ trunk/packages/rdp-classifier/trunk/debian/junit.xml 2015-01-19 13:29:28 UTC (rev 18579)
@@ -0,0 +1,21 @@
+<!-- Snippet to drive junit tests in deb build. Build rdp-readseq.jar first. -->
+<project>
+<target name="junit">
+
+ <property name="cp" value="rdp_classifier.jar:/usr/share/java/junit4.jar:test"/>
+
+ <javac srcdir="test">
+ <classpath path="${cp}"/>
+ </javac>
+
+ <junit printsummary="yes" haltonfailure="yes" showoutput="yes">
+ <classpath path="${cp}"/>
+
+ <formatter type="xml"/>
+
+ <batchtest fork="yes">
+ <fileset dir="test" includes="**/rrnaclassifier/**/*Test.java"/>
+ </batchtest>
+ </junit>
+</target>
+</project>
Added: trunk/packages/rdp-classifier/trunk/debian/rdp-classifier-doc.examples
===================================================================
--- trunk/packages/rdp-classifier/trunk/debian/rdp-classifier-doc.examples (rev 0)
+++ trunk/packages/rdp-classifier/trunk/debian/rdp-classifier-doc.examples 2015-01-19 13:29:28 UTC (rev 18579)
@@ -0,0 +1 @@
+samplefiles
Deleted: trunk/packages/rdp-classifier/trunk/debian/rdp-classifier-doc.install
===================================================================
--- trunk/packages/rdp-classifier/trunk/debian/rdp-classifier-doc.install 2015-01-19 12:50:09 UTC (rev 18578)
+++ trunk/packages/rdp-classifier/trunk/debian/rdp-classifier-doc.install 2015-01-19 13:29:28 UTC (rev 18579)
@@ -1 +0,0 @@
-docs /usr/share/doc/rdp-classifier/
Added: trunk/packages/rdp-classifier/trunk/debian/rdp-classifier-doc.javadoc
===================================================================
--- trunk/packages/rdp-classifier/trunk/debian/rdp-classifier-doc.javadoc (rev 0)
+++ trunk/packages/rdp-classifier/trunk/debian/rdp-classifier-doc.javadoc 2015-01-19 13:29:28 UTC (rev 18579)
@@ -0,0 +1 @@
+internal
Added: trunk/packages/rdp-classifier/trunk/debian/rdp-classifier.examples
===================================================================
--- trunk/packages/rdp-classifier/trunk/debian/rdp-classifier.examples (rev 0)
+++ trunk/packages/rdp-classifier/trunk/debian/rdp-classifier.examples 2015-01-19 13:29:28 UTC (rev 18579)
@@ -0,0 +1 @@
+test/test/classifier/testQuerySeq.fasta
Modified: trunk/packages/rdp-classifier/trunk/debian/rdp-classifier.install
===================================================================
--- trunk/packages/rdp-classifier/trunk/debian/rdp-classifier.install 2015-01-19 12:50:09 UTC (rev 18578)
+++ trunk/packages/rdp-classifier/trunk/debian/rdp-classifier.install 2015-01-19 13:29:28 UTC (rev 18579)
@@ -1,3 +1,4 @@
rdp_classifier.jar usr/share/rdp-classifier
-lib/ReadSeq.jar usr/share/rdp-classifier
-debian/scripts/rdp_classifier usr/bin
+data usr/share/rdp-classifier
+debian/scripts/rdp_* usr/bin
+debian/scripts/*.sh usr/share/rdp-classifier
Added: trunk/packages/rdp-classifier/trunk/debian/rdp-classifier.manifest
===================================================================
--- trunk/packages/rdp-classifier/trunk/debian/rdp-classifier.manifest (rev 0)
+++ trunk/packages/rdp-classifier/trunk/debian/rdp-classifier.manifest 2015-01-19 13:29:28 UTC (rev 18579)
@@ -0,0 +1,5 @@
+usr/share/java/rdp_classifier.jar:
+ X-COMMENT: Manifest made by Tim Booth for Debian packaging
+ Manifest-Version: 1.0
+ Class-Path: /usr/share/java/commons-cli.jar /usr/share/java/rdp-readseq.jar /usr/share/java/rdp-taxonomy-tree.jar /usr/share/rdp-classifier/
+ Main-Class: edu.msu.cme.rdp.classifier.ClassifierCmd
Modified: trunk/packages/rdp-classifier/trunk/debian/rules
===================================================================
--- trunk/packages/rdp-classifier/trunk/debian/rules 2015-01-19 12:50:09 UTC (rev 18578)
+++ trunk/packages/rdp-classifier/trunk/debian/rules 2015-01-19 13:29:28 UTC (rev 18579)
@@ -4,31 +4,34 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
-##NR## Note - See README.source before doing anything with
-##NR## this package!
-##NR## NR lines relate to not rebuilding lib/ReadSeq.jar
+export CLASSPATH=/usr/share/java/junit.jar:/usr/share/java/commons-cli.jar:/usr/share/java/rdp-alignment.jar:/usr/share/java/rdp-taxonomy-tree.jar:/usr/share/java/jfreechart.jar
-SRC=source/src
-CP=/usr/share/java/junit.jar:/usr/share/java/commons-cli.jar
-
%:
dh $@ --with javahelper
override_dh_auto_build:
- ##NR## - should not be using binary JAR in build
- javac -cp ${CP}:lib/ReadSeq.jar `find ${SRC} -name "*.java" -and -not -name "._*"`
- ( cd ${SRC} ; find . -name "*.class" ) > rdp_classifier.list
- ( cd ${SRC} ; jar -mc ${CURDIR}/debian/MANIFEST.MF @${CURDIR}/rdp_classifier.list data ) > rdp_classifier.jar
+ jh_build -J rdp_classifier.jar src
+ #jar uf rdp_classifier.jar data
override_dh_auto_clean:
- find . -name "*.class" | xargs -r rm -f
- ##NR## rm -f "*.jar" lib/*.jar
- rm -f rdp_classifier.jar
- rm -f *.list
+ rm -f *.jar lib/*.jar TEST-*
+ find test -name '*.class' -delete
+ rm -f *.list tmp-junit.xml
+ rm -rf dist
-# does not show any amazing effect
-#override_dh_builddeb:
-# dh_builddeb -- -Z xz
+override_dh_auto_test:
+ cp debian/junit.xml ./tmp-junit.xml
+ ant -f tmp-junit.xml junit
+override_dh_builddeb:
+ dh_builddeb -- -Z xz
+
+override_dh_compress:
+ dh_compress -X.fasta
+
+override_dh_fixperms:
+ dh_fixperms
+ chmod +x debian/*/usr/share/*/*.sh
+
get-orig-source:
uscan --verbose --force-download
Added: trunk/packages/rdp-classifier/trunk/debian/scripts/fetch_fungal_data.sh
===================================================================
--- trunk/packages/rdp-classifier/trunk/debian/scripts/fetch_fungal_data.sh (rev 0)
+++ trunk/packages/rdp-classifier/trunk/debian/scripts/fetch_fungal_data.sh 2015-01-19 13:29:28 UTC (rev 18579)
@@ -0,0 +1,80 @@
+#!/bin/sh
+set -e
+
+# I can no longer ship all the rdp_classifier data in the DEB package. This script
+# will help you install it.
+enterkey() {
+ read -p "Press ENTER to continue, Ctrl+C to exit..." -r ignored
+ echo
+}
+
+if echo "$*" | grep -wq -- --here ; then
+ echo "Downloading to ./classifier as --here was specified."
+elif [ "`id -u`" = 0 ] ; then
+ echo "Data will be downloaded to /usr/share/rdp-classifier/data/classifier"
+ cd /usr/share/rdp-classifier
+ umask 022
+ enterkey
+else
+ echo "Data will be downloaded to $HOME/rdp_classifier/data/classifier"
+ enterkey
+ mkdir -p "$HOME/rdp_classifier/data/classifier"
+ cd "$HOME/rdp_classifier/data/classifier"
+ cd ../..
+fi
+
+# Fetch the fungal data into the [data/]classifier directory in the current directory.
+# The following only really makes sense if --here was set.
+classifier=classifier
+if [ ! -d $classifier ] ; then
+ classifier=data/classifier
+ if [ ! -d $classifier ] ; then
+ echo "There is no data/classifier subdirectory here."
+ echo "You normally want to run this in /usr/share/rdp-classifier/."
+ exit 1
+ fi
+fi
+
+#Let us fetch!
+#This version of the URL does not bounce us back to sf.net, which is good.
+zip_url='http://www.mirrorservice.org/sites/download.sourceforge.net/pub/sourceforge/r/rd/rdp-classifier/rdp-classifier/rdp_classifier_2.9.zip'
+zip_file=`echo "$zip_url" | sed 's,.*/,,'`
+
+#If the file was already there then this script probably shouldn't delete it.
+file_was_already_there=no
+if [ -e "$zip_file" ] ; then
+ file_was_already_there=yes
+fi
+
+tmpdir=`mktemp -d ./tmp.XXXX`
+[ "${tmpdir#./}" != "$tmpdir" ]
+cd $tmpdir ; cd .. #Be really sure we really made the tmpdir.
+
+# It would be nice to grab rdp_classifier_2.9.zip and unzip it on the fly, but this can't be done
+# as zip files have the crucial info at the end, so we do need to save the file, and likewise the
+# .jar file
+wget -c "$zip_url"
+cd $tmpdir
+unzip -j ../"$zip_file" '*/dist/classifier.jar'
+[ $file_was_already_there = no ] && rm ../"$zip_file"
+jar xvf classifier.jar 'data/classifier'
+
+#At this point, I want to overwrite files not found in a package but leave packaged files.
+echo "Scrubbing non-package-owned files from $classifier"
+
+# Note - this is not robust.
+# Also this looks like the kind of one-liner that can eat your precious files if there
+# is some small bug in this script.
+# find "`readlink -e ../"$classifier"`" -type f -print0 | xargs -0 dpkg-query -S 2>&1 >/dev/null | sed 's,[^/]*,,' \
+# | xargs -r -d'\n' rm -v --
+
+# Yeah, here is a better looking one:
+find "`readlink -e ../"$classifier"`" -type f \( -exec dpkg-query -S '{}' ';' -or -delete \) >/dev/null
+
+echo "Copying in new data files."
+cp -vrn data/classifier ../"$classifier"/..
+cd ..
+
+rm -r $tmpdir
+
+echo DONE
Modified: trunk/packages/rdp-classifier/trunk/debian/scripts/rdp_classifier
===================================================================
--- trunk/packages/rdp-classifier/trunk/debian/scripts/rdp_classifier 2015-01-19 12:50:09 UTC (rev 18578)
+++ trunk/packages/rdp-classifier/trunk/debian/scripts/rdp_classifier 2015-01-19 13:29:28 UTC (rev 18579)
@@ -2,9 +2,16 @@
# Note that the JAR MANIFEST points to the locations of the
# required libs on Debian so no setting of Classpath is needed here.
-# For the same reason, the JAR form this package is not going to be
+# For the same reason, the JAR you find in this package is not going to be
# happy running outside Debian.
+# Actually, I do want to add ~/rdp_classifier/ to the CP if it exists
+if [ -e "$HOME/rdp_classifier/data/" ] ; then
+ CLASSPATH="$CLASSPATH:$HOME/rdp_classifier/"
+ CLASSPATH="${CLASSPATH#:}"
+ export CLASSPATH
+fi
+
JAR=/usr/share/rdp-classifier/rdp_classifier.jar
exec java -Xms512M -Xmx512M -jar "$JAR" "$@"
Modified: trunk/packages/rdp-classifier/trunk/debian/watch
===================================================================
--- trunk/packages/rdp-classifier/trunk/debian/watch 2015-01-19 12:50:09 UTC (rev 18578)
+++ trunk/packages/rdp-classifier/trunk/debian/watch 2015-01-19 13:29:28 UTC (rev 18579)
@@ -1,4 +1,4 @@
version=3
opts=dversionmangle=s/[~+]dfsg[0-9]*// \
http://sf.net/rdp-classifier/rdp_classifier_(.*).zip \
- debian debian/get-orig-source
\ No newline at end of file
+ debian debian/get-orig-source
More information about the debian-med-commit
mailing list