commit aaa5e7d594f88ad613d8b626bf96d010092cca54
Author: gil <puntogil(a)libero.it>
Date: Mon Nov 11 02:09:35 2013 +0100
switch to ant
metadata-extractor-2.6.4-build.patch | 118 ++++++++++++++++++++++++++++++++++
metadata-extractor2.spec | 34 ++++++++--
2 files changed, 146 insertions(+), 6 deletions(-)
---
diff --git a/metadata-extractor-2.6.4-build.patch b/metadata-extractor-2.6.4-build.patch
new file mode 100644
index 0000000..971bfa8
--- /dev/null
+++ b/metadata-extractor-2.6.4-build.patch
@@ -0,0 +1,118 @@
+--- build.xml 2012-12-23 16:37:48.000000000 +0100
++++ build.xml-gil 2013-11-11 02:04:39.619459981 +0100
+@@ -27,18 +27,18 @@
+
+ <property name="library-version" value="2.6.4"/>
+ <property name="java-version" value="1.6"/>
+- <property name="dist" location="Releases"/>
++ <property name="dist" location="target"/>
+ <property name="src" value="Source"/>
+ <property name="output" value="Output/Source"/>
+ <property name="test-src" value="Tests"/>
+ <property name="test-output" value="Output/Tests"/>
+ <property name="sample-src" value="Samples"/>
+- <property name="javadoc" value="Javadoc"/>
++ <property name="javadoc"
value="target/site/apidocs"/>
+ <property name="test.reports" value="TestReports"/>
+- <property name="lib" value="Libraries"/>
++ <property name="lib"
value="/usr/share/java"/>
+ <property name="verbose" value="true"/>
+ <property name="debug" value="off"/>
+- <property name="classpath"
value="${lib}/junit-4.8.2.jar;${lib}/xmpcore.jar"/>
++ <property name="classpath"
value="${lib}/junit.jar;${lib}/xmpcore.jar"/>
+
+ <target name="clean" description="deletes and recreates the
destination directory">
+ <delete verbose="${verbose}" dir="${output}"/>
+@@ -56,6 +56,7 @@
+ source="${java-version}"
+ target="${java-version}"
+ debug="${debug}"
++ encoding="UTF-8"
+ verbose="${verbose}"/>
+ <javac classpath="${classpath};${output}"
+ srcdir="${test-src}"
+@@ -63,6 +64,7 @@
+ source="${java-version}"
+ target="${java-version}"
+ debug="${debug}"
++ encoding="UTF-8"
+ verbose="${verbose}"/>
+ <!--<copyfile src="LICENSE-2.0.txt" dest="${build}"
forceoverwrite="true" />-->
+ </target>
+@@ -75,7 +77,7 @@
+ <pathelement location="${output}"/>
+ <pathelement location="${test-output}"/>
+ <pathelement path="${java.class.path}"/>
+- <pathelement path="${lib}/junit-4.8.2.jar"/>
++ <pathelement path="${lib}/junit.jar"/>
+ <pathelement path="${lib}/xmpcore.jar"/>
+ </classpath>
+ <formatter type="plain"/>
+@@ -91,7 +93,6 @@
+
+ <target name="dist-binaries" depends="clean, compile, test"
description="generate binary distribution">
+ <property name="bin-jar"
value="${dist}/metadata-extractor-${library-version}.jar" />
+- <property name="bin-zip"
value="${dist}/metadata-extractor-${library-version}.zip" />
+ <jar destfile="${bin-jar}" update="false">
+ <manifest>
+ <attribute name="Main-Class"
value="com.drew.imaging.ImageMetadataReader"/>
+@@ -100,13 +101,6 @@
+ <file file="LICENSE-2.0.txt" />
+ <file file="README.txt" />
+ </jar>
+- <zip file="${bin-zip}" comment="Metadata Extractor -
http://drewnoakes.com/code/exif/">
+- <file file="${bin-jar}" />
+- <file file="${lib}/xmpcore.jar" />
+- <file file="LICENSE-2.0.txt" />
+- <file file="README.txt" />
+- </zip>
+- <delete file="${bin-jar}" />
+ </target>
+
+ <target name="dist-source" depends="clean, compile, test"
description="generate source distribution">
+@@ -119,6 +113,10 @@
+
+ <target name="javadoc" description="generate javadoc
documentation">
+ <delete verbose="${verbose}" dir="${javadoc}" />
++ <tstamp>
++ <format pattern="yyyy" property="year">
++ </format>
++ </tstamp>
+ <javadoc
+ destdir="${javadoc}"
+ defaultexcludes="yes"
+@@ -126,26 +124,25 @@
+ version="true"
+ use="true"
+ access="protected"
++ encoding="UTF-8"
+ windowtitle="Metadata-Extractor - JavaDoc - An Open Source Java Library
for Image File Metadata"
+ failonerror="true">
+ <arg value="-notimestamp" />
+ <!-- be sure to only use single quotes in the CDATA sections below
-->
+ <!-- TODO include <link rel='shortcut icon'
href='http://metadata-extractor.googlecode.com/git/Resources/metadata...
/> -->
+- <header><![CDATA[<a
href='http://www.drewnoakes.com/code/exif/' title='Go to the project home
page.'><img
src='http://metadata-extractor.googlecode.com/git/Resources/metadata-...
border="0" alt='Metadata Extractor
Logo'></a>]]></header>
+- <bottom><![CDATA[<i>Copyright © 2003-2012 Drew
Noakes. All Rights Reserved.</i>
+-<script
src='http://www.google-analytics.com/urchin.js'
type='text/javascript'></script>
+-<script type='text/javascript'>
+-_uacct = 'UA-936661-1';
+-urchinTracker();
+-</script>]]></bottom>
++ <bottom><![CDATA[<i>Copyright © 2002-${year} Drew
Noakes. All Rights Reserved.</i>]]></bottom>
+
+ <packageset dir="${src}" defaultexcludes="yes">
+ <include name="com/**"/>
+ <!--<exclude name="com/**/test"/>-->
+ </packageset>
+-
++ <classpath>
++ <pathelement location="${output}"/>
++ <pathelement
location="${dist}/metadata-extractor-${library-version}.jar"/>
++ <pathelement path="${lib}/junit.jar"/>
++ <pathelement path="${lib}/xmpcore.jar"/>
++ </classpath>
+ </javadoc>
+- <copy file="Resources/javadoc-stylesheet.css"
tofile="${javadoc}/stylesheet.css" overwrite="yes" />
+ </target>
+
+ <target name="all" depends="dist-source, dist-binaries,
javadoc" description="prepare source and binary distributions, and
javadoc"/>
diff --git a/metadata-extractor2.spec b/metadata-extractor2.spec
index 7ff2744..897e442 100644
--- a/metadata-extractor2.spec
+++ b/metadata-extractor2.spec
@@ -1,4 +1,8 @@
%global majorversion 2
+# currently in F20 maven build system is broken
+# [DEBUG] Could not find metadata org.fedoraproject.xmvn:xmvn-mojo/maven-metadata.xml in
local (/builddir/.m2/repository)
+# [DEBUG] Cannot access central (
http://repo.maven.apache.org/maven2) in offline mode and
the metadata org.fedoraproject.xmvn:xmvn-mojo/maven-metadata.xml has not been downloaded
from it before
+%global with_maven 0
Name: metadata-extractor2
Version: 2.6.4
Release: 2%{?dist}
@@ -10,13 +14,24 @@ Source0:
http://metadata-extractor.googlecode.com/files/metadata-extractor
# fix javadoc task, jar maifest entries
Source1: metadata-extractor-%{version}.pom
+# use system libraries
+# fix build dirs structure
+# disable generation of zip archive
+# fix javadoc task
+Patch0: metadata-extractor-%{version}-build.patch
+
BuildRequires: java-devel
BuildRequires: mvn(com.adobe.xmp:xmpcore)
BuildRequires: mvn(xerces:xercesImpl)
# Test deps
BuildRequires: mvn(junit:junit)
+%if %with_maven
BuildRequires: maven-local
+%else
+BuildRequires: ant
+BuildRequires: ant-junit
+%endif
Provides: mvn(com.drewnoakes:metadata-extractor) = %{version}-%{release}
@@ -52,17 +67,24 @@ rm -r Tests/com/drew/metadata/icc/IccReaderTest.java
sed -i 's/\r//' LICENSE-2.0.txt README.txt
+%patch0 -p0
+
%build
-%mvn_file :metadata-extractor %{name}
+%if %with_maven
+%mvn_file : %{name}
%if %{?fedora} > 19
-%mvn_alias :metadata-extractor "drew:metadata-extractor"
-%mvn_compat_version ":metadata-extractor" %{majorversion}
+%mvn_alias : "drew:metadata-extractor"
+%mvn_compat_version : %{version} %{majorversion}
%endif
%mvn_build
+%else
+ant dist-binaries javadoc
+%endif
%install
-%if %{?fedora} > 19
+
+%if %with_maven && %{?fedora} > 19
%mvn_install
%else
mkdir -p %{buildroot}%{_javadir}
@@ -79,7 +101,7 @@ cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
%jpackage_script com.drew.imaging.ImageMetadataReader "" ""
%{name}-%{majorversion}:xmpcore %{name} true
-%if %{?fedora} > 19
+%if %with_maven && %{?fedora} > 19
%files -f .mfiles
%else
%files
@@ -90,7 +112,7 @@ cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
%{_bindir}/*
%doc LICENSE-2.0.txt README.txt
-%if %{?fedora} > 19
+%if %with_maven && %{?fedora} > 19
%files javadoc -f .mfiles-javadoc
%else
%files javadoc