Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37840964
en ru br
Репозитории ALT
5.1: 1.14-alt1_3jpp5
www.altlinux.org/Changes

Группа :: Разработка/Java
Пакет: htmlunit

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Packager: Igor Vlasenko <viy at altlinux.ru>
BuildRequires: /proc
BuildRequires: jpackage-compat
# Copyright (c) 2000-2009, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the
#    distribution.
# 3. Neither the name of the JPackage Project nor the names of its
#    contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

%define gcj_support 0

# If you don't want to build with maven, and use straight ant instead,

# give rpmbuild option '--without maven'

%define with_maven %{!?_without_maven:1}%{?_without_maven:0}
%define without_maven %{?_without_maven:1}%{!?_without_maven:0}


Name:           htmlunit
Version:        1.14
Release:        alt1_3jpp5
Epoch:          0
Summary:        HtmlUnit
License:        Apache Software License 2.0
Group:          Development/Java
URL:            http://htmlunit.sourceforge.net/
Source0:        htmlunit-1.14.tar.gz
# svn export http://htmlunit.svn.sourceforge.net/svnroot/htmlunit/tags/HtmlUnit-1dot14/ htmlunit-1.14

Source1:        htmlunit-settings.xml
Source2:        htmlunit-jpp-depmap.xml
Patch0:         htmlunit-1.14-pom.patch
Patch1:         htmlunit-1.14-Stylesheet.patch
Patch2:         htmlunit-1.14-build.patch


%if ! %{gcj_support}
BuildArch:      noarch
%endif

BuildRequires: jpackage-utils >= 0:1.7.5
BuildRequires: ant >= 0:1.6.5
BuildRequires: junit >= 0:3.8.2
%if %{with_maven}
BuildRequires: maven2 >= 0:2.0.7
BuildRequires: maven2-plugin-assembly
BuildRequires: maven2-plugin-checkstyle
BuildRequires: maven2-plugin-compiler
BuildRequires: maven2-plugin-install
BuildRequires: maven2-plugin-jar
BuildRequires: maven2-plugin-javadoc
BuildRequires: maven2-plugin-release
BuildRequires: maven2-plugin-resources
BuildRequires: maven2-plugin-site
BuildRequires: maven-surefire-plugin
%endif
BuildRequires: cssparser
BuildRequires: excalibur-avalon-framework >= 0:4.1.3
BuildRequires: gsbase >= 0:2.0.1
BuildRequires: jakarta-commons-codec >= 0:1.3
BuildRequires: jakarta-commons-collections32
BuildRequires: jakarta-commons-fileupload >= 0:1.2.1
BuildRequires: jakarta-commons-httpclient >= 0:3.0.1
BuildRequires: jakarta-commons-io >= 0:1.3.1
BuildRequires: jakarta-commons-lang24
BuildRequires: jakarta-commons-logging >= 0:1.1
BuildRequires: jaxen >= 0:1.1
BuildRequires: jetty5
BuildRequires: nekohtml >= 0:0.9.5
BuildRequires: rhino16
BuildRequires: sac
BuildRequires: servlet_2_4_api
BuildRequires: xerces-j2
BuildRequires: xml-commons-jaxp-1.3-apis
%if %{gcj_support}
BuildRequires: gnu-crypto
BuildRequires: java-gcj-compat-devel
Requires(post): java-gcj-compat
Requires(postun): java-gcj-compat
%endif
Requires: excalibur-avalon-framework >= 0:4.1.3
Requires: jakarta-commons-codec >= 0:1.3
Requires: jakarta-commons-collections32
Requires: jakarta-commons-httpclient >= 0:3.0.1
Requires: jakarta-commons-io >= 0:1.3.1
Requires: jakarta-commons-lang24
Requires: jakarta-commons-logging >= 0:1.1
Requires: jaxen >= 0:1.1
Requires: junit >= 0:3.8.2
Requires: nekohtml >= 0:0.9.5
Requires: rhino16
Requires: xerces-j2
Requires: xml-commons-jaxp-1.3-apis

Requires(post): jpackage-utils >= 0:1.7.5
Requires(postun): jpackage-utils >= 0:1.7.5

%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:        Javadoc for %{name}
Group:          Development/Documentation
BuildArch: noarch

%description javadoc
%{summary}.

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

cp %{SOURCE1} settings.xml

%patch0 -b .sav0
%patch1 -b .sav1
%patch2 -b .sav2

%build
%if %{with_maven}
sed -i -e "s|<url>__JPP_URL_PLACEHOLDER__</url>|<url>file://`pwd`/.m2/repository</url>|g" settings.xml
sed -i -e "s|<url>__JAVADIR_PLACEHOLDER__</url>|<url>file://`pwd`/external_repo</url>|g" settings.xml
sed -i -e "s|<url>__MAVENREPO_DIR_PLACEHOLDER__</url>|<url>file://`pwd`/.m2/repository</url>|g" settings.xml
sed -i -e "s|<url>__MAVENDIR_PLUGIN_PLACEHOLDER__</url>|<url>file:///usr/share/maven2/plugins</url>|g" settings.xml
sed -i -e "s|<url>__ECLIPSEDIR_PLUGIN_PLACEHOLDER__</url>|<url>file:///usr/share/eclipse/plugins</url>|g" settings.xml

export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
mkdir -p $MAVEN_REPO_LOCAL

mkdir external_repo
ln -s %{_javadir} external_repo/JPP

   mvn-jpp \
       -e \
       -s $(pwd)/settings.xml \
       -Dmaven2.jpp.depmap.file=%{SOURCE2} \
       -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
       -Dmaven.test.failure.ignore=true \
       install javadoc:javadoc

%else

export CLASSPATH=$(build-classpath \
commons-codec \
commons-collections32 \
commons-fileupload \
commons-httpclient \
commons-io \
commons-lang24 \
commons-logging \
cssparser \
gsbase \
jaxen \
jetty6/jetty6 \
jetty6/jetty6-util \
js16 \
sac \
servlet_2_4_api \
nekohtml \
xerces-j2 \
xml-commons-jaxp-1.3-apis  \
)
CLASSPATH=$CLASSPATH:ant-target/classes:ant-target/test-classes
export LANG=en_US.UTF-8
ant -Dbuild.sysclasspath=only jar
ant -d -Dbuild.sysclasspath=only javadoc
%endif


%install
# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
%if %{with_maven}
install -m 644 target/%{name}-%{version}.jar \
 $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
%else
install -m 644 ant-target/distrib/HtmlUnit.jar \
 $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
%endif
%add_to_maven_depmap %{name} %{name} %{version} JPP %{name}

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

# poms

install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
install -m 644 pom.xml \
   $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP-%{name}.pom

# javadoc

install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
%if %{with_maven}
cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
%else
cp -pr ant-target/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
%endif
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink

%if %{gcj_support}
export CLASSPATH=$(build-classpath gnu-crypto)
%{_bindir}/aot-compile-rpm
%endif

%files
%{_javadir}/*
%{_datadir}/maven2/poms/*
%{_mavendepmapfragdir}/*
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/%{name}-%{version}.jar.*
%endif

%files javadoc
%doc %{_javadocdir}/%{name}-%{version}
%doc %{_javadocdir}/%{name}

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin