Name: htmlunit
Version: 2.7
Release: 1
Summary: Test unit Java package for testing of HTML based content
Group: Development/Libraries
License: ASL 2.0
URL: http://htmlunit.sourceforge.net/project/htmlunit/htmlunit/2.7/htmlunit-2.7-src.zip
Source0: htmlunit-2.7-1.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: jpackage-utils
BuildRequires: java-devel
BuildRequires: maven2
BuildRequires: maven2-plugin-compiler
BuildRequires: maven2-plugin-install
BuildRequires: maven2-plugin-jar
BuildRequires: maven2-plugin-javadoc
#BuildRequires: maven-release-plugin
BuildRequires: maven2-plugin-resources
BuildRequires: maven2-plugin-surefire
Requires: jpackage-utils
Requires(post): jpackage-utils
Requires(postun): jpackage-utils
%description
HtmlUnit is a "browser for Java programs". It models the HTML
documents and provides an API that allows you to invoke pages,
fill forms, click links, etc. just like you do in your
"normal" browser.
It has fairly good JavaScript support (which gets continuously
improved) and is able to work even with quite complex AJAX
libraries simulating either Firefox or Internet Explorer
depending on the configuration you want to use.
It is typically used for testing purposes or to retrieve
information from web sites.
%package javadoc
Summary: Javadocs for %{name}
Group: Development/Documentation
Requires: %{name}-%{version}-%{release}
Requires: jpackage-utils
%description javadoc
This package contains the API documentation for %{name}.
%package manual
Summary: Manual for %{name}
Group: Development/Documentation
Requires: jpackage-utils
Requires: %{name}-%{version}-%{release}
%description manual
The manual for %{name}.
%prep
%setup -q
%build
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
mkdir -p $MAVEN_REPO_LOCAL
mvn-jpp -Dmaven.repo.local=$MAVEN_REPO_LOCAL install javadoc:javadoc
%install
rm -rf $RPM_BUILD_ROOT
#jars
mkdir -p $RPM_BUILD_ROOT%{_javadir}
cp -p %{name}-%{version}-%{release}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
#javadocs
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -rp javadoc $RPM_BUILD_ROOT%{_javadocdir}/%{name}
#pom
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
install -pm 644 pom.xml $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP-%{name}.pom
%add_to_maven_depmap org.apache.maven %{name} %{version} JPP %{name}
%clean
rm -rf $RPM_BUILD_ROOT
%post
%update_maven_depmap
%postun
%update_maven_depmap
%files
%defattr(-,root,root,-)
%{_datadir}/maven2/poms
%{_mavendepmapfragdir}
%{_javadir}/*
%doc
%files javadoc
%defattr(-,root,root,-)
%{_javadocdir}/%{name}
%files manual
%defattr(-,root,root,-)
%doc [manual directory] /*
%doc License.txt
%changelog
* Tue Sep 15 2010 Edmon Begoli - 1:2.7
- First version of the package