Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37536308
en ru br
Репозитории ALT
S:2.12.2-alt1_3jpp11
5.1: 2.9.0-alt6_12jpp5
4.1: 2.9.0-alt5_2jpp1.7
4.0: 2.9.0-alt5_2jpp1.7
www.altlinux.org/Changes

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

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

BuildRequires: xml-commons-resolver
BuildRequires: /proc
BuildRequires: jpackage-1.4-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_9_0

Name:           xerces-j2
Version:        2.9.0
Release:        alt5_2jpp1.7
Epoch:          0
Summary:        Java XML parser
License:        Apache Software License
URL:            http://xerces.apache.org/
Group:          Development/Java
Source0:        http://www.apache.org/dist/xml/xerces-j/Xerces-J-src.%{version}.tar.gz
Source1:        %{name}-version.sh
Source2:        %{name}-constants.sh
Source3:        XJavac.java
Source4:        xercesImpl-%{version}.pom
Patch0:         %{name}-build.patch
Patch1:         %{name}-libgcj.patch
Patch2:         %{name}-build-bootstrap.patch
Obsoletes:      xerces-j2-dom3
Provides:       jaxp_parser_impl
Provides:       xerces-j2-dom3
Requires: xml-commons-jaxp-1.3-apis >= 0:1.3
Requires: xml-commons-resolver11
BuildRequires: ant >= 0:1.6
BuildRequires: jpackage-utils >= 0:1.7.2
BuildRequires: jaxp_parser_impl
BuildRequires: xml-commons-resolver11
BuildRequires: xml-commons-jaxp-1.3-apis >= 0:1.3
%if ! %{bootstrap}
BuildRequires: xml-stylebook
BuildRequires: xalan-j2
%endif
Requires(post): alternatives >= 0:0.2.0-alt0.12 jaxp_parser_impl
Requires(preun): alternatives >= 0:0.2.0-alt0.12 jaxp_parser_impl

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

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

%if %{gcj_support}
BuildRequires: gnu-crypto
BuildRequires: java-gcj-compat-devel >= 1.0.31
Requires(post): java-gcj-compat >= 1.0.31
Requires(postun): java-gcj-compat >= 1.0.31
%endif
Provides: xerces-j = %version-%release
Obsoletes: xerces-j <= 2.9.0-alt4

%description
Welcome to the future! Xerces2 is the next generation of high
performance, fully compliant XML parsers in the Apache Xerces family.
This new version of Xerces introduces the Xerces Native Interface (XNI),
a complete framework for building parser components and configurations
that is extremely modular and easy to program.

The Apache Xerces2 parser is the reference implementation of XNI but
other parser components, configurations, and parsers can be written
using the Xerces Native Interface. For complete design and
implementation documents, refer to the XNI Manual.

Xerces 2 is a fully conforming XML Schema processor. For more
information, refer to the XML Schema page.

Xerces 2 also provides a partial implementation of Document Object Model
Level 3 Core, Load and Save and Abstract Schemas [deprecated] Working
Drafts. For more information, refer to the DOM Level 3 Implementation
page.

%package        javadoc-impl
Summary:        Javadoc for %{name} implementation
Group:          Development/Documentation

%description    javadoc-impl
Javadoc for %{name} implementation.

%package        javadoc-apis
Summary:        Javadoc for %{name} apis
Group:          Development/Documentation
Obsoletes:      xerces-j2-dom3-javadoc
Provides:       xerces-j2-dom3-javadoc

%description    javadoc-apis
Javadoc for %{name} apis.

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

%description    javadoc-xni
Javadoc for %{name} xni.

%package        javadoc-other
Summary:        Javadoc for other %{name} components
Group:          Development/Documentation

%description    javadoc-other
Javadoc for other %{name} components.

%if ! %{gcj_support} && ! %{bootstrap}
%package        manual
Summary:        Documents for %{name}
Group:          Development/Documentation

%description    manual
%{summary}.
%endif

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

%if %{gcj_support}
Requires(post): java-gcj-compat >= 1.0.31
Requires(postun): java-gcj-compat >= 1.0.31
%endif

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

%package        scripts
Summary:        Additional utility scripts for %{name}
Group:          Development/Java
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: jpackage-utils >= 0:1.7.2

%description    scripts
Additional utility scripts for %{name}.

%prep
%setup -q -n xerces-%{cvs_version}
%patch0 -b .build
%if %{bootstrap}
%patch2 -b .bootstrap
%endif

mkdir -p tools/org/apache/xerces/util
cp -a %{SOURCE3} tools/org/apache/xerces/util
%patch1 -p0 -b .libgcj


%build
pushd tools
javac -classpath $(build-classpath ant) org/apache/xerces/util/XJavac.java
mkdir bin && jar cf bin/xjavac.jar org/apache/xerces/util/XJavac.class
ln -sf $(build-classpath xml-commons-jaxp-1.3-apis) .
ln -sf $(build-classpath xml-commons-resolver11) .
%if ! %{bootstrap}
ln -sf $(build-classpath xml-stylebook) .
ln -sf $(build-classpath xalan-j2) xalan.jar
ln -sf $(build-classpath xalan-j2-serializer) serializer.jar
%endif
popd

%if ! %{gcj_support}
export CLASSPATH=$(build-classpath xml-stylebook):tools/bin/xjavac.jar
export ANT_OPTS="-Xmx256m -Djava.endorsed.dirs=$(pwd)/tools -Djava.awt.headless=true -Dbuild.sysclasspath=first -Ddisconnected=true"
%endif
%if %{bootstrap}
ant \
       -Dbuild.compiler=modern \
       -Djar.apis=xml-commons-jaxp-1.3-apis.jar \
       -Djar.resolver=xml-commons-resolver11.jar \
       clean jars javadocs
%else
%if ! %{gcj_support}
ant \
       -Dbuild.compiler=modern \
       -Djar.apis=xml-commons-jaxp-1.3-apis.jar \
       -Djar.resolver=xml-commons-resolver11.jar \
       -Ddoc.generator.package=./tools/xml-stylebook.jar \
       clean jars javadocs docs sampjar
%else
ant \
       -Dbuild.compiler=modern \
       -Djar.apis=xml-commons-jaxp-1.3-apis.jar \
       -Djar.resolver=xml-commons-resolver11.jar \
       clean jars javadocs
%endif
%endif

%install

# jars

mkdir -p $RPM_BUILD_ROOT%{_javadir}
cp -p build/xercesImpl.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *.jar; do ln -sf ${jar} dom3-${jar}; done)
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)

%add_to_maven_depmap xerces xercesImpl %{version} JPP %{name}

# pom

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


# javadoc

mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}-impl-%{version}
cp -pr build/docs/javadocs/xerces2/* \
 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-impl-%{version}
ln -s %{name}-impl-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}-impl

mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}-apis-%{version}
cp -pr build/docs/javadocs/api/* \
 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-apis-%{version}
ln -s %{name}-apis-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}-apis

mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}-xni-%{version}
cp -pr build/docs/javadocs/xni/* \
 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-xni-%{version}
ln -s %{name}-xni-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}-xni

mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}-other-%{version}
cp -pr build/docs/javadocs/other/* \
 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-other-%{version}
ln -s %{name}-other-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}-other

rm -rf build/docs/javadocs

# manual

mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
%if ! %{gcj_support} && ! %{bootstrap}
cp -pr build/docs/* $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
%endif
cp LICENSE*  $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
cp NOTICE  $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
cp README  $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}


# scripts

mkdir -p $RPM_BUILD_ROOT%{_bindir}
cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/%{name}-version
cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}-constants

# demo

mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}
cp -p build/xercesSamples.jar \
 $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name}-samples.jar
cp -pr data $RPM_BUILD_ROOT%{_datadir}/%{name}

# jaxp_parser_impl ghost symlink

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


%if %{gcj_support}
export CLASSPATH=$(build-classpath gnu-crypto)
%{_bindir}/aot-compile-rpm
%endif
install -d $RPM_BUILD_ROOT/%_altdir; cat >$RPM_BUILD_ROOT/%_altdir/jaxp_parser_impl_%{name}<<EOF
%{_javadir}/jaxp_parser_impl.jar %{_javadir}/%{name}.jar 40
EOF
chmod 755 $RPM_BUILD_ROOT%{_bindir}/*
ln -s xerces-j2.jar $RPM_BUILD_ROOT%_javadir/xerces-j.jar

%post javadoc-apis
rm -f %{_javadocdir}/%{name}-apis
ln -s %{name}-apis-%{version} %{_javadocdir}/%{name}-apis

%post javadoc-impl
rm -f %{_javadocdir}/%{name}-impl
ln -s %{name}-impl-%{version} %{_javadocdir}/%{name}-impl

%post javadoc-other
rm -f %{_javadocdir}/%{name}-other
ln -s %{name}-other-%{version} %{_javadocdir}/%{name}-other

%post javadoc-xni
rm -f %{_javadocdir}/%{name}-xni
ln -s %{name}-xni-%{version} %{_javadocdir}/%{name}-xni

%post
%update_maven_depmap
%register_alternatives jaxp_parser_impl_%{name}

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

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

%postun
%update_maven_depmap
%if %{gcj_support}
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

%files
%_altdir/jaxp_parser_impl_%{name}
%dir %{_docdir}/%{name}-%{version}
%doc %{_docdir}/%{name}-%{version}/[A-Z]*
%{_javadir}/%{name}*.jar
%{_javadir}/dom3-%{name}*.jar
%exclude %{_javadir}/jaxp_parser_impl.jar
%{_datadir}/maven2/poms/*
%{_mavendepmapfragdir}
%if %{gcj_support}
%{_libdir}/gcj/%{name}/%{name}-%{version}.jar.*
%endif
%_javadir/xerces-j.jar

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

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

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

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

%if ! %{gcj_support} && ! %{bootstrap}
%files manual
%doc %{_docdir}/%{name}-%{version}/[a-z]*
%endif

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

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

%files scripts
#%defattr(0755,root,root,0755)
%{_bindir}/*


%changelog

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

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