diff --git a/CVE-2021-33813.patch b/CVE-2021-33813.patch
new file mode 100644
index 0000000..3137948
--- /dev/null
+++ b/CVE-2021-33813.patch
@@ -0,0 +1,42 @@
+--- libjdom1-java-1.1.3.orig/src/java/org/jdom/input/SAXBuilder.java
++++ libjdom1-java-1.1.3/src/java/org/jdom/input/SAXBuilder.java
+@@ -442,6 +442,11 @@ public class SAXBuilder {
+ public void setFeature(String name, boolean value) {
+ // Save the specified feature for later.
+ features.put(name, value ? Boolean.TRUE : Boolean.FALSE);
++ if (name.equals("http://xml.org/sax/features/external-general-entities")) {
++ // See issue https://github.com/hunterhacker/jdom/issues/189
++ // And PR https://github.com/hunterhacker/jdom/pull/188
++ setExpandEntities(value);
++ }
+ }
+
+ /**
+@@ -766,13 +771,6 @@ public class SAXBuilder {
+ internalSetFeature(parser, name, value.booleanValue(), name);
+ }
+
+- // Set any user-specified properties on the parser.
+- iter = properties.keySet().iterator();
+- while (iter.hasNext()) {
+- String name = (String)iter.next();
+- internalSetProperty(parser, name, properties.get(name), name);
+- }
+-
+ if (coreFeatures) {
+ // Set validation.
+ try {
+@@ -810,6 +808,13 @@ public class SAXBuilder {
+ }
+ catch (SAXNotRecognizedException e) { /* Ignore... */ }
+ catch (SAXNotSupportedException e) { /* Ignore... */ }
++
++ // Set any user-specified properties on the parser.
++ iter = properties.keySet().iterator();
++ while (iter.hasNext()) {
++ String name = (String)iter.next();
++ internalSetProperty(parser, name, properties.get(name), name);
++ }
+ }
+
+ /**
diff --git a/check-build.sh b/check-build.sh
deleted file mode 100644
index 2deaf2b..0000000
--- a/check-build.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-if [ `ulimit -v` -le 2500000 ] ; then
- echo "build does not work on `hostname`: not enough memory"
- exit 1
-fi
-
diff --git a/dom4j-1.6.1-debian.tar.bz2 b/dom4j-1.6.1-debian.tar.bz2
deleted file mode 100644
index 935f0ae..0000000
--- a/dom4j-1.6.1-debian.tar.bz2
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d72427a11a23df97f8957331269df7fde4fcc982ac3b9d399a49e4df8598b94a
-size 1962425
diff --git a/jaxen-1.1.6.pom b/jaxen-1.1.6.pom
deleted file mode 100644
index 9f16fdc..0000000
--- a/jaxen-1.1.6.pom
+++ /dev/null
@@ -1,441 +0,0 @@
-
-
- 4.0.0
-
-
- oss-parent
- org.sonatype.oss
- 7
-
-
- jaxen
- jaxen
- bundle
- jaxen
- 1.1.6
- Jaxen is a universal Java XPath engine.
- http://jaxen.codehaus.org/
-
-
- http://jaxen.codehaus.org/license.html
-
-
-
- JIRA
- http://jira.codehaus.org/BrowseProject.jspa?id=10022
-
-
-
-
-
- dev@jaxen.codehaus.org
-
-
-
-
- 2001
-
-
- UTF-8
- UTF-8
-
-
-
-
- Jaxen Users List
- user-subscribe@jaxen.codehaus.org
- user-unsubscribe@jaxen.codehaus.org
- http://archive.jaxen.codehaus.org/user/
-
-
- Jaxen Developers List
- dev-subscribe@jaxen.codehaus.org
- dev-unsubscribe@jaxen.codehaus.org
- http://archive.jaxen.codehaus.org/dev/
-
-
- Jaxen Commits List
- scm-subscribe@jaxen.codehaus.org
- scm-unsubscribe@jaxen.codehaus.org
- http://archive.jaxen.codehaus.org/scm/
-
-
-
-
-
- bob
- Bob McWhirter
- bob@eng.werken.com
- The Werken Company
-
-
- jstrachan
- James Strachan
- james_strachan@yahoo.co.uk
- Spiritsoft
-
-
- dmegginson
- David Megginson
- contact@megginson.com
- Megginson Technologies
-
-
- eboldwidt
- Erwin Bolwidt
- erwin@klomp.org
-
-
- mbelonga
- Mark A. Belonga
- mbelonga@users.sourceforge.net
-
-
- cnentwich
- Christian Nentwich
- xcut@users.sourceforge.net
-
-
- purpletech
- Alexander Day Chaffee
- purpletech@users.sourceforge.net
- Purple Technologies
-
-
- jdvorak
- Jan Dvorak
- jdvorak@users.sourceforge.net
-
-
- szegedia
- Attila Szegedi
- szegedia@users.sourceforge.net
-
-
- proyal
- Peter Royal
- peter.royal@pobox.com
- http://fotap.org/~osi
-
-
- ssanders
- Scott Sanders
- scott@dotnot.org
- http://dotnot.org/blog
- dotnot
-
-
- bewins
- Brian Ewins
- brian.ewins@gmail.com
-
-
- elharo
- Elliotte Rusty Harold
- elharo@ibiblio.org
- http://www.elharo.com/
- Cafe au Lait
-
-
-
-
-
- Ryan Gustafson
- rgustav@users.sourceforge.net
-
-
- David Peterson
- david@randombits.org
-
-
- Mark Wilson
- mark.wilson@wilsoncom.de
-
-
- Jacob Kjome
- hoju@visi.com
-
-
- Michael Brennan
- mpbrennan@earthlink.net
-
-
- Jason Hunter
- jhunter@xquery.com
-
-
- Brett Mclaughlin
- brett.mclaughlin@lutris.com
-
-
- Bradley S. Huffman
- hip@cs.okstate.edu
-
-
- K. Ari Krupnikov
- ari@lib.aero
-
-
- Paul R. Brown
- prb@fivesight.com
-
-
- Guoliang Cao
- cao@ispsoft.com
-
-
- Jérôme Nègre
- jerome.negre@e-xmlmedia.fr
-
-
- Eddie McGreal
- emcgreal@BlackPearl.com
-
-
- Steen Lehmann
- slehmann@users.sourceforge.net
-
-
- Ben McCann
- benjamin.j.mccann@gmail.com
-
-
- Don Corley
- don@donandann.com
-
-
-
-
- scm:svn:https://svn.codehaus.org/jaxen/trunk/jaxen/
- http://fisheye.codehaus.org/browse/jaxen/
-
-
-
- Codehaus
- http://codehaus.org
-
-
-
- src/java/main
- src/java/test
-
-
- maven-compiler-plugin
- 2.5.1
-
- true
- true
- true
-
- 1.2
-
-
-
-
- org.apache.felix
- maven-bundle-plugin
- 2.3.7
- true
-
-
- 2
- ${project.artifactId}
- ${project.version}
- org.jaxen.*;version=${project.version}
-
- org/w3c/dom/UserDataHandler.class=target/classes/org/w3c/dom/UserDataHandler.class,
- META-INF/LICENSE.txt=LICENSE.txt
-
-
- org.w3c.dom;resolution:=optional,
- *;resolution:=optional
-
- !org.w3c.dom
-
-
-
-
- org.apache.maven.plugins
- maven-assembly-plugin
- 2.4
-
-
- package
-
- single
-
-
-
-
-
- project
- src
- bin
-
-
-
-
- maven-repository-plugin
- 2.3.1
-
-
- maven-javadoc-plugin
- 2.8.1
-
- org.jaxen.saxpath.base,org.jaxen.saxpath.helpers
-
- http://java.sun.com/j2se/1.4.2/docs/api/
-
- ${basedir}/src/site/resources/css/javadoc-style.css
- UTF-8
- ./xdocs/stylesheets/javadoc-style.css
-
-
- To Do:
- todo
- Xa
-
-
- UTF-8
-
-
-
- maven-surefire-plugin
- 2.12
-
-
- **/*Test.java
-
-
-
-
- org.codehaus.mojo
- cobertura-maven-plugin
- 2.5.1
-
-
- org.codehaus.mojo
- findbugs-maven-plugin
- 2.4.0
-
-
-
-
-
-
- dom4j
- dom4j
- 1.6.1
- true
-
-
- jdom
- jdom
- 1.0
- true
-
-
- xml-apis
- xml-apis
- 1.3.02
- provided
-
-
- xerces
- xercesImpl
- 2.6.2
- provided
-
-
- xom
- xom
- 1.0
- true
-
-
- junit
- junit
- 3.8.2
- test
-
-
-
-
-
-
- maven-changelog-plugin
- 2.2
-
- date
-
- 2007-05-06
-
- UTF-8
-
-
-
- maven-checkstyle-plugin
- 2.9.1
-
-
- maven-javadoc-plugin
- 2.6.1
-
-
- org.apache.maven.plugins
- maven-jxr-plugin
- 2.1
-
-
- org.apache.maven.plugins
- maven-pmd-plugin
- 2.4
-
-
- org.apache.maven.plugins
- maven-surefire-report-plugin
- 2.4.3
-
-
- org.codehaus.mojo
- cobertura-maven-plugin
- 2.5.1
-
-
- org.codehaus.mojo
- findbugs-maven-plugin
- 2.4.0
-
-
- org.codehaus.mojo
- jdepend-maven-plugin
- 2.0-beta-2
-
-
- org.apache.maven.plugins
- maven-project-info-reports-plugin
- 2.4
-
- false
- false
-
-
-
-
- dependencies
- scm
-
-
-
-
-
-
-
-
-
- default
- Default Site
- scp://jaxen.codehaus.org/home/projects/jaxen/public_html
-
-
-
diff --git a/jaxen-1.1.6.tar.gz b/jaxen-1.1.6.tar.gz
deleted file mode 100644
index 9af9a53..0000000
--- a/jaxen-1.1.6.tar.gz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:59b4667ddc5e02ec4b930007ba42a1356bbcb9b4c5bb67023cc1cc5f70fe0ca3
-size 292815
diff --git a/jdom-1.1-OSGiManifest.patch b/jdom-1.1-OSGiManifest.patch
index 1abd449..a898083 100644
--- a/jdom-1.1-OSGiManifest.patch
+++ b/jdom-1.1-OSGiManifest.patch
@@ -1,21 +1,18 @@
---- jdom/package/META-INF/MANIFEST.MF.osgimanifest 2008-07-21 16:00:59.000000000 -0400
-+++ jdom/package/META-INF/MANIFEST.MF 2008-07-21 16:02:20.000000000 -0400
-@@ -1,4 +1,19 @@
+--- ./package/META-INF/MANIFEST.MF 2008-07-21 16:00:59.000000000 -0400
++++ ./package/META-INF/MANIFEST.MF 2008-07-21 16:02:20.000000000 -0400
+@@ -1,4 +1,16 @@
Manifest-Version: 1.0
+Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-SymbolicName: org.jdom
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-Localization: plugin
-+Bundle-Version: @version.impl@
++Bundle-Version: 1.1.3
+Bundle-Vendor: %Bundle-Vendor.0
-+Export-Package: org.jdom;version="@version.impl@",
-+ org.jdom.adapters;version="@version.impl@",
-+ org.jdom.filter;version="@version.impl@",
-+ org.jdom.input;version="@version.impl@",
-+ org.jdom.output;version="@version.impl@",
-+ org.jdom.transform;version="@version.impl@",
-+ org .jdom.xpath;version="@version.impl@"
++Export-Package: org.jdom;version="1.1.3",org.jdom.adapters;version="1.
++ 1.2",org.jdom.filter;version="1.1.3",org.jdom.input;version="1.1.3",o
++ rg.jdom.output;version="1.1.3",org.jdom.transform;version="1.1.3",org
++ .jdom.xpath;version="1.1.3"
+Require-Bundle: org.apache.xerces;resolution:=optional
Name: org/jdom/
diff --git a/jdom-1.1-build.xml.patch b/jdom-1.1-build.xml.patch
deleted file mode 100644
index 4388bd8..0000000
--- a/jdom-1.1-build.xml.patch
+++ /dev/null
@@ -1,57 +0,0 @@
---- XOM/build.xml
-+++ XOM/build.xml
-@@ -201,8 +201,8 @@
- debug="${debug}"
- optimize="${optimize}"
- deprecation="${deprecation}"
-- target="1.2"
-- source="1.3"
-+ target="1.8"
-+ source="1.8"
- encoding="UTF-8"
- excludes="nu/xom/pantry/* nu/xom/tools/* nu/xom/samples/*Servlet.java">
-
-@@ -228,8 +228,8 @@
- debug="${debug}"
- optimize="${optimize}"
- deprecation="${deprecation}"
-- target="1.2"
-- source="1.3"
-+ target="1.8"
-+ source="1.8"
- encoding="UTF-8">
-
-
-@@ -244,8 +244,8 @@
- debug="${debug}"
- optimize="${optimize}"
- deprecation="${deprecation}"
-- target="1.2"
-- source="1.3"
-+ target="1.8"
-+ source="1.8"
- encoding="UTF-8"
- failonerror="false">
-
-@@ -462,8 +462,8 @@
- debug="${debug}"
- optimize="${optimize}"
- deprecation="${deprecation}"
-- target="1.2"
-- source="1.3"
-+ target="1.8"
-+ source="1.8"
- encoding="UTF-8"
- includes="nu/xom/tools/*">
-
-@@ -705,8 +705,8 @@
- debug="${debug}"
- optimize="${optimize}"
- deprecation="${deprecation}"
-- target="1.2"
-- source="1.3"
-+ target="1.8"
-+ source="1.8"
- encoding="UTF-8"
- includeAntRuntime="no"
- excludes="org/jaxen/dom/**
diff --git a/jdom-1.1-xom-get-jaxen.patch b/jdom-1.1-xom-get-jaxen.patch
deleted file mode 100644
index 0999454..0000000
--- a/jdom-1.1-xom-get-jaxen.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- XOM/build.xml
-+++ XOM/build.xml
-@@ -729,7 +729,9 @@
-
-
-
--
-+
-+
-+
-
-
-
diff --git a/jdom-crosslink.patch b/jdom-crosslink.patch
new file mode 100644
index 0000000..3e4816c
--- /dev/null
+++ b/jdom-crosslink.patch
@@ -0,0 +1,11 @@
+--- build.xml.orig 2010-02-05 12:37:26.594658382 +0000
++++ build.xml 2010-02-05 12:38:09.201658171 +0000
+@@ -277,7 +277,7 @@
+ bottom="Copyright © ${year} Jason Hunter, Brett McLaughlin. All Rights Reserved.">
+
+
+-
++
+
+
+
diff --git a/jdom.changes b/jdom.changes
index 02f45d5..33e2e09 100644
--- a/jdom.changes
+++ b/jdom.changes
@@ -1,3 +1,25 @@
+-------------------------------------------------------------------
+Thu Aug 24 10:16:57 UTC 2023 - Fridrich Strba
+
+- Build only the jdom package and drop xom, jaxen and xom into
+ separate standalone packages
+- Removed patches:
+ * jdom-1.1-build.xml.patch
+ * jdom-1.1-xom-get-jaxen.patch
+ + not needed with the current package
+- Added patches:
+ * CVE-2021-33813.patch
+ + fix CVE-2021-33813: An XXE issue in SAXBuilder in JDOM
+ through 2.0.6 allows attackers to cause a denial of service
+ via a crafted HTTP request.
+ * jdom-crosslink.patch
+ + do not link to javadocs on web
+ * no-jaxen.patch
+ + do not fail to generate javadoc when jaxen is not present
+- Modified patch:
+ * jdom-1.1-OSGiManifest.patch
+ + rediff
+
-------------------------------------------------------------------
Wed Mar 30 09:52:00 UTC 2022 - Fridrich Strba
diff --git a/jdom.spec b/jdom.spec
index cc86020..be321a2 100644
--- a/jdom.spec
+++ b/jdom.spec
@@ -1,7 +1,7 @@
#
# spec file for package jdom
#
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,257 +16,88 @@
#
-%define xom_version 1.2b1
-%define xom_suffix %{nil}
-%define xom_dir %{_builddir}/%{name}-%{jdom_version}/XOM
-%define xom_included_jaxen_archive jaxen-1.1-src.zip
-%define jdom_version 1.1.3
-%define jdom_suffix %{nil}
-%define dom4j_version 1.6.1
-%define dom4j_suffix %{nil}
-%define dom4j_dir %{_builddir}/%{name}-%{jdom_version}/dom4j
-%define saxpath_version 1.0
-%define saxpath_suffix -FCS
-%define saxpath_dir %{_builddir}/%{name}-%{jdom_version}/saxpath-%{saxpath_version}%{saxpath_suffix}
-%define jaxen_version 1.1.6
-%define jaxen_suffix %{nil}
-%define jaxen_dir %{_builddir}/%{name}-%{jdom_version}/jaxen-%{jaxen_version}
-%define jdom_dir %{_builddir}/%{name}-%{jdom_version}/%{name}
-%define stage1_build_dir %{_builddir}/build
Name: jdom
Version: 1.1.3
Release: 0
-Summary: JDOM is a Java Representation of an XML Document
-License: Apache-2.0
-Group: Development/Libraries/Java
-URL: http://www.jdom.org
-Source0: http://jdom.org/dist/binary/archive/%{name}-%{version}.tar.gz
-Source1: saxpath-%{saxpath_version}.tar.bz2
-Source2: xom-%{xom_version}-src.tar.bz2
-# svn co svn://svn.debian.org/svn/pkg-java/trunk/dom4j
-# rm dom4j/docs/xref/org/dom4j/tree/ConcurrentReaderHashMap.html
-# rm dom4j/docs/clover/org/dom4j/tree/ConcurrentReaderHashMap.html
-# #bnc501764
-# rm dom4j/lib/tools/clover.license
-# tar --exclude-vcs -cjf dom4j-1.6.1-debian.tar.bz2 dom4j/
-Source3: dom4j-%{dom4j_version}-debian.tar.bz2
-Source4: jaxen-%{jaxen_version}.tar.gz
-Source10: https://repo1.maven.org/maven2/org/%{name}/%{name}/%{jdom_version}%{jdom_suffix}/%{name}-%{jdom_version}%{jdom_suffix}.pom
-Source11: https://repo1.maven.org/maven2/saxpath/saxpath/%{saxpath_version}%{saxpath_suffix}/saxpath-%{saxpath_version}%{saxpath_suffix}.pom
-Source12: https://repo1.maven.org/maven2/xom/xom/1.2.5/xom-1.2.5.pom
-Source13: https://repo1.maven.org/maven2/jaxen/jaxen/%{jaxen_version}%{jaxen_suffix}/jaxen-%{jaxen_version}%{jaxen_suffix}.pom
-Patch0: jdom-1.1-build.xml.patch
-Patch1: jdom-1.1-OSGiManifest.patch
-Patch2: jdom-1.1-xom-get-jaxen.patch
+Summary: Java alternative to DOM and SAX
+License: Saxpath
+URL: http://www.jdom.org/
+Source0: http://jdom.org/dist/binary/archive/jdom-%{version}.tar.gz
+Source1: https://repo1.maven.org/maven2/org/jdom/jdom/%{version}/jdom-%{version}.pom
+Patch0: %{name}-crosslink.patch
+Patch1: %{name}-1.1-OSGiManifest.patch
+Patch2: no-jaxen.patch
+Patch10: CVE-2021-33813.patch
BuildRequires: ant
-BuildRequires: ant-junit
-BuildRequires: glassfish-jaxb-api
+BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
-BuildRequires: javapackages-local
-BuildRequires: junit
-BuildRequires: relaxngDatatype
-BuildRequires: servletapi5
-BuildRequires: unzip
-BuildRequires: xalan-j2
-BuildRequires: xerces-j2
-BuildRequires: xpp2
-BuildRequires: xpp3
-Requires: mvn(jaxen:jaxen)
-Requires: mvn(xerces:xercesImpl)
+BuildRequires: javapackages-local >= 6
BuildArch: noarch
%description
JDOM is, quite simply, a Java representation of an XML document. JDOM
provides a way to represent that document for easy and efficient
-reading, manipulation, and writing. It has a straightforward API, is
-lightweight and fast, and is optimized for the Java programmer. It is
-an alternative to DOM and SAX, although it integrates well with both
-DOM and SAX.
+reading, manipulation, and writing. It has a straightforward API, is a
+lightweight and fast, and is optimized for the Java programmer. It's an
+alternative to DOM and SAX, although it integrates well with both DOM
+and SAX.
-%package -n saxpath
-Version: 1.0_FCS
-Release: 0
-Summary: SAXPath is an event-based API for XPath parsers
-License: Apache-2.0
-Group: Development/Libraries/Java
+%package javadoc
+Summary: Javadoc for %{name}
-%description -n saxpath
-SAXPath is an event-based API for XPath parsers, that is, for parsers
-which parse XPath expressions. SAXPath is intended to be for XPath
-what SAX is for XML. Note that the SAXPath package only parses XPath
-expressions; it does not evaluate them, or even provide an object
-structure for representing them once they have been parsed.
+%description javadoc
+Javadoc for %{name}.
-%package -n xom
-Version: 1.2b1
-Release: 0
-Summary: XOM is a new XML object model
-License: LGPL-2.1-or-later
-Group: Development/Languages/Java
-Requires: mvn(xalan:xalan)
-Requires: mvn(xerces:xercesImpl)
-Requires: mvn(xml-apis:xml-apis)
+%package demo
+Summary: Demos for %{name}
+Requires: %{name} = %{version}-%{release}
-%description -n xom
-XOM is designed to be easy to learn and easy to use. It works very
-straight-forwardly, and has a very shallow learning curve. Assuming
-you're already familiar with XML, you should be able to get up and
-running with XOM very quickly.
-
-XOM is the only XML API that makes no compromises on correctness. XOM
-only accepts namespace well-formed XML documents, and only allows you
-to create namespace well-formed XML documents. (In fact, it's a little
-stricter than that: it actually guarantees that all documents are
-round-trippable and have well-defined XML infosets.) XOM manages your
-XML so you don't have to. With XOM, you can focus on the unique value
-of your application, and trust XOM to get the XML right.
-
-XOM is fairly unique in that it is a dual streaming/tree-based API.
-Individual nodes in the tree can be processed while the document is
-still being built. The enables XOM programs to operate almost as fast
-as the underlying parser can supply data. You don't need to wait for
-the document to be completely parsed before you can start working with
-it.
-
-XOM is very memory efficient. If you read an entire document into
-memory, XOM uses as little memory as possible. More importantly, XOM
-allows you to filter documents as they're built so you don't have to
-build the parts of the tree you aren't interested in. For instance, you
-can skip building text nodes that only represent boundary white space,
-if such white space is not significant in your application. You can
-even process a document piece by piece and throw away each piece when
-you're done with it. XOM has been used to process documents that are
-gigabytes in size.
-
-XOM includes built-in support for a number of XML technologies
-including Namespaces in XML, XPath, XSLT, XInclude, xml:id, and
-Canonical XML. XOM documents can be converted to and from SAX and DOM.
-
-%package -n jaxen
-Version: 1.1.6
-Release: 0
-Summary: The jaxen project is a Java XPath Engine
-License: Apache-2.0
-Group: Development/Libraries/Java
-Requires: mvn(dom4j:dom4j)
-Requires: mvn(jdom:jdom)
-Requires: mvn(xerces:xercesImpl)
-Requires: mvn(xml-apis:xml-apis)
-Requires: mvn(xom:xom)
-Provides: jaxen-bootstrap = %{version}
-Obsoletes: jaxen-bootstrap < %{version}
-
-%description -n jaxen
-Jaxen is a universal object model walker, capable of evaluating XPath
-expressions across multiple models. Currently supported are dom4j,
-JDOM, and DOM.
+%description demo
+Demonstrations and samples for %{name}.
%prep
-%setup -q -c foo -a 1 -a 2 -a 3 -a 4
-rm %{xom_dir}/%{xom_included_jaxen_archive}
-mkdir %{stage1_build_dir}
-# delete all inlcuded jar files:
-find . -name "*.jar" -delete -name "*.class" -delete
+%setup -q -n %{name}
%patch0
%patch1
-%patch2
-cp %{SOURCE10} %{name}-%{jdom_version}.pom
-cp %{SOURCE11} saxpath-%{saxpath_version}.pom
-cp %{SOURCE12} xom-%{xom_version}.pom
-cp %{SOURCE13} jaxen-%{jaxen_version}.pom
-
-%pom_xpath_set pom:project/pom:version "%{xom_version}%{xom_suffix}" xom-%{xom_version}.pom
-%pom_remove_parent jaxen-%{jaxen_version}.pom
+%patch2 -p1
+%patch10 -p1
+# remove all binary libs
+find . -name "*.jar" -exec rm -f {} \;
+find . -name "*.class" -exec rm -f {} \;
%build
-export JAVA_OPTS="-source 1.8 -target 1.8 -encoding UTF-8 -J-Xss6m"
-export JAVAC="javac ${JAVA_OPTS} "
-export ANT_OPTS="-Xss6m"
-i=0
-CLASSPATH="%{stage1_build_dir}:$(build-classpath \
- glassfish-jaxb-api \
- xerces-j2 xalan-j2 xalan-j2-serializer junit relaxngDatatype servletapi5 xpp2 xpp3)"
-SOURCE_DIRS="%{jaxen_dir}/src/java/main/ %{jdom_dir}/src/java/ %{saxpath_dir}/src/java/main/ %{xom_dir}/src/ %{dom4j_dir}/src/java"
-SOURCE_PATH=$(echo ${SOURCE_DIRS} | sed 's#\ #:#g')
-# Failing files
-rm -f \
- XOM/src/nu/xom/tools/XHTMLJavaDoc.java \
- dom4j/src/java/org/dom4j/datatype/SchemaParser.java \
- dom4j/src/java/org/dom4j/datatype/DatatypeAttribute.java \
- dom4j/src/java/org/dom4j/datatype/DatatypeElement.java \
- dom4j/src/java/org/dom4j/datatype/NamedTypeResolver.java \
- dom4j/src/java/org/dom4j/datatype/DatatypeDocumentFactory.java \
- dom4j/src/java/org/dom4j/datatype/DatatypeElementFactory.java \
- dom4j/src/java/org/jaxen/dom4j/DocumentNavigator.java \
- dom4j/src/java/org/jaxen/dom4j/Dom4jXPath.java
-${JAVAC} -classpath ${CLASSPATH} -sourcepath ${SOURCE_PATH} -d %{stage1_build_dir} $(find ${SOURCE_DIRS} -name "*.java" | xargs)
-unset CLASSPATH SOURCE_DIRS SOURCE_PATH
-jar cf %{jdom_dir}/jaxen.jar -C %{stage1_build_dir} .
-
-pushd %{jdom_dir}
-ant -Dparser.jar=$(build-classpath xerces-j2) \
- -Dxml-apis.jar=$(build-classpath xml-commons-apis) \
- -Djaxen.lib.dir=%{jdom_dir} \
- -Dcompile.source=1.8 -Dcompile.target=1.8 \
- -Dversion=%{jdom_version} \
- package
-mv build/jdom-%{jdom_version}.jar %{_builddir}/jdom-%{jdom_version}.jar
-rm jaxen.jar
-popd
-pushd %{jaxen_dir}/src/java/main
-mkdir build
-#mkdir %{_builddir}/jaxen-excluded
-#mv org/jaxen/dom4j %{_builddir}/jaxen-excluded
-${JAVAC} -classpath %{_builddir}/jdom-%{jdom_version}.jar:%{stage1_build_dir} -d build/ $(find . -name "*.java" | xargs)
-jar -cf %{_builddir}/jaxen-%{jaxen_version}.jar -C build .
-popd
-pushd %{saxpath_dir}
-mkdir src/conf
-touch src/conf/MANIFEST.MF
-CLASSPATH=%{_builddir}/jaxen-%{jaxen_version}.jar:%{_builddir}/jdom-%{jdom_version}.jar:%{stage1_build_dir} ant package
-mv build/saxpath.jar %{_builddir}/saxpath-%{saxpath_version}.jar
-popd
-pushd %{xom_dir}
-%{ant} \
--Djaxen.dir=%{stage1_build_dir} \
--Dxml-apis.jar=$(build-classpath xml-commons-apis) \
--Dparser.jar=$(build-classpath xerces-j2) \
--Dxslt.jar=$(build-classpath xalan-j2) \
--Dserializer.jar=$(build-classpath xalan-j2-serializer) \
--Djunit.jar=$(build-classpath junit) \
--Dresolver.jar=$(build-classpath xml-commons-resolver) \
--Ddom4j.jar=%{stage1_build_dir} \
--Dant.build.javac.source=1.8 -Dant.build.javac.target=1.8 \
-compile compile15 jar
-mv build/xom-%{xom_version}.jar %{_builddir}
-popd
-#<<< build
+%{ant} -Dcompile.source=1.8 -Dcompile.target=1.8 -Dj2se.apidoc=%{_javadocdir}/java package javadoc-link
%install
-mkdir -p %{buildroot}/%{_javadir}
-mv %{_builddir}/*.jar %{buildroot}/%{_javadir}
-ln -sf %{_javadir}/jdom-%{jdom_version}.jar %{buildroot}/%{_javadir}/jdom.jar
-ln -sf %{_javadir}/jaxen-%{jaxen_version}.jar %{buildroot}/%{_javadir}/jaxen.jar
-ln -sf %{_javadir}/saxpath-%{saxpath_version}.jar %{buildroot}/%{_javadir}/saxpath.jar
-ln -sf %{_javadir}/xom-%{xom_version}.jar %{buildroot}/%{_javadir}/xom.jar
+# jar
+install -dm 0755 %{buildroot}%{_javadir}
+install -pm 0644 build/%{name}-*-snap.jar %{buildroot}%{_javadir}/%{name}.jar
-mkdir -p %{buildroot}/%{_mavenpomdir}
-cp *.pom %{buildroot}/%{_mavenpomdir}/
-%add_maven_depmap jdom-%{jdom_version}.pom jdom-%{jdom_version}.jar -a jdom:jdom
-%add_maven_depmap xom-%{xom_version}.pom xom-%{xom_version}.jar -f xom -a com.io7m.xom:xom
-%add_maven_depmap saxpath-%{saxpath_version}.pom saxpath-%{saxpath_version}.jar -f saxpath
-%add_maven_depmap jaxen-%{jaxen_version}.pom jaxen-%{jaxen_version}.jar -f jaxen
+# pom
+install -dm 0755 %{buildroot}%{_mavenpomdir}
+%{mvn_install_pom} %{SOURCE1} %{buildroot}%{_mavenpomdir}/%{name}.pom
+%add_maven_depmap %{name}.pom %{name}.jar -a jdom:jdom,org.jdom:jdom-legacy
+
+# javadoc
+install -dm 0755 %{buildroot}%{_javadocdir}
+cp -r build/apidocs %{buildroot}%{_javadocdir}/%{name}
+%fdupes -s %{buildroot}%{_javadocdir}
+
+# demo
+install -dm 0755 %{buildroot}%{_datadir}/%{name}
+cp -pr samples %{buildroot}%{_datadir}/%{name}
+%fdupes -s %{buildroot}%{_datadir}/%{name}
%files -f .mfiles
-%{_javadir}/jdom.jar
+%license LICENSE.txt
+%doc CHANGES.txt COMMITTERS.txt README.txt TODO.txt
-%files -n xom -f .mfiles-xom
-%{_javadir}/xom.jar
+%files javadoc
+%{_javadocdir}/%{name}
+%license LICENSE.txt
-%files -n saxpath -f .mfiles-saxpath
-%{_javadir}/saxpath.jar
-
-%files -n jaxen -f .mfiles-jaxen
-%{_javadir}/jaxen.jar
+%files demo
+%{_datadir}/%{name}
+%license LICENSE.txt
%changelog
diff --git a/no-jaxen.patch b/no-jaxen.patch
new file mode 100644
index 0000000..c6bcd71
--- /dev/null
+++ b/no-jaxen.patch
@@ -0,0 +1,11 @@
+diff -urEbwB jdom/build.xml jdom.new/build.xml
+--- jdom/build.xml 2012-02-26 00:30:45.000000000 +0100
++++ jdom.new/build.xml 2023-08-23 19:35:51.544436993 +0200
+@@ -254,6 +255,7 @@
+ use="true"
+ splitindex="true"
+ noindex="false"
++ failonerror="false"
+ windowtitle="${Name} v${version}"
+ doctitle="${Name} v${version}<br>API Specification"
+ header="<b>${Name}<br><font size='-1'>${version}</font></b>"
diff --git a/saxpath-1.0-FCS.pom b/saxpath-1.0-FCS.pom
deleted file mode 100644
index ab79a9d..0000000
--- a/saxpath-1.0-FCS.pom
+++ /dev/null
@@ -1,6 +0,0 @@
-
- 4.0.0
- saxpath
- saxpath
- 1.0-FCS
-
\ No newline at end of file
diff --git a/saxpath-1.0.tar.bz2 b/saxpath-1.0.tar.bz2
deleted file mode 100644
index 60a0275..0000000
--- a/saxpath-1.0.tar.bz2
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:67863cb4111628f382b8f7cd7c628ff4750d23c1a6fce9cee48c091ac5a411c2
-size 2125559
diff --git a/xom-1.2.5.pom b/xom-1.2.5.pom
deleted file mode 100644
index db13110..0000000
--- a/xom-1.2.5.pom
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
- 4.0.0
- jar
- XOM
- 1.2.5
- The XOM Dual Streaming/Tree API for Processing XML
- http://xom.nu
-
-
- The GNU Lesser General Public License, Version 2.1
- http://www.gnu.org/licenses/lgpl-2.1.html
- repo
-
-
-
- https://xom.dev.java.net/source/browse/xom/
-
-
- xom
-
- xom
-
- 2002
-
-
-
- XOM Interest Mailing List
- http://lists.ibiblio.org/pipermail/xom-interest/
-
-
-
-
-
- Elliotte Rusty Harold
- elharo
- elharo@ibiblio.org
- Cafe au Lait
-
-
-
-
-
- xml-apis
- xml-apis
- 1.3.03
- jar
-
-
- xerces
- xercesImpl
- 2.8.0
- jar
-
-
- xalan
- xalan
- 2.7.0
- jar
-
-
-
-
- src
-
-
-
\ No newline at end of file
diff --git a/xom-1.2b1-src.tar.bz2 b/xom-1.2b1-src.tar.bz2
deleted file mode 100644
index 5ca8189..0000000
--- a/xom-1.2b1-src.tar.bz2
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:63e96ced3183a62a6aa5ef6c8bab0106d9931cafe0036905eab8a7904c12dda7
-size 4904084