2018-09-04 15:14:20 +00:00
|
|
|
#
|
|
|
|
# spec file for package jericho-html
|
|
|
|
#
|
2024-09-24 09:50:32 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2018-09-04 15:14:20 +00:00
|
|
|
#
|
|
|
|
# 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: jericho-html
|
|
|
|
Version: 3.3
|
|
|
|
Release: 0
|
|
|
|
Summary: Java library allowing analysis and manipulation of parts of an HTML document
|
2024-09-24 09:50:32 +00:00
|
|
|
License: Apache-2.0 AND EPL-1.0 AND LGPL-2.1-only
|
2018-09-04 15:14:20 +00:00
|
|
|
Group: Development/Libraries/Java
|
|
|
|
URL: http://jericho.htmlparser.net/
|
|
|
|
Source: http://downloads.sf.net/jerichohtml/%{name}-%{version}.zip
|
|
|
|
BuildRequires: apache-commons-logging
|
2022-03-21 05:02:04 +00:00
|
|
|
BuildRequires: java-devel >= 1.8
|
2018-09-04 15:14:20 +00:00
|
|
|
BuildRequires: jpackage-utils
|
|
|
|
BuildRequires: junit
|
2022-02-22 19:30:36 +00:00
|
|
|
BuildRequires: reload4j
|
2018-09-04 15:14:20 +00:00
|
|
|
BuildRequires: slf4j
|
|
|
|
BuildRequires: unzip
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description
|
|
|
|
Jericho HTML Parser is a java library allowing analysis and manipulation of
|
|
|
|
parts of an HTML document, including server-side tags, while reproducing
|
|
|
|
verbatim any unrecognized or invalid HTML. It also provides high-level HTML
|
|
|
|
form manipulation functions.
|
|
|
|
|
|
|
|
%package javadoc
|
|
|
|
Summary: Javadoc for %{name}
|
|
|
|
|
|
|
|
%description javadoc
|
|
|
|
This package contains the API documentation for %{name}.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
|
|
|
# Remove prebuild files
|
|
|
|
find \( -name '*.class' -o -name '*.[jw]ar' \) -exec rm -f '{}' +
|
|
|
|
# Convert all source files to unix line ending
|
|
|
|
find \( -name '*.java' -o -name '*.bat' -o -name '*.txt' -o -name '*.jsp' -o -name '*.css' -o -name '*.xml' \) -exec sed -i 's/\r//' '{}' +
|
|
|
|
# Fix non ASCII chars
|
|
|
|
for f in \
|
|
|
|
src/java/net/htmlparser/jericho/Renderer.java \
|
|
|
|
src/java/net/htmlparser/jericho/StreamEncodingDetector.java
|
|
|
|
do
|
|
|
|
iconv -f ISO-8859-1 -t UTF-8 "$f" > "$f.utf8"
|
|
|
|
mv -v "$f.utf8" "$f"
|
|
|
|
done
|
|
|
|
|
|
|
|
%build
|
2022-02-22 19:30:36 +00:00
|
|
|
export CLASSPATH=$(build-classpath slf4j/api commons-logging reload4j)
|
2024-09-29 06:05:57 +00:00
|
|
|
javac -Xlint -g:none -d classes -encoding UTF-8 src/java/net/htmlparser/jericho/*.java src/java/net/htmlparser/jericho/nodoc/*.java
|
|
|
|
jar \
|
2024-09-24 09:50:32 +00:00
|
|
|
%if %{?pkg_vcmp:%pkg_vcmp java-devel >= 17}%{!?pkg_vcmp:0}
|
|
|
|
--date="$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ)" \
|
|
|
|
%endif
|
|
|
|
--create --file=dist/%{name}.jar -C classes .
|
2024-09-29 06:05:57 +00:00
|
|
|
javac -Xlint -g -deprecation -classpath dist/%{name}.jar -d samples/console/classes samples/console/src/*.java
|
2018-09-04 15:14:20 +00:00
|
|
|
|
|
|
|
%install
|
|
|
|
install -Dpm 0644 dist/%{name}.jar %{buildroot}%{_javadir}/%{name}.jar
|
|
|
|
|
|
|
|
%check
|
|
|
|
mkdir -p test/classes
|
|
|
|
export CLASSPATH=classes:samples/console/classes:$(build-classpath junit hamcrest)
|
2024-09-29 06:05:57 +00:00
|
|
|
javac -Xlint -g -d test/classes test/src/*.java test/src/samples/*.java test/src/net/htmlparser/jericho/*.java
|
|
|
|
java -classpath $CLASSPATH:test/classes -Djava.util.logging.config.file=test/logging.properties org.junit.runner.JUnitCore TestSuite
|
2018-09-04 15:14:20 +00:00
|
|
|
|
|
|
|
%files
|
|
|
|
%license licence-epl-1.0.html licence-lgpl-2.1.txt licence.txt
|
|
|
|
%{_javadir}/%{name}.jar
|
|
|
|
|
|
|
|
%files javadoc
|
|
|
|
%doc release.txt project-description.txt
|
|
|
|
%doc docs/
|
|
|
|
|
|
|
|
%changelog
|