[xom: 1/2] Update to latest upstream version 1.2.10

Mikolaj Izdebski mizdebsk at fedoraproject.org
Tue Mar 24 07:44:15 UTC 2015


commit 2d2cff3a95d993dd9a6e78abac34f0426b23be92
Author: Michal Srb <msrb at redhat.com>
Date:   Mon Jun 24 20:25:30 2013 +0200

    Update to latest upstream version 1.2.10
    
    - Spec file clean up
    
    Signed-off-by: Mikolaj Izdebski <mizdebsk at redhat.com>

 clean-tarball.sh                 |  25 ++++++++
 xom-1.0.pom                      |  62 ------------------
 xom-Replace-icu4j-with-JDK.patch | 125 ------------------------------------
 xom-betterdocclasspath.patch     |  14 ----
 xom-build.patch                  | 134 +++++++++++++++++++++++++++++++++++++++
 xom-gjdocissues.patch            |  21 ------
 xom.spec                         | 123 ++++++++++++++++-------------------
 7 files changed, 212 insertions(+), 292 deletions(-)
---
diff --git a/clean-tarball.sh b/clean-tarball.sh
new file mode 100755
index 0000000..d9aaa6e
--- /dev/null
+++ b/clean-tarball.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+if [ $# -ne 1 ]; then
+    echo "Usage: ./clean-tarball VERSION"
+    exit 1
+fi
+
+VERSION=${1}
+NAME="xom"
+
+wget http://www.cafeconleche.org/XOM/${NAME}-${VERSION}.tar.gz
+tar xzvf ${NAME}-${VERSION}.tar.gz
+
+( cd XOM/
+  # remove bundled JARs, .class files and other unneeded stuff
+  find ./ -name \*.jar -delete
+  find ./ -name \*.class -delete
+  find ./ -name \*.pdf -delete
+  rm -Rf ./lib/ ./classes15/ ./apidocs ./bin ./www
+  rm ./overview.html ./mondial.xml ./mondial.dtd ./xom.graffle ./project.xml
+)
+
+tar czvf ${NAME}-${VERSION}-clean.tar.gz XOM/
+rm -Rf ${NAME}-${VERSION}.tar.gz
+
diff --git a/xom-build.patch b/xom-build.patch
new file mode 100644
index 0000000..ff95af9
--- /dev/null
+++ b/xom-build.patch
@@ -0,0 +1,134 @@
+--- build.xml	2013-06-14 14:51:48.987704187 +0200
++++ build.xml-orig	2013-06-14 15:00:28.607577931 +0200
+@@ -68,11 +68,11 @@
+     <property name="dist.dir"        value="./dist"/>    
+     <property name="clover.dir"      value="./clover"/>
+     <property name="testreports.dir" value="./testreports" />
+-    <property name="jaxen.dir"       value="${build.dir}/jaxen-classes"/>
+ 
+     <property name="xml-apis.jar"   value="${lib.dir}/xml-apis.jar"/>
+     <property name="parser.jar"     value="${lib.dir}/dtd-xercesImpl.jar"/>
+     <property name="xslt.jar"       value="${lib.dir}/xalan.jar"/>
++    <property name="jaxen.jar"      value="${lib.dir}/jaxen.jar"/>
+     <property name="serializer.jar" value="${lib.dir}/serializer.jar"/>
+     <property name="tagsoup.jar"    value="${lib2.dir}/tagsoup-1.2.jar"/>
+     <property name="junit.jar"      value="${lib.dir}/junit.jar"/>
+@@ -107,7 +107,7 @@
+       <pathelement location="${xml-apis.jar}"/>
+       <pathelement location="${parser.jar}"/>
+       <pathelement location="${junit.jar}"/>
+-      <pathelement location="${jaxen.dir}"/>
++      <pathelement location="${jaxen.jar}"/>
+       <pathelement location="${servlet.jar}"/>
+     </path>
+ 
+@@ -115,7 +115,7 @@
+       <pathelement location="${xml-apis.jar}"/>
+       <pathelement location="${parser.jar}"/>
+       <pathelement location="${xom-core}"/>
+-      <pathelement location="${jaxen.dir}"/>
++      <pathelement location="${jaxen.jar}"/>
+       <pathelement location="${xslt.jar}"/>
+       <pathelement location="${serializer.jar}"/>
+     </path>
+@@ -214,15 +214,15 @@
+   </target>
+ 
+ 
+-  <target name="compile-core" depends="prepare, compile-jaxen" 
++  <target name="compile-core" depends="prepare" 
+           description="Compile the source code">
+     <javac srcdir="${build.src}"
+            destdir="${build.dest}"
+            debug="${debug}"
+            optimize="${optimize}"
+            deprecation="${deprecation}"
+-           target="1.2"
+-           source="1.3"
++           target="1.5"
++           source="1.5"
+            encoding="UTF-8"
+     	   fork="true"
+            includeAntRuntime="false"
+@@ -253,8 +253,8 @@
+            debug="${debug}"
+            optimize="${optimize}"
+            deprecation="${deprecation}"
+-           target="1.2"
+-           source="1.3"
++           target="1.5"
++           source="1.5"
+            encoding="UTF-8"
+            includeAntRuntime="false">
+        <classpath refid="compile.class.path"/>
+@@ -270,8 +270,8 @@
+            debug="${debug}"
+            optimize="${optimize}"
+            deprecation="${deprecation}"
+-           target="1.2"
+-           source="1.3"
++           target="1.5"
++           source="1.5"
+            encoding="UTF-8"
+            failonerror="false"
+            includeAntRuntime="false">
+@@ -330,10 +330,6 @@
+ 		 compress="yes"
+          includes="nu/xom/* nu/xom/xslt/* nu/xom/xinclude/* nu/xom/converters/* nu/xom/canonical/* nu/xom/tests/XOMTestCase.class"
+          excludes="nu/xom/samples/* nu/xom/benchmarks/* nu/xom/pantry/* nu/xom/tools/*">
+-
+-      <fileset dir="${jaxen.dir}"
+-         excludes="**Demo.class **/package.html org/jaxen/xom/** org/jaxen/XPathTestBase.class org/jaxen/jdom/** org/jaxen/dom4j/** org/jaxen/javabean/** org/jaxen/dom/** org/jaxen/**Test.class org/jaxen/saxpath/base/**Test.class org/jaxen/saxpath/helpers/**Test.class org/jaxen/saxpath/helpers/**Test.class org/jaxen/pattern/** org/jaxen/saxpath/SAXPathParseException.class org/w3c/dom/UserDataHandler.class org/jaxen/pattern/PriorityTest.class">
+-      </fileset>
+     
+       <rule pattern="org.jaxen.**" result="nu.xom.jaxen. at 1"/>
+ 
+@@ -512,8 +508,8 @@
+            debug="${debug}"
+            optimize="${optimize}"
+            deprecation="${deprecation}"
+-           target="1.2"
+-           source="1.3"
++           target="1.5"
++           source="1.5"
+            encoding="UTF-8"
+            includeAntRuntime="false"
+            includes="nu/xom/tools/*">
+@@ -844,7 +840,7 @@
+   <!-- Generate a Maven 2 JAR for uploading to the maven
+       bug repository and hence placement onto ibiblio and mirrors. 
+       See http://maven.apache.org/guides/mini/guide-central-repository-upload.html -->
+-  <target name="maven2" depends="jar, sources.jar, javadoc.jar" >
++  <target name="maven2" depends="jar" >
+       <property name="pom2.template" location="project2.xml" />
+       <property name="pom2.file" location="${build.dir}/maven2/project.xml" />
+       <property name="package.jar" location="${build.dir}/${name}-${version}.jar"/>
+@@ -866,14 +862,14 @@
+   </target>
+ 
+ 
+-  <target name="compile-jaxen" description="Compile Jaxen" depends="get-jaxen">
++  <target name="compile-jaxen" description="Compile Jaxen">
+     <javac srcdir="${build.dir}/jaxen-${jaxenversion}/src/java/main"
+            destdir="${build.dir}/jaxen-classes"
+            debug="${debug}"
+            optimize="${optimize}"
+            deprecation="${deprecation}"
+-           target="1.2"
+-           source="1.3"
++           target="1.5"
++           source="1.5"
+            encoding="UTF-8"
+            includeAntRuntime="false"
+            excludes="org/jaxen/dom/** 
+@@ -895,10 +891,6 @@
+        <classpath refid="compile.class.path"/>
+     </javac>  
+   </target>
+-  
+-  <target name="get-jaxen" description="Download Jaxen source code" depends="prepare">
+-      <unzip src="jaxen-${jaxenversion}-src.zip" dest="${build.dir}" />
+-  </target>
+ 
+   <target name="debug" depends="init" description="Print various Ant properties">
+     <echoproperties/>
diff --git a/xom.spec b/xom.spec
index bce5270..7e69025 100644
--- a/xom.spec
+++ b/xom.spec
@@ -35,26 +35,20 @@
 
 Summary:        XML Pull Parser
 Name:           xom
-Version:        1.0
-Release:        12%{?dist}
+Version:        1.2.10
+Release:        1%{?dist}
 Epoch:          0
 License:        LGPLv2
 URL:            http://www.xom.nu
-Group:          Development/Libraries
-Source0:        http://www.cafeconleche.org/XOM/xom-1.0.tar.gz
-Source1:        http://central.maven.org/maven2/xom/xom/1.0/xom-1.0.pom
-
-# Evidently gjdoc doesn't know about the noqualifier option; also, it
-# must do linkoffline and not link
-Patch0:         %{name}-gjdocissues.patch
-# FIXME:  file this
-# I don't know if this is a libgcj bug or if this is a legitimate typo
-# in build.xml
-Patch1:         %{name}-betterdocclasspath.patch
-# Replace icu4j by java.text from JDK to reduce dependency chain
-Patch2:         %{name}-Replace-icu4j-with-JDK.patch
-
-BuildRequires:  ant >= 0:1.6, jpackage-utils >= 0:1.6
+# clean-tarball %{version}
+Source0:        %{name}-%{version}-clean.tar.gz
+
+# Don't download jaxen, set javac target/source to 1.5
+Patch0:         %{name}-build.patch
+
+BuildRequires:  ant >= 0:1.6
+BuildRequires:  jarjar
+BuildRequires:  jaxen
 BuildRequires:  junit
 BuildRequires:  xalan-j2
 BuildRequires:  xerces-j2
@@ -62,19 +56,17 @@ BuildRequires:  xerces-j2
 BuildRequires:  dom4j
 %endif
 BuildRequires:  xml-commons-apis
-
 BuildRequires:  tagsoup
-# Use JAXP implementation in libgcj
-BuildRequires:  libgcj
 BuildRequires:  xml-commons-resolver
 BuildRequires:  servlet
 
+Requires:  jaxen
 Requires:  xalan-j2
 Requires:  xerces-j2
 Requires:  xml-commons-apis
-Requires:  jpackage-utils
+
 BuildArch: noarch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
 
 %description
 XOM is a new XML object model. It is an open source (LGPL),
@@ -87,50 +79,46 @@ you should be able to get up and running with XOM very quickly.
 
 %package javadoc
 Summary:        Javadoc for %{name}
-Group:          Documentation
-Requires:       jpackage-utils
 
 %description javadoc
 %{summary}.
 
 %package demo
 Summary:        Samples for %{name}
-Group:          Documentation
-Requires:       %{name} = 0:%{version}
+Requires:       %{name} = %{?epoch}:%{version}-%{release}
 
 %description demo
 %{summary}.
 
 %prep
 %setup -q -n XOM
+
 %patch0
-%patch1
-%patch2 -p1
-# remove all binary libs
-find . -name "*.jar" -exec rm -f {} \;
-# disable tests that require icu4j
-rm -f src/nu/xom/tests/{Encoding,Verifier}Test.java
-
-cp %{SOURCE1} pom.xml
-# fix xml stuff in pom
-sed -i 's%<project>%<project xmlns="http://maven.apache.org/POM/4.0.0" \
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \
-xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 \
-http://maven.apache.org/maven-v4_0_0.xsd ">%' pom.xml
-# remove it from pom.xml since it's not needed anymore
-%pom_remove_dep com.ibm.icu:icu4j
 
+# fix non ASCII chars
+for s in src/nu/xom/tests/BuilderTest.java\
+ src/nu/xom/tests/SerializerTest.java;do
+  native2ascii -encoding UTF8 ${s} ${s}
+done
+
+# Fix encoding
+sed -i 's/\r//g' LICENSE.txt
+sed -i "s,59 Temple Place,51 Franklin Street,;s,Suite 330,Fifth Floor,;s,02111-1307,02110-1301,"  $(find -name "*.java") \
+ LICENSE.txt lgpl.txt
 
 %build
+mkdir lib
 pushd lib
 ln -sf $(build-classpath junit) junit.jar
-ln -sf $(build-classpath xerces-j2) xercesImpl.jar
+ln -sf $(build-classpath xerces-j2) dtd-xercesImpl.jar
 ln -sf $(build-classpath xalan-j2) xalan.jar
 ln -sf $(build-classpath xml-commons-apis) xmlParserAPIs.jar
+ln -sf $(build-classpath jaxen) jaxen.jar
+ln -sf $(build-classpath jarjar) jarjar-1.0.jar
 popd
 mkdir lib2
 pushd lib2
-ln -sf $(build-classpath tagsoup) tagsoup-1.0rc1.jar
+ln -sf $(build-classpath tagsoup) tagsoup-1.2.jar
 ln -sf $(build-classpath xml-commons-resolver) resolver.jar
 
 %if %{with_dom4j}
@@ -140,64 +128,59 @@ ln -sf $(build-classpath dom4j) dom4j.jar
 ln -sf $(build-classpath servlet) servlet.jar
 popd
 
-ant jar samples betterdoc
+ant -v compile15 jar samples betterdoc maven2
 
-# Fix encoding
-sed -i 's/\r//g' LICENSE.txt
-pushd apidocs
+pushd build/apidocs
 for f in `find -name \*.css -o -name \*.html`; do
   sed -i 's/\r//g' $f
 done
 popd
 
+mv build/maven2/project.xml build/maven2/pom.xml
+%pom_add_dep jaxen:jaxen build/maven2/pom.xml
+
 %install
 # jars
-install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
-
+install -d -m 755 %{buildroot}%{_javadir}
 install -m 644 build/%{name}-%{version}.jar \
-  $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
-(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
+  %{buildroot}%{_javadir}/%{name}.jar
 
 # javadoc
-install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
-cp -pr apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
-ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
+install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
+cp -pr build/apidocs/* %{buildroot}%{_javadocdir}/%{name}
 
 # demo
-install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}
-install -m 644 build/xom-samples.jar $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}
+install -d -m 755 %{buildroot}%{_datadir}/%{name}
+install -m 644 build/xom-samples.jar %{buildroot}%{_datadir}/%{name}
 
 # POM
-install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
-install -m 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom
+install -d -m 755 %{buildroot}%{_mavenpomdir}
+install -m 644 build/maven2/pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
 %add_maven_depmap JPP-%{name}.pom %{name}.jar
 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
 %files
-%defattr(0644,root,root,0755)
-%doc overview.html
 %doc README.txt
 %doc LICENSE.txt
 %doc Todo.txt
 %doc lgpl.txt
-%doc %{name}.graffle
 %{_javadir}/%{name}.jar
-%{_javadir}/%{name}-%{version}.jar
 %{_mavenpomdir}/JPP-%{name}.pom
 %{_mavendepmapfragdir}/*
 
 %files javadoc
-%defattr(0644,root,root,0755)
-%{_javadocdir}/*
+%{_javadocdir}/%{name}
+%doc LICENSE.txt
+%doc lgpl.txt
 
 %files demo
-%defattr(0644,root,root,0755)
-%dir %{_datadir}/%{name}-%{version}
-%{_datadir}/%{name}-%{version}/xom-samples.jar
+%dir %{_datadir}/%{name}
+%{_datadir}/%{name}/xom-samples.jar
 
 %changelog
+* Mon Jun 24 2013 Michal Srb <msrb at redhat.com> - 0:1.2.10-1
+- Update to latest upstream version 1.2.10
+- Spec file clean up
+
 * Fri Feb 15 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0:1.0-12
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 


More information about the scm-commits mailing list