dev-java/metadata-extractor: Version bump and java-pkg-simple rewrite

Patching build.xml was annoying. This version isn't limited to Java
6. Nothing currently requires it but it's well-maintained and looks
useful.

Package-Manager: portage-2.2.27
This commit is contained in:
James Le Cuirot
2016-02-18 23:10:10 +00:00
parent 905ca34a9c
commit 1e5e10f666
5 changed files with 63 additions and 94 deletions
+1
View File
@@ -1 +1,2 @@
DIST metadata-extractor-2.2.2-src.jar 3936358 SHA256 38f8b12418afde99286b9b7c86158eb4fd2c47a23ed4af025af77bae301e1783 SHA512 5004ecef28e9fc1f24a4b13b4596c801e9b20fcb9c20165e79b2543837187b8cb019aa32c301e2850939a95a23224444d6eb7e23c45d8bf54cf267899052b2f7 WHIRLPOOL ff35285df14741babe45b2b1906b0d5ceacbc76a12684d0e676cb7ad784eeafaa9bee4016489ce5643d5bcf85d1140d69667f8f9a646c9720ae4eb2602bbf031
DIST metadata-extractor-2.8.1.tar.gz 3132397 SHA256 0d734971e9896709fb9e11406cefbeaa0cf11d57fa7dca6b02acaf92a2a686fd SHA512 4e9fe88be4112fbf9ce481e7fd3b3a7c9544d1d5b1ebd646d2c6e2a2a1fe2d53a4b80ab859fe5e277c3e72f5e035aa46d7af7a953a182f5b8215edf9cde99974 WHIRLPOOL bc296ebe64b82ec9485f364e287139369bb1da5f98eab47db5014d0f1d263378d0341383da95bda3efa5fba6c81c3ebb9c30a3586aa7277ec893d2ad6ac5e52f
@@ -1,46 +0,0 @@
--- metadata-extractor.build 2009-01-31 15:22:58.000000000 +0200
+++ metadata-extractor.build.fixed 2009-01-31 15:37:02.000000000 +0200
@@ -24,25 +24,38 @@
srcdir="${src}"
destdir="${build}"
debug="${debug}"
- verbose="${verbose}"/>
+ verbose="${verbose}">
+ <exclude name="**/test/*.java"/>
+ </javac>
+ </target>
+
+ <target name="compile-test" description="compile the source">
+ <javac classpath="${classpath}"
+ srcdir="${src}"
+ destdir="${build}"
+ debug="${debug}"
+ verbose="${verbose}">
+ <include name="**/test/*.java"/>
+ </javac>
</target>
- <target name="dist-binaries" depends="clean, compile, test" description="generate binary distribution">
+ <target name="dist-binaries" depends="clean, compile" description="generate binary distribution">
<jar destfile="${dist}/metadata-extractor-${version}.jar" update="false" basedir="${build}">
<manifest>
<attribute name="Main-Class" value="com.drew.imaging.jpeg.JpegMetadataReader"/>
- </manifest>
+ </manifest>
+ <exclude name="**/test/*.class"/>
</jar>
</target>
- <target name="dist-source" depends="clean, compile, test" description="generate source distribution">
+ <target name="dist-source" depends="clean, compile" description="generate source distribution">
<jar destfile="${dist}/metadata-extractor-${version}-src.jar" update="false">
<fileset dir="."
includes="${src}/**/*.java, ${src}/**/*.jpg, ${lib}/junit.jar, metadata-extractor.build, ReleaseNotes.txt"/>
</jar>
</target>
- <target name="test" depends="compile" description="run all junit tests">
+ <target name="test" depends="compile-test" description="run all junit tests">
<junit printsummary="yes" fork="yes" haltonfailure="yes">
<classpath>
<pathelement location="${build}"/>
@@ -1,45 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
inherit java-pkg-2 java-ant-2 eutils
DESCRIPTION="Metadata extraction framework for Exif and IPTC metadata segments, extraction support for JPEG files"
HOMEPAGE="http://www.drewnoakes.com/code/exif/"
SRC_URI="http://www.drewnoakes.com/code/exif/metadata-extractor-${PV}-src.jar"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test"
DEPEND="|| ( =virtual/jdk-1.6* =virtual/jdk-1.5* =virtual/jdk-1.4* )
test? ( dev-java/junit:0 )
app-arch/unzip:0"
RDEPEND=">=virtual/jre-1.4"
S=${WORKDIR}
java_prepare() {
epatch "${FILESDIR}"/${P}-buildfix.patch
mv metadata-extractor.build build.xml || die
use test && java-pkg_jar-from --build-only --into lib/ junit junit.jar
}
EANT_DOC_TARGET=""
EANT_BUILD_TARGET="dist-binaries"
src_install() {
java-pkg_newjar dist/*.jar ${PN}.jar
dodoc ReleaseNotes.txt
}
src_test() {
ANT_TASKS="ant-junit" eant test
}
@@ -0,0 +1,52 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
JAVA_PKG_IUSE="doc source"
inherit java-pkg-2 java-pkg-simple
DESCRIPTION="Access the metadata in digital images and video via a simple Java API"
HOMEPAGE="http://www.drewnoakes.com/code/exif/"
SRC_URI="https://github.com/drewnoakes/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="examples test"
CDEPEND="dev-java/xmpcore:0"
DEPEND="${CDEPEND}
>=virtual/jdk-1.6
test? ( dev-java/junit:4 )"
RDEPEND="${CDEPEND}
>=virtual/jre-1.6"
S="${WORKDIR}/${P}"
JAVA_SRC_DIR="Source"
JAVA_GENTOO_CLASSPATH="xmpcore"
java_prepare() {
java-pkg_clean
}
src_install() {
java-pkg-simple_src_install
dodoc {CONTRIBUTING,README}.md
use examples && java-pkg_doexamples Samples
}
src_test() {
local DIR=Tests
local CP="${DIR}:${S}/${PN}.jar:$(java-pkg_getjars junit-4,${JAVA_GENTOO_CLASSPATH})"
local TESTS=$(find ${DIR} -name "*Test.java")
TESTS="${TESTS//Tests\/}"
TESTS="${TESTS//.java}"
TESTS="${TESTS//\//.}"
ejavac -cp "${CP}" -d ${DIR} $(find ${DIR} -name "*.java")
ejunit4 -classpath "${CP}" ${TESTS}
}
+10 -3
View File
@@ -6,8 +6,15 @@
<name>Java</name>
</maintainer>
<longdescription>
A general metadata extraction framework. Support currently exists for
Exif and Iptc metadata segments. Extraction of these segments is
provided for Jpeg files.
metadata-extractor is a straightforward Java library for reading metadata from image files.
Metadata metadata = ImageMetadataReader.readMetadata(imagePath);
With that metadata object, you can iterate or query the various tag values that were read from the image.
The library understands several formats of metadata, many of which may be present in a single image.
</longdescription>
<upstream>
<remote-id type="github">drewnoakes/metadata-extractor</remote-id>
</upstream>
</pkgmetadata>