From 2d2cff3a95d993dd9a6e78abac34f0426b23be92 Mon Sep 17 00:00:00 2001 From: Michal Srb Date: Mar 24 2015 07:26:38 +0000 Subject: Update to latest upstream version 1.2.10 - Spec file clean up Signed-off-by: Mikolaj Izdebski --- 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-1.0.pom b/xom-1.0.pom deleted file mode 100644 index 4f3a1d7..0000000 --- a/xom-1.0.pom +++ /dev/null @@ -1,62 +0,0 @@ - - - - - 4.0.0 - xom - xom - xom - 1.0 - http://www.xom.nu - - - - -
elharo@metalab.unc.edu
-
-
-
-
- 2002 - - - XOM Interest Mailing List - http://lists.ibiblio.org/pipermail/xom-interest/ - - - - - LGPL - - - - - elharo - Elliotte Rusty Harold - elharo@metalab.unc.edu - Cafe au Lait - - - - - xerces - xmlParserAPIs - 2.6.2 - - - xerces - xercesImpl - 2.6.2 - - - xalan - xalan - 2.6.0 - - - com.ibm.icu - icu4j - 2.6.1 - - -
\ No newline at end of file diff --git a/xom-Replace-icu4j-with-JDK.patch b/xom-Replace-icu4j-with-JDK.patch deleted file mode 100644 index d15a088..0000000 --- a/xom-Replace-icu4j-with-JDK.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 65729c231d312b791497ef98d941871c1d848c36 Mon Sep 17 00:00:00 2001 -From: Mikolaj Izdebski -Date: Mon, 8 Oct 2012 22:26:01 +0200 -Subject: [PATCH] Replace icu4j with JDK - ---- - src/nu/xom/TextWriter.java | 10 +++++----- - src/nu/xom/tests/CanonicalizerTest.java | 6 +++--- - src/nu/xom/tests/FastTests.java | 1 - - src/nu/xom/tests/XOMTests.java | 2 -- - 4 files changed, 8 insertions(+), 11 deletions(-) - -diff --git a/src/nu/xom/TextWriter.java b/src/nu/xom/TextWriter.java -index 46f8877..6107021 100644 ---- a/src/nu/xom/TextWriter.java -+++ b/src/nu/xom/TextWriter.java -@@ -24,7 +24,7 @@ package nu.xom; - import java.io.IOException; - import java.io.Writer; - --import com.ibm.icu.text.Normalizer; -+import java.text.Normalizer; - - /** - *

-@@ -415,7 +415,7 @@ abstract class TextWriter { - final void writePCDATA(String s) throws IOException { - - if (normalize) { -- s = Normalizer.normalize(s, Normalizer.NFC); -+ s = Normalizer.normalize(s, Normalizer.Form.NFC); - } - int length = s.length(); - for (int i=0; i < length; i++) { -@@ -429,7 +429,7 @@ abstract class TextWriter { - throws IOException { - - if (normalize) { -- s = Normalizer.normalize(s, Normalizer.NFC); -+ s = Normalizer.normalize(s, Normalizer.Form.NFC); - } - int length = s.length(); - for (int i=0; i < length; i++) { -@@ -442,7 +442,7 @@ abstract class TextWriter { - final void writeMarkup(String s) throws IOException { - - if (normalize) { -- s = Normalizer.normalize(s, Normalizer.NFC); -+ s = Normalizer.normalize(s, Normalizer.Form.NFC); - } - int length = s.length(); - for (int i=0; i < length; i++) { -@@ -667,4 +667,4 @@ abstract class TextWriter { - } - - --} -\ No newline at end of file -+} -diff --git a/src/nu/xom/tests/CanonicalizerTest.java b/src/nu/xom/tests/CanonicalizerTest.java -index 9de4d50..e0df901 100644 ---- a/src/nu/xom/tests/CanonicalizerTest.java -+++ b/src/nu/xom/tests/CanonicalizerTest.java -@@ -31,7 +31,7 @@ import java.io.FilenameFilter; - import java.io.IOException; - import java.io.InputStream; - --import com.ibm.icu.text.Normalizer; -+import java.text.Normalizer; - - import nu.xom.Attribute; - import nu.xom.Builder; -@@ -361,7 +361,7 @@ public class CanonicalizerTest extends XOMTestCase { - InputStream in = new ByteArrayInputStream(data); - Document doc = builder.build(in); - String rawResult = doc.getValue(); -- String normalizedResult = Normalizer.normalize(rawResult, Normalizer.NFC); -+ String normalizedResult = Normalizer.normalize(rawResult, Normalizer.Form.NFC); - assertEquals("Parser doesn't use NFC when converting from " + encoding, - normalizedResult, rawResult); - -@@ -390,7 +390,7 @@ public class CanonicalizerTest extends XOMTestCase { - InputStream in = new ByteArrayInputStream(data); - Document doc = builder.build(in); - String rawResult = doc.getValue(); -- String normalizedResult = Normalizer.normalize(rawResult, Normalizer.NFC); -+ String normalizedResult = Normalizer.normalize(rawResult, Normalizer.Form.NFC); - assertEquals("Parser doesn't use NFC when converting from " + encoding, - normalizedResult, rawResult); - -diff --git a/src/nu/xom/tests/FastTests.java b/src/nu/xom/tests/FastTests.java -index a1ae5fe..a8ce239 100644 ---- a/src/nu/xom/tests/FastTests.java -+++ b/src/nu/xom/tests/FastTests.java -@@ -45,7 +45,6 @@ public class FastTests extends TestCase { - - public static Test suite() { - TestSuite result = new TestSuite(); -- result.addTest(new TestSuite(VerifierTest.class)); - result.addTest(new TestSuite(SubclassTest.class)); - result.addTest(new TestSuite(NodeFactoryTest.class)); - result.addTest(new TestSuite(ParentNodeTest.class)); -diff --git a/src/nu/xom/tests/XOMTests.java b/src/nu/xom/tests/XOMTests.java -index 246a31e..b17eea1 100644 ---- a/src/nu/xom/tests/XOMTests.java -+++ b/src/nu/xom/tests/XOMTests.java -@@ -46,7 +46,6 @@ public class XOMTests extends TestCase { - - public static Test suite() { - TestSuite result = new TestSuite(); -- result.addTest(new TestSuite(VerifierTest.class)); - result.addTest(new TestSuite(SubclassTest.class)); - result.addTest(new TestSuite(NodeFactoryTest.class)); - result.addTest(new TestSuite(ParentNodeTest.class)); -@@ -82,7 +81,6 @@ public class XOMTests extends TestCase { - result.addTest(new TestSuite(BaseURITest.class)); - result.addTest(new TestSuite(TextTest.class)); - result.addTest(new TestSuite(XSLTransformTest.class)); -- result.addTest(new TestSuite(EncodingTest.class)); - return result; - } - --- -1.7.11.4 - diff --git a/xom-betterdocclasspath.patch b/xom-betterdocclasspath.patch deleted file mode 100644 index fdc96a5..0000000 --- a/xom-betterdocclasspath.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- build.xml.orig 2007-02-14 17:22:32.000000000 -0500 -+++ build.xml 2007-02-14 17:22:36.000000000 -0500 -@@ -368,7 +368,10 @@ - encoding="UTF-8" - includes="nu/xom/tools/*"> - -- -+ -+ -+ -+ - - - 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 @@ + + + +- + + + + ++ + + + +@@ -107,7 +107,7 @@ + + + +- ++ + + + +@@ -115,7 +115,7 @@ + + + +- ++ + + + +@@ -214,15 +214,15 @@ + + + +- + + +@@ -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/*"> +- +- +- + + + +@@ -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 @@ + +- ++ + + + +@@ -866,14 +862,14 @@ + + + +- ++ + + + +- +- +- +- + + + diff --git a/xom-gjdocissues.patch b/xom-gjdocissues.patch deleted file mode 100644 index 8417f2a..0000000 --- a/xom-gjdocissues.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- build.xml.orig 2007-02-14 16:57:41.000000000 -0500 -+++ build.xml 2007-02-14 16:57:56.000000000 -0500 -@@ -294,7 +294,7 @@ - windowtitle="${Name} ${version} API" - docencoding="UTF-8" - charset="UTF-8" -- link="http://www.junit.org/junit/javadoc/3.8.1" -+ linkoffline="http://www.junit.org/junit/javadoc/3.8.1 org.junit" - doctitle="${Name} ${version}" - bottom="Copyright 2002-${year} <a href='http://www.elharo.com/'>Elliotte Rusty Harold</a> - <br/> <a href='mailto:elharo@metalab.unc.edu?Subject=XOM'>elharo@metalab.unc.edu</a>"> -@@ -346,8 +346,7 @@ - windowtitle="${Name} ${version} API" - docencoding="UTF-8" - charset="UTF-8" -- noqualifier="java.lang:java.io" -- link="http://www.junit.org/junit/javadoc/3.8.1" -+ linkoffline="http://www.junit.org/junit/javadoc/3.8.1 org.junit" - doctitle="${Name} ${version}" - bottom="Copyright 2002-${year} <a href='http://www.elharo.com/'>Elliotte Rusty Harold</a> - <br/> <a href='mailto:elharo@metalab.unc.edu?Subject=XOM'>elharo@metalab.unc.edu</a>"> 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%%%' 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 - 0:1.2.10-1 +- Update to latest upstream version 1.2.10 +- Spec file clean up + * Fri Feb 15 2013 Fedora Release Engineering - 0:1.0-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild