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

Packager: Igor Vlasenko <viy at altlinux.ru>
BuildRequires: xml-commons-resolver
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-xerces/2.7.1-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_9_0

Name:           xerces-j2
Version:        2.9.0
Release:        alt6_12jpp5
Epoch:          0
Summary:        Java XML parser
License:        ASL 2.0
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
Source33:        xercesImpl-%{version}.pom
Patch0:         %{name}-build.patch
Patch1:         %{name}-libgcj.patch
Source4: xerces-component-info.xml
Provides:       jaxp_parser_impl
Obsoletes:      xerces-j2-dom3 < %{epoch}:%{version}-%{release}
Provides:       xerces-j2-dom3 = %{epoch}:%{version}-%{release}
Requires: xml-commons-apis >= 0:1.3
Requires: xml-commons-resolver >= 0:1.1
BuildRequires: ant >= 0:1.6
BuildRequires: jpackage-utils >= 0:1.6
BuildRequires: xerces-j2
#BuildRequires:  jaxp_parser_impl
BuildRequires: xml-commons-resolver >= 0:1.1
BuildRequires: xml-commons-apis >= 0:1.3
%if ! %{bootstrap}
BuildRequires: xml-stylebook
BuildRequires: xalan-j2
BuildRequires: java-fonts
%endif
Requires(post): alternatives >= 0:0.4 jaxp_parser_impl
Requires(preun): alternatives >= 0:0.4 jaxp_parser_impl

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

%if %{gcj_support}
BuildRequires: java-gcj-compat-devel
Requires(post): java-gcj-compat
Requires(postun): java-gcj-compat
%endif
#Provides: osgi(org.apache.xerces) = %version
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.

%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

%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 < %{epoch}:%{version}-%{release}
Provides:       xerces-j2-dom3-javadoc = %{epoch}:%{version}-%{release}

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

%package        manual
Summary:        Documents for %{name}
Group:          Development/Documentation

%description    manual
%{summary}.

%package        demo
Summary:        Demo for %{name}
Group:          Development/Java
Requires: %{name} = %{epoch}:%{version}-%{release}
%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}.

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

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

%prep
%setup -q -n xerces-%{cvs_version}
%{__perl} -pi -e 's/\r$//g' NOTICE
%patch0 -p0 -b .build

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

%if %{with_repolib}
tag=`echo %{name}-%{version}-%{release} | sed 's|\.|_|g'`
sed -i "s/ at TAG at /$tag/g" %{SOURCE4}
%endif

%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-apis) .
ln -sf $(build-classpath xml-commons-resolver) .
%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}
export CLASSPATH=$CLASSPATH:$(build-classpath xalan-j2-serializer)
%endif
# FIXME: (dwalluck)
# [javadoc] javadoc: error - Error - Exception java.lang.ClassNotFoundException thrown while trying to register Taglet org.apache.xerces.util.ExperimentalTaglet...
# [javadoc] javadoc: error - Error - Exception java.lang.ClassNotFoundException thrown while trying to register Taglet org.apache.xerces.util.InternalTaglet...
# [javadoc] java.util.MissingResourceException: Can't find resource for bundle com.sun.tools.doclets.formats.html.resources.standard, key doclet.malformed_html_link_tag
%if %{bootstrap}
ant -Dant.build.javac.source=1.4 -Dant.build.javac.target=1.4 \
       -Dbuild.compiler=modern \
       -Djar.apis=xml-commons-apis.jar \
       -Djar.resolver=xml-commons-resolver.jar \
       clean jars javadocs
%else
%if ! %{gcj_support}
ant -Dant.build.javac.source=1.4 -Dant.build.javac.target=1.4 \
       -Dbuild.compiler=modern \
       -Djar.apis=xml-commons-apis.jar \
       -Djar.resolver=xml-commons-resolver.jar \
       -Ddoc.generator.package=./tools/xml-stylebook.jar \
       clean jars javadocs docs sampjar
%else
ant -Dant.build.javac.source=1.4 -Dant.build.javac.target=1.4 \
       -Dbuild.compiler=modern \
       -Djar.apis=xml-commons-apis.jar \
       -Djar.resolver=xml-commons-resolver.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)
ln -s %{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/xercesImpl.jar

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

# pom

install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
install -pm 644 %{SOURCE33} \
   $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

# 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}
%{_bindir}/aot-compile-rpm
%endif

%if %{with_repolib}
install -d -m 755 $RPM_BUILD_ROOT%{repodir}
install -d -m 755 $RPM_BUILD_ROOT%{repodirlib}
install -m 755 %{SOURCE4} $RPM_BUILD_ROOT%{repodir}/component-info.xml
install -d -m 755 $RPM_BUILD_ROOT%{repodirsrc}
install -m 755 %{PATCH0} $RPM_BUILD_ROOT%{repodirsrc}
install -m 755 %{SOURCE3} $RPM_BUILD_ROOT%{repodirsrc}
install -m 755 %{SOURCE0} $RPM_BUILD_ROOT%{repodirsrc}
install -m 755 %{PATCH1} $RPM_BUILD_ROOT%{repodirsrc}
cp $RPM_BUILD_ROOT%{_javadir}/xercesImpl.jar $RPM_BUILD_ROOT%{repodirlib}
%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

%files
%_altdir/jaxp_parser_impl_%{name}
#%doc ISSUES LICENSE* NOTICE README STATUS TODO
%doc LICENSE* NOTICE README  
%{_javadir}/%{name}*.jar
%{_javadir}/dom3-%{name}*.jar
%{_javadir}/xercesImpl.jar
%exclude %{_javadir}/jaxp_parser_impl.jar
%{_datadir}/maven2/poms/*
%{_mavendepmapfragdir}
%if %{gcj_support}
%dir %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/%{name}-%{version}.jar.*
%endif
%_javadir/xerces-j.jar

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

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

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

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

%files manual
%doc %{_docdir}/%{name}-%{version}/

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

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

%if %{with_repolib}
%files repolib
%{repodir}
%endif

%changelog

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

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