Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 4cd77f593f1ca915646208631b87687c > files > 2

htmlparser-1.6-2.mga3.src.rpm

%define         pkg_version     %(echo %version | tr . _)
%define         pkg_date        20060610
%define         with_java_gcj 1
Name:           htmlparser
Version:        1.6
Release:        %mkrel 2
Summary:        HTML Parser
Group:          Development/Java
URL:            http://htmlparser.sourceforge.net
Source0:        http://downloads.sourceforge.net/project/htmlparser/htmlparser/%{version}/htmlparser%{pkg_version}_%{pkg_date}.zip
# from http://repo1.maven.org/maven2/org/htmlparser/
Source1:        htmlparser-%{version}.pom
License:        CPL
BuildRequires:  ant
BuildRequires:  ant-junit
BuildRequires:  apache-commons-logging
BuildRequires:  checkstyle
BuildRequires:  fit-java
BuildRequires:  java-devel >= 0:1.6.0
BuildRequires:  jpackage-utils
BuildRequires:  junit
BuildRequires:  sax2
%if %with_java_gcj
BuildRequires: java-1.5.0-gcj-devel
%endif
Requires:       sax2
Requires:       jpackage-utils
Requires(post): jpackage-utils
Requires(postun): jpackage-utils
Requires:       java >= 0:1.6.0
BuildArch:      noarch


%description
HTML Parser is a Java library used to parse HTML in either a linear or nested fashion.
Primarily used for transformation or extraction, it features filters, visitors,
custom tags and easy to use JavaBeans. It is a fast, robust and well tested package.

%package javadoc
Group:          Development/Java
Summary:        Javadoc for %{name}

%description javadoc
HTML Parser, a Java library used to parse HTML.

This package contains javadoc for %{name}.

%prep

%setup -q -n htmlparser%{pkg_version}

unzip -qq src.zip

for j in $(find . -name "*.jar"); do
  mv $j $j.no
done

for c in $(find . -name "*.class"); do
  rm -rf $c
done

ln -sf $(build-classpath fit) lib/fit.jar
ln -sf $(build-classpath junit) lib/junit.jar
ln -sf $(build-classpath sax2) lib/sax2.jar
ln -sf $(build-classpath checkstyle) lib/checkstyle.jar
ln -sf $(build-classpath checkstyle-all) lib/checkstyle-all.jar

%build
# checkstyle-all 
%if %with_java_gcj
export JAVA_HOME=%{_jvmdir}/java-gcj
%endif
export CLASSPATH=$(build-classpath fit junit sax2 ant/ant-junit commons-logging checkstyle):src
ant \
  -Djava.home=$JAVA_HOME \
  -Djunit.jar=$(build-classpath junit) \
  -Dcommons-logging.jar=$(build-classpath commons-logging) \
  -Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 \
  jar javadoc

%if %with_java_gcj
CLASSPATH=$CLASSPATH:lib/htmllexer.jar:lib/htmlparser.jar
ant \
  -Djava.home=$JAVA_HOME\
  -Djunit.jar=$(build-classpath junit) \
  -Dcommons-logging.jar=$(build-classpath commons-logging) \
  -Dant.java.version=1.5 \
  -Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 \
  thumbelina
CLASSPATH=$CLASSPATH
ant \
  -Djava.home=$JAVA_HOME \
  -Djunit.jar=$(build-classpath junit) \
  -Dcommons-logging.jar=$(build-classpath commons-logging) \
  -Dant.java.version=1.5 \
  -Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 \
  -Dfit_present=true \
  filterbuilder
%endif

%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"

mkdir -p %{buildroot}%{_javadir}

install -pm 644 lib/htmlparser.jar \
  %{buildroot}%{_javadir}/htmlparser-%{version}.jar
install -pm 644 lib/htmllexer.jar \
  %{buildroot}%{_javadir}/htmllexer-%{version}.jar

%if %with_java_gcj
install -pm 644 lib/thumbelina.jar \
   %{buildroot}%{_javadir}/thumbelina-%{version}.jar
install -pm 644 lib/filterbuilder.jar \
  %{buildroot}%{_javadir}/filterbuilder-%{version}.jar
%endif

(
  cd %{buildroot}%{_javadir}
  for jar in *-%{version}*; do
    ln -sf ${jar} `echo $jar| sed  "s|-%{version}||g"`
  done
)

mkdir -p %{buildroot}%{_javadocdir}/htmlparser-%{version}
cp -pr docs/javadoc/* %{buildroot}%{_javadocdir}/htmlparser-%{version}
ln -sf htmlparser1-%{version} %{buildroot}%{_javadocdir}/htmlparser
rm -rf docs/javadoc

%files
%{_javadir}/htmlparser-%{version}.jar
%{_javadir}/htmlparser.jar
%{_javadir}/htmllexer-%{version}.jar
%{_javadir}/htmllexer.jar
%if %with_java_gcj
%{_javadir}/thumbelina-%{version}.jar
%{_javadir}/thumbelina.jar
%{_javadir}/filterbuilder-%{version}.jar
%{_javadir}/filterbuilder.jar
%endif
%doc docs/*

%files javadoc
%{_javadocdir}/htmlparser-%{version}
%{_javadocdir}/htmlparser


%changelog

* Sun Jan 13 2013 dmorgan <dmorgan> 1.6-2.mga3
+ Revision: 361748
- Fix required java version

  + umeabot <umeabot>
    - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Tue Aug 02 2011 dmorgan <dmorgan> 1.6-1.mga2
+ Revision: 131307
- Fix groups
- Clean spec file
- Remove un existing macro
- Fix buildrequires
- Clean spec file

  + gil <gil>
    - edit spec file, used javac target and source 1.5
    - imported package htmlparser


* Tue May 31 2011 gil <gil> 1.6-0.%%mkrel
- initial rpm