Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37734559
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 

BuildRequires: /proc
# BuildRequires: jpackage-1.5-compat
# Copyright (c) 2000-2007, 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
%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_7jpp1.7
Epoch:          0
Summary:        Java XSLT processor
License:        Apache Software License
Source0:        http://www.apache.org/dist/xml/xalan-j/xalan-j_%{cvs_version}-src.tar.gz
Patch0:         %{name}-noxsltcdeps.patch
Patch1:         %{name}-manifest.patch
Patch2:         %{name}-crosslink.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.2.0-alt0.12
Requires(preun): alternatives >= 0:0.2.0-alt0.12
BuildRequires: jpackage-utils >= 0:1.6
##BuildRequires: java-devel
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: gnu-crypto
BuildRequires: java-gcj-compat-devel >= 0:1.0.33
Requires(post): java-gcj-compat >= 0:1.0.33
Requires(postun): java-gcj-compat >= 0:1.0.33
%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 ! %{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: gnu-crypto
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

%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: gnu-crypto
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
# 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
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

%build
if [ ! -e "$JAVA_HOME" ] ; then export JAVA_HOME="%{java_home}" ; fi
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)

%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)

%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}
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 %{gcj_support}
export CLASSPATH=$(build-classpath gnu-crypto)
#%{_bindir}/aot-compile-rpm --exclude %{_datadir}/%{name}/%{name}-servlet.war
%{_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
ln -s xalan-j2.jar $RPM_BUILD_ROOT/%{_javadir}/xalan-j.jar
ln -s xalan-j2-serializer.jar $RPM_BUILD_ROOT/%{_javadir}/serializer.jar
ln -s xalan-j2 $RPM_BUILD_ROOT/%{_javadocdir}/xalan-j
%post
%register_alternatives jaxp_transform_impl_%{name}

%if %{gcj_support}
if [ -x %{_bindir}/rebuild-gcj-db ]
then
 %{_bindir}/rebuild-gcj-db
fi
%endif

%if %{gcj_support}
%postun
if [ -x %{_bindir}/rebuild-gcj-db ]
then
 %{_bindir}/rebuild-gcj-db
fi
%endif

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

#%post xsltc

#update-alternatives --install %{_javadir}/jaxp_transform_impl.jar \
#  jaxp_transform_impl %{_javadir}/xsltc.jar 10

#%preun xsltc

#{
#  [ $1 = 0 ] || exit 0
#  update-alternatives --remove jaxp_transform_impl %{_javadir}/xsltc.jar
#} >/dev/null 2>&1 || :

%if ! %{bootstrap}
%post javadoc
rm -f %{_javadocdir}/%{name}
ln -s %{name}-%{version} %{_javadocdir}/%{name}

%postun javadoc
if [ "$1" = "0" ]; then
   rm -f %{_javadocdir}/%{name}
fi

%if %{gcj_support}
%post xsltc
if [ -x %{_bindir}/rebuild-gcj-db ]
then
 %{_bindir}/rebuild-gcj-db
fi
%endif

%if %{gcj_support}
%postun xsltc
if [ -x %{_bindir}/rebuild-gcj-db ]
then
 %{_bindir}/rebuild-gcj-db
fi
%endif

%if %{gcj_support}
%post demo
if [ -x %{_bindir}/rebuild-gcj-db ]
then
 %{_bindir}/rebuild-gcj-db
fi
%endif

%if %{gcj_support}
%postun demo
if [ -x %{_bindir}/rebuild-gcj-db ]
then
 %{_bindir}/rebuild-gcj-db
fi
%endif
%endif

%files
%{_javadir}/serializer.jar
%{_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
#%ghost %{_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
%{_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
%doc %{_javadocdir}/%{name}-%{version}
%ghost %doc %{_javadocdir}/%{name}

%files demo
%{_datadir}/%{name}

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

%changelog

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

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