%define with_gcj 1 %if %with_gcj %define gcj_ver %(gcj --version | head -n1 | awk '{ print $3 }') %define javahome /usr/lib/jvm/jdk-gcj %define javaopt -Wall %else %define javahome /usr/lib/jvm/jdk-sun %define javaopt -Xlint %endif Name: java-jericho-html Version: 3.1 Release: 1mamba Summary: Jericho HTML Parser Group: Development/Libraries/Java Vendor: openmamba Distribution: openmamba Packager: gil URL: http://jericho.htmlparser.net/ Source: http://downloads.sourceforge.net/project/jerichohtml/jericho-html/%{version}/jericho-html-%{version}.zip License: Eclipse Public License 1.0, LGPL %if %with_gcj BuildRequires: java-gcj-compat %else BuildRequires: sun-java %endif BuildRequires: apache-log4j BuildRequires: jakarta-commons-logging BuildRequires: java-junit48 BuildRequires: java-slf4j BuildRequires: jpackage-utils Requires: jpackage-utils BuildRoot: %{_tmppath}/%{name}-%{version}-root %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 unrecognised or invalid HTML. It also provides high-level HTML form manipulation functions. It is an open source library released under both the Eclipse Public License and GNU Lesser General Public License . You are therefore free to use it in commercial applications subject to the terms detailed in either one of these licence documents. %package javadoc Summary: Javadoc for %{name} Group: Documentation %description javadoc Jericho HTML Parser. This package contains javadoc for %{name}. %prep %setup -q -n jericho-html-%{version} for j in $(find . -name "*.jar" -o -name "*.war" -o -name "*.class"); do rm -rf $j done for t in $(find . -name "*.java" -o -name "*.bat" -o -name "*.txt" -o -name "*.jsp" -o -name "*.css" -o -name "*.xml"); do sed -i 's/\r//' $t done %build export CLASSPATH="" CLASSPATH=$CLASSPATH:$(build-classpath slf4j/api commons-logging log4j) %if %with_gcj CLASSPATH=$CLASSPATH:$(build-classpath libgcj-%{gcj_ver}.jar) %endif %{javahome}/bin/javac -classpath $CLASSPATH \ %{javaopt} -g:none -d classes \ src/java/net/htmlparser/jericho/*.java src/java/net/htmlparser/jericho/nodoc/*.java %{javahome}/bin/jar -cf dist/jericho-html-%{version}.jar -C classes . %{javahome}/bin/javadoc -quiet \ -windowtitle "Jericho HTML Parser %version" \ -use -d docs/javadoc \ -subpackages net.htmlparser.jericho \ -exclude net.htmlparser.jericho.nodoc \ %if !%with_gcj -noqualifier net.htmlparser.jericho \ %endif -group "Core Package" src/java/net/htmlparser/jericho/*.java cat docs/src/append/stylesheet.css >> docs/javadoc/stylesheet.css cp docs/src/replace/*.* docs/javadoc %{javahome}/bin/javac %{javaopt} -g -deprecation \ -classpath $CLASSPATH:dist/jericho-html-%{version}.jar \ -d samples/console/classes samples/console/src/*.java %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" mkdir -p %{buildroot}%{_javadir} install -pm 644 dist/jericho-html-%{version}.jar %{buildroot}%{_javadir}/ ( cd %{buildroot}%{_javadir} for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"` done ) mkdir -p %{buildroot}%{_javadocdir}/jericho-html cp -rp docs/javadoc/* %{buildroot}%{_javadocdir}/jericho-html ln -s %{_javadir}/jericho-html-%{version}.jar samples/webapps/JerichoHTML/WEB-INF/lib %check rm -rf test/classes mkdir -p test/classes export CLASSPATH=classes:samples/console/classes:$(build-classpath junit48) %{javahome}/bin/javac %{javaopt} -g -d test/classes test/src/*.java test/src/samples/*.java \ test/src/net/htmlparser/jericho/*.java %{javahome}/bin/java -classpath $CLASSPATH:test/classes \ -Djava.util.logging.config.file=test/logging.properties org.junit.runner.JUnitCore TestSuite %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %files %defattr(-,root,root) %{_javadir}/jericho-html-%{version}.jar %{_javadir}/jericho-html.jar %doc licence-epl-1.0.html licence-lgpl-2.1.txt licence.txt %doc project-description.txt release.txt samples %files javadoc %defattr(-,root,root) %{_javadocdir}/jericho-html %changelog * Sun Dec 26 2010 gil 3.1-1mamba - package created by autospec