From ad8a667703c8d1fd7ac22a7e3727755ae212c15acbf03d98ed1aaeb77907e896 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 12 Nov 2019 17:57:25 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/nekohtml?expand=0&rev=1 --- .gitattributes | 23 ++++++ 0002-Jar-paths.patch | 111 ++++++++++++++++++++++++++++ 0003-Add-OSGi-attributes.patch | 27 +++++++ nekohtml-1.9.22.pom | 45 ++++++++++++ nekohtml-1.9.22.tar.xz | 3 + nekohtml-component-info.xml | 19 +++++ nekohtml-filter.sh | 23 ++++++ nekohtml.changes | 4 + nekohtml.spec | 130 +++++++++++++++++++++++++++++++++ 9 files changed, 385 insertions(+) create mode 100644 .gitattributes create mode 100644 0002-Jar-paths.patch create mode 100644 0003-Add-OSGi-attributes.patch create mode 100644 nekohtml-1.9.22.pom create mode 100644 nekohtml-1.9.22.tar.xz create mode 100644 nekohtml-component-info.xml create mode 100644 nekohtml-filter.sh create mode 100644 nekohtml.changes create mode 100644 nekohtml.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/0002-Jar-paths.patch b/0002-Jar-paths.patch new file mode 100644 index 0000000..9895ec0 --- /dev/null +++ b/0002-Jar-paths.patch @@ -0,0 +1,111 @@ +From 03b255b50250861a630cd72cb3fae30c7f0f5987 Mon Sep 17 00:00:00 2001 +From: Michael Simacek +Date: Tue, 14 Jul 2015 11:20:59 +0200 +Subject: [PATCH 2/3] Jar paths + +--- + build.xml | 20 +++++++++++--------- + 1 file changed, 11 insertions(+), 9 deletions(-) + +diff --git a/build.xml b/build.xml +index d36f42b..1f00059 100644 +--- a/build.xml ++++ b/build.xml +@@ -54,7 +54,7 @@ + + + +- ++ + + + +@@ -83,7 +83,7 @@ + source='${compile.source}' target='${compile.target}' + includeAntRuntime='false'> + +- ++ + + + +@@ -94,7 +94,7 @@ + source='${compile.source}' target='${compile.target}' + includeAntRuntime='false'> + +- ++ + + + +@@ -108,12 +108,14 @@ + unless="compile.skip"> + + ++ + + + +@@ -236,7 +238,7 @@ public class Version { + + + +- ++ + + + +@@ -277,7 +279,7 @@ public class Version { + source='${compile.source}' target='${compile.target}' + includeAntRuntime='true'> + +- ++ + + + +@@ -298,8 +300,8 @@ public class Version { + + + +- +- ++ ++ + + + +@@ -318,13 +320,13 @@ public class Version { + + + ++ +@@ -397,7 +399,7 @@ public class Version { + + + +- ++ + + +-- +2.1.0 + diff --git a/0003-Add-OSGi-attributes.patch b/0003-Add-OSGi-attributes.patch new file mode 100644 index 0000000..7fe8045 --- /dev/null +++ b/0003-Add-OSGi-attributes.patch @@ -0,0 +1,27 @@ +From 1cbc54dc98b762c4ba3b1daffc2cf5a1116732ef Mon Sep 17 00:00:00 2001 +From: Michael Simacek +Date: Tue, 14 Jul 2015 11:21:21 +0200 +Subject: [PATCH 3/3] Add OSGi attributes + +--- + build.xml | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/build.xml b/build.xml +index 1f00059..194b0bf 100644 +--- a/build.xml ++++ b/build.xml +@@ -129,6 +129,10 @@ + + + ++ ++ ++ ++ +
+ + +-- +2.1.0 + diff --git a/nekohtml-1.9.22.pom b/nekohtml-1.9.22.pom new file mode 100644 index 0000000..6538693 --- /dev/null +++ b/nekohtml-1.9.22.pom @@ -0,0 +1,45 @@ + + 4.0.0 + net.sourceforge.nekohtml + nekohtml + Neko HTML + An HTML parser and tag balancer. + 1.9.22 + http://nekohtml.sourceforge.net/ + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + http://nekohtml.svn.sourceforge.net/viewvc/nekohtml/ + + + + xerces + xercesImpl + 2.11.0 + + + + + Andy Clark + + + Marc Guillemot + mguillem + mguillem@users.sourceforge.net + http://mguillem.wordpress.com/ + +1 + + + + + nexus-releases + Nexus Release Repository + http://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + diff --git a/nekohtml-1.9.22.tar.xz b/nekohtml-1.9.22.tar.xz new file mode 100644 index 0000000..99171b2 --- /dev/null +++ b/nekohtml-1.9.22.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e4e704d801d38d1407b415d3ed0a75e5b4f5f676e1e17c1e1248b226de9507f +size 129868 diff --git a/nekohtml-component-info.xml b/nekohtml-component-info.xml new file mode 100644 index 0000000..ac63512 --- /dev/null +++ b/nekohtml-component-info.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + diff --git a/nekohtml-filter.sh b/nekohtml-filter.sh new file mode 100644 index 0000000..fca3b53 --- /dev/null +++ b/nekohtml-filter.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# +# nekohtml filter script +# JPackage Project + +# Source functions library +if [ -f /usr/share/java-utils/java-functions ] ; then + . /usr/share/java-utils/java-functions +else + echo "Can't find functions library, aborting" + exit 1 +fi + +# Configuration +MAIN_CLASS=org.cyberneko.html.filters.Writer +BASE_JARS="nekohtml xerces-j2" + +# Set parameters +set_jvm +set_classpath $BASE_JARS + +# Let's start +run "$@" diff --git a/nekohtml.changes b/nekohtml.changes new file mode 100644 index 0000000..e2e71ae --- /dev/null +++ b/nekohtml.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Tue Nov 12 17:56:43 UTC 2019 - Fridrich Strba + +- Initial packaging of nekohtml 1.9.22 diff --git a/nekohtml.spec b/nekohtml.spec new file mode 100644 index 0000000..fc339b8 --- /dev/null +++ b/nekohtml.spec @@ -0,0 +1,130 @@ +# +# spec file for package nekohtml +# +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2000-2009, JPackage Project +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: nekohtml +Version: 1.9.22 +Release: 0 +Summary: HTML scanner and tag balancer +License: Apache-2.0 +Group: Development/Libraries/Java +URL: http://nekohtml.sourceforge.net/ +# No upstream tarball for this release +# svn export svn://svn.code.sf.net/p/nekohtml/code/branches/nekohtml-1.9.22 nekohtml-1.9.22 +# find nekohtml-1.9.22 -name '*.jar' -delete +# tar cJf nekohtml-1.9.22.tar.xz nekohtml-1.9.22/ +Source0: %{name}-%{version}.tar.xz +Source2: nekohtml-component-info.xml +Source3: http://central.maven.org/maven2/net/sourceforge/%{name}/%{name}/%{version}/%{name}-%{version}.pom +Patch1: 0002-Jar-paths.patch +# Add proper attributes to MANIFEST.MF file so bundle can be used by other OSGI bundles. +Patch2: 0003-Add-OSGi-attributes.patch +BuildRequires: ant +BuildRequires: ant-junit +BuildRequires: bcel +BuildRequires: fdupes +BuildRequires: javapackages-local +BuildRequires: xerces-j2 >= 2.7.1 +BuildRequires: xml-apis +BuildRequires: xmvn-install +BuildRequires: xmvn-resolve +Requires: bcel +Requires: xerces-j2 >= 2.7.1 +Requires: xml-apis +BuildArch: noarch + +%description +NekoHTML is a simple HTML scanner and tag balancer that enables +application programmers to parse HTML documents and access the +information using standard XML interfaces. The parser can scan HTML +files and "fix up" many common mistakes that human (and computer) +authors make in writing HTML documents. NekoHTML adds missing parent +elements; automatically closes elements with optional end tags; and +can handle mismatched inline element tags. +NekoHTML is written using the Xerces Native Interface (XNI) that is +the foundation of the Xerces2 implementation. This enables you to use +the NekoHTML parser with existing XNI tools without modification or +rewriting code. + +%package javadoc +Summary: Javadoc for %{name} +Group: Documentation/HTML + +%description javadoc +Javadoc for %{name}. + +%package demo +Summary: Demo for %{name} +Group: Development/Libraries/Java +Requires: %{name} = %{version}-%{release} + +%description demo +Demonstrations and samples for %{name}. + +%prep +%setup -q +%patch1 -p1 +%patch2 -p1 + +find -name "*.jar" -delete +sed -i 's/\r$//g' *.txt doc/*.html + +# cannonization test fails on some whitespace, TODO investigate +rm data/meta/test-meta-encoding3.html + +%{mvn_alias} net.sourceforge.%{name}:%{name} %{name}:%{name} +%{mvn_package} net.sourceforge.%{name}:%{name}-samples demo +%{mvn_file} ':{*}' @1 + +%build +export CLASSPATH=$(build-classpath bcel xerces-j2 xml-apis) +%{ant} \ + -Dcompile.source=1.6 -Dcompile.target=1.6 \ + -Dbuild.sysclasspath=first \ + -Dlib.dir=%{_javadir} \ + -Djar.file=%{name}.jar \ + -Djar.xni.file=%{name}-xni.jar \ + -Djar.samples.file=%{name}-samples.jar \ + -Dbcel.javadoc=%{_javadocdir}/bcel \ + -Dj2se.javadoc=%{_javadocdir}/java \ + -Dxni.javadoc=%{_javadocdir}/xerces-j2-xni \ + -Dxerces.javadoc=%{_javadocdir}/xerces-j2-impl \ + clean jar jar-xni doc +# test - disabled because it makes the build failing + +%{mvn_artifact} %{SOURCE3} %{name}.jar +%{mvn_artifact} net.sourceforge.%{name}:%{name}-xni:%{version} %{name}-xni.jar +%{mvn_artifact} net.sourceforge.%{name}:%{name}-samples:%{version} %{name}-samples.jar + +%install +%mvn_install -J build/doc/javadoc +%fdupes -s %{buildroot}%{_javadocdir} + +# Scripts +%jpackage_script org.cyberneko.html.filters.Writer "" "" "nekohtml:xerces-j2" nekohtml-filter true + +%files -f .mfiles +%license LICENSE.txt +%doc README.txt doc/*.html +%{_bindir}/%{name}-filter + +%files javadoc -f .mfiles-javadoc + +%files demo -f .mfiles-demo + +%changelog