Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37720730
en ru br
Репозитории ALT
S:2.7.2-alt1_12jpp11
5.1: 2.7.0-alt6_10jpp5
4.1: 2.7.0-alt6_7jpp1.7
4.0: 2.7.0-alt6_7jpp1.7
www.altlinux.org/Changes

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

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

Packager: Igor Vlasenko <viy at altlinux.ru>
BuildRequires: /proc
BuildRequires: jpackage-compat
# Copyright (c) 2000-2008, 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 _with_repolib 1

# If you want repolib package to be built,

# issue the following: 'rpmbuild --with repolib'
%define with_repolib %{?_with_repolib:1}%{!?_with_repolib:0}
%define without_repolib %{!?_with_repolib:1}%{?_with_repolib:0}

%define repodir %{_javadir}/repository.jboss.com/apache-xalan/2.7.0.patch01-brew
%define repodirlib %{repodir}/lib
%define repodirsrc %{repodir}/src

%define gcj_support 0
%define bootstrap %{?_with_bootstrap:1}%{!?_with_bootstrap:%{?_without_bootstrap:0}%{!?_without_bootstrap:%{?_bootstrap:%{_bootstrap}}%{!?_bootstrap:0}}}

%define cvs_version 2_7_0

Name:           xalan-j2
Version:        2.7.0
Release:        alt6_10jpp5
Epoch:          0
Summary:        Java XSLT processor
License:        ASL 2.0
Source0:        http://www.apache.org/dist/xml/xalan-j/xalan-j_%{cvs_version}-src.tar.gz
Source1:        xalan-j2-2.7.0-component-info.xml
Patch0:         %{name}-noxsltcdeps.patch
Patch1:         %{name}-manifest.patch
Patch2:         %{name}-crosslink.patch
# Fix the XALANJ-2376:
#TransformerFactory.newTransformer(source) returns null instead throwing
#an exception and according to the specs newTransformer() should not
#return null.
Patch4:         %{name}-XALANJ-2376.patch
URL:            http://xalan.apache.org/
Group:          Development/Java
%if ! %{gcj_support}
BuildArch:      noarch
%endif
Provides:       jaxp_transform_impl
Requires: jaxp_parser_impl
Requires(post): alternatives >= 0:0.4
Requires(preun): alternatives >= 0:0.4
BuildRequires: jpackage-utils >= 0:1.6
BuildRequires: ant
%if ! %{bootstrap}
BuildRequires: java-cup
BuildRequires: bcel
BuildRequires: jlex
BuildRequires: regexp
BuildRequires: sed
BuildRequires: servletapi5
%endif
BuildRequires: xerces-j2 >= 0:2.7.1
BuildRequires: xml-commons-apis >= 0:1.3
%if %{gcj_support}
BuildRequires: java-gcj-compat-devel
Requires(post): java-gcj-compat
Requires(postun): java-gcj-compat
%endif
Provides: xalan-j = %{name}-%{version}
Obsoletes: xalan-j <= 2.7.0-alt3

%description
Xalan is an XSLT processor for transforming XML documents into HTML,
text, or other XML document types. It implements the W3C Recommendations
for XSL Transformations (XSLT) and the XML Path Language (XPath). It can
be used from the command line, in an applet or a servlet, or as a module
in other program.

%if %{with_repolib}
%package         repolib
Summary:         Artifacts to be uploaded to a repository library
Group:  Development/Java

%description     repolib
Artifacts to be uploaded to a repository library.
This package is not meant to be installed but so its contents
can be extracted through rpm2cpio.
%endif

%if ! %{bootstrap}
%package        xsltc
Summary:        XSLT compiler
Group:          Development/Java
Requires: java-cup
Requires: bcel
Requires: jlex
Requires: regexp
Requires: jaxp_parser_impl
%if %{gcj_support}
BuildRequires: java-gcj-compat-devel
Requires(post): java-gcj-compat
Requires(postun): java-gcj-compat
%endif

%description    xsltc
The XSLT Compiler is a Java-based tool for compiling XSLT stylesheets into
lightweight and portable Java byte codes called translets.
%endif

%package        manual
Summary:        Manual for %{name}
Group:          Development/Java

%description    manual
Documentation for %{name}.

%package        javadoc
Summary:        Javadoc for %{name}
Group:          Development/Documentation
BuildRequires: java-javadoc

%description    javadoc
Javadoc for %{name}.

%if ! %{bootstrap}
%package        demo
Summary:        Demo for %{name}
Group:          Development/Java
Requires: %{name} = %{epoch}:%{version}-%{release} servlet
BuildRequires: servlet

%if %{gcj_support}
BuildRequires: java-gcj-compat-devel
Requires(post): java-gcj-compat
Requires(postun): java-gcj-compat
%endif

%description    demo
Demonstrations and samples for %{name}.
%endif

%prep
%setup -q -n xalan-j_%{cvs_version}
%patch0 -p0
%patch1 -p0
%patch2 -p0
%patch4 -p0
# Remove all binary libs, except ones needed to build docs and N/A elsewhere.
for j in $(find . -name "*.jar"); do
       #mv $j $j.no
       rm $j
done

# FIXME: who knows where the sources are? xalan-j1 ?

#mv tools/xalan2jdoc.jar.no tools/xalan2jdoc.jar
#mv tools/xalan2jtaglet.jar.no tools/xalan2jtaglet.jar

%{__chmod} 0755 samples/extensions/sql/*.sh

%build
#export JAVA_HOME=%{java_home}
pushd lib
ln -sf $(build-classpath java_cup-runtime) runtime.jar
ln -sf $(build-classpath bcel) BCEL.jar
ln -sf $(build-classpath regexp) regexp.jar
ln -sf $(build-classpath xerces-j2) xercesImpl.jar
ln -sf $(build-classpath xml-commons-apis) xml-apis.jar
popd
pushd tools
ln -sf $(build-classpath java_cup) java_cup.jar
ln -sf $(build-classpath ant) ant.jar
ln -sf $(build-classpath jlex) JLex.jar
ln -sf $(build-classpath xml-stylebook) stylebook-1.0-b3_xalan-2.jar
popd
export CLASSPATH=$(build-classpath servletapi5)
export OPT_JAR_LIST=:
%if %{bootstrap}
ant -Dant.build.javac.source=1.4 -Dant.build.javac.target=1.4 \
 -Djava.awt.headless=true \
 -Dapi.j2se=%{_javadocdir}/java \
 -Dbuild.xalan-interpretive.jar=build/xalan-interpretive.jar \
 xalan-interpretive.jar
%else
ant -Dant.build.javac.source=1.4 -Dant.build.javac.target=1.4 \
 -Djava.awt.headless=true \
 -Dapi.j2se=%{_javadocdir}/java \
 -Dbuild.xalan-interpretive.jar=build/xalan-interpretive.jar \
 xalan-interpretive.jar\
 xsltc.unbundledjar \
 docs \
 xsltc.docs \
 javadocs \
 samples \
 servlet
%endif

%install

# jars

install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -p -m 644 build/xalan-interpretive.jar \
 $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
%if ! %{bootstrap}
install -p -m 644 build/xsltc.jar \
 $RPM_BUILD_ROOT%{_javadir}/xsltc-%{version}.jar
%endif
install -p -m 644 build/serializer.jar \
 $RPM_BUILD_ROOT%{_javadir}/%{name}-serializer-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)

# add a symlink to serializer.jar to match upstream jar naming

ln -sf %{name}-serializer-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/serializer.jar
ln -sf %{name}.jar $RPM_BUILD_ROOT%{_javadir}/xalan.jar

%if ! %{bootstrap}

# javadoc

install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr build/docs/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
# FIXME: (dwalluck): breaks --short-circuit
rm -rf build/docs/apidocs

# demo

install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}
install -p -m 644 build/xalansamples.jar \
 $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name}-samples.jar
install -p -m 644 build/xalanservlet.war \
 $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name}-servlet.war
cp -pr samples $RPM_BUILD_ROOT%{_datadir}/%{name}

# fix link between manual and javadoc

(cd build/docs; ln -sf %{_javadocdir}/%{name}-%{version} apidocs)
%endif

# jaxp_transform_impl ghost symlink

ln -s %{_sysconfdir}/alternatives \
 $RPM_BUILD_ROOT%{_javadir}/jaxp_transform_impl.jar

%if %{with_repolib}
       install -d -m 755 $RPM_BUILD_ROOT%{repodir}
       install -d -m 755 $RPM_BUILD_ROOT%{repodirlib}
       install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{repodir}/component-info.xml
       sed -i 's/ at VERSION at /2.7.0.patch01-brew/g' $RPM_BUILD_ROOT%{repodir}/component-info.xml
       tag=`echo %{name}-%{version}-%{release} | sed 's|\.|_|g'`
       sed -i "s/ at TAG at /$tag/g" $RPM_BUILD_ROOT%{repodir}/component-info.xml
       install -d -m 755 $RPM_BUILD_ROOT%{repodirsrc}
       install -p -m 644 %{PATCH0} $RPM_BUILD_ROOT%{repodirsrc}
       install -p -m 644 %{PATCH4} $RPM_BUILD_ROOT%{repodirsrc}
       install -p -m 644 %{SOURCE0} $RPM_BUILD_ROOT%{repodirsrc}
       cp -p $RPM_BUILD_ROOT%{_javadir}/serializer.jar $RPM_BUILD_ROOT%{repodirlib}
       cp -p $RPM_BUILD_ROOT%{_javadir}/xalan.jar $RPM_BUILD_ROOT%{repodirlib}
%endif

%if %{gcj_support}
%{_bindir}/aot-compile-rpm
%endif
install -d $RPM_BUILD_ROOT/%_altdir; cat >$RPM_BUILD_ROOT/%_altdir/jaxp_transform_impl_%{name}<<EOF
%{_javadir}/jaxp_transform_impl.jar %{_javadir}/%{name}.jar 30
EOF
install -d $RPM_BUILD_ROOT/%_altdir; cat >$RPM_BUILD_ROOT/%_altdir/jaxp_transform_impl_%{name}-xsltc<<EOF
%{_javadir}/jaxp_transform_impl.jar %{_javadir}/xsltc.jar 10
EOF
ln -s xalan-j2.jar $RPM_BUILD_ROOT/%{_javadir}/xalan-j.jar
ln -s xalan-j2 $RPM_BUILD_ROOT/%{_javadocdir}/xalan-j

%preun
{
 [ $1 = 0 ] || exit 0
 :
} >/dev/null 2>&1 || :

%if 0
%preun xsltc
{
 [ $1 = 0 ] || exit 0
 :
} >/dev/null 2>&1 || :
%endif

%files
%{_javadir}/xalan-j.jar
%_altdir/jaxp_transform_impl_%{name}
%doc KEYS licenses/xalan.LICENSE.txt licenses/xalan.NOTICE.txt licenses/serializer.LICENSE.txt licenses/serializer.NOTICE.txt
%{_javadir}/%{name}-%{version}.jar
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-serializer-%{version}.jar
%{_javadir}/%{name}-serializer.jar
%{_javadir}/serializer.jar
%{_javadir}/xalan.jar
%exclude %{_javadir}/jaxp_transform_impl.jar
%if %{gcj_support}
%dir %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/%{name}-%{version}.jar.*
%{_libdir}/gcj/%{name}/%{name}-serializer-%{version}.jar.*
%endif

%if ! %{bootstrap}
%files xsltc
%_altdir/jaxp_transform_impl_%{name}-xsltc
%{_javadir}/xsltc-%{version}.jar
%{_javadir}/xsltc.jar
#%ghost %{_javadir}/jaxp_transform_impl.jar

%if %{gcj_support}
%{_libdir}/gcj/%{name}/xsltc-%{version}.jar.*
%endif

%files manual
%doc --no-dereference build/docs/*

%files javadoc
%{_javadocdir}/xalan-j
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}

%files demo
%{_datadir}/%{name}
%if %{gcj_support}
%{_libdir}/gcj/%{name}/%{name}-samples.jar.*
%endif
%endif

%if %{with_repolib}
%files repolib
%{_javadir}/repository.jboss.com
%endif

%changelog

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

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