Sisyphus repository
Last update: 4 june 2020 | SRPMs: 17570 | Visits: 18690487
en ru br
ALT Linux repos
S:9.4.0.9-alt1_10jpp8
5.0: 6.5.5-alt2_1jpp5
4.1: 6.5.3-alt2_5jpp1.7
4.0: 6.5.3-alt2_5jpp1.7

Group :: Development/Java
RPM: saxon

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

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 resolverdir %{_sysconfdir}/java/resolver

Summary:        Java XSLT processor
Name:           saxon
Version:        6.5.3
Release:        alt2_5jpp1.7
Epoch:          0
License:        MPL
Group:          Development/Java
URL:            http://saxon.sourceforge.net/
Source0:        http://download.sf.net/saxon/saxon6_5_3.tar.bz2
Source1:        %{name}.saxon.script
Source2:        %{name}.build.script
Source3:        %{name}.1
Patch0:         %{name}-tinytree.patch
Patch1:         %{name}-fragmentval.patch
Patch2:         %{name}-cmdlinefix.patch
BuildRequires: jpackage-utils >= 0:1.6
BuildRequires: xml-commons-apis
BuildRequires: jdom >= 0:1.0
BuildRequires: fop >= 0:0.20.1
BuildRequires: jdom-javadoc >= 0:1.0
BuildRequires: fop-javadoc
Requires: jaxp_parser_impl
Requires: alternatives >= 0:0.2.0-alt0.12
Provides:       jaxp_transform_impl
%if ! %{gcj_support}
BuildArch:      noarch
%endif
%if %{gcj_support}
BuildRequires: gnu-crypto
BuildRequires: java-gcj-compat-devel
Requires(post): java-gcj-compat
Requires(postun): java-gcj-compat
%endif

%description
The SAXON package is a collection of tools for processing XML documents.
The main components are:
- An XSLT processor, which implements the Version 1.0 XSLT and XPath
 Recommendations from the World Wide Web Consortium, found at
 http://www.w3.org/TR/1999/REC-xslt-19991116 and
 http://www.w3.org/TR/1999/REC-xpath-19991116 with a number of powerful
 extensions. This version of Saxon also includes many of the new features
 defined in the XSLT 1.1 working draft, but for conformance and portability
 reasons these are not available if the stylesheet header specifies
 version="1.0".
- A Java library, which supports a similar processing model to XSL, but allows
 full programming capability, which you need if you want to perform complex
 processing of the data or to access external services such as a relational
 database.
So you can use SAXON with any SAX-compliant XML parser by writing XSLT
stylesheets, by writing Java applications, or by any combination of the two.

%package        aelfred
Summary:        Java XML parser
Group:          Development/Java
#Provides:       jaxp_parser_impl
#Requires:       /usr/sbin/update-alternatives
Requires: xml-commons-apis

%description    aelfred
A slightly improved version of the AElfred Java XML parser from Microstar.

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

%description    manual
Manual for %{name}.

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

%description    javadoc
Javadoc for %{name}.

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

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

%package        fop
Summary:        FOP support for %{name}
Group:          Development/Java
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: fop >= 0:0.20.1

%description    fop
FOP support for %{name}.

%package        jdom
Summary:        JDOM support for %{name}
Group:          Development/Java
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: jdom >= 0:1.0

%description    jdom
JDOM support for %{name}.

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

%description    scripts
Utility scripts for %{name}.


%prep
%setup -q -c
unzip -q source.zip
cp -p %{SOURCE2} ./build.xml
%patch0 -p0
%patch1 -p0
%patch2 -p0
# cleanup unnecessary stuff we'll build ourselves
rm -rf *.jar docs/api


%build
export CLASSPATH=%(build-classpath xml-commons-apis fop jdom)
ant \
 -Dj2se.javadoc=%{_javadocdir}/java \
 -Dfop.javadoc=%{_javadocdir}/fop \
 -Djdom.javadoc=%{_javadocdir}/jdom


%install

# jars

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

# javadoc

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

# demo

mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}
cp -pr samples/* $RPM_BUILD_ROOT%{_datadir}/%{name}

# scripts

mkdir -p $RPM_BUILD_ROOT%{_bindir}
sed 's,__RESOLVERDIR__,%{resolverdir},' < %{SOURCE1} \
 > $RPM_BUILD_ROOT%{_bindir}/%{name}
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
sed 's,__RESOLVERDIR__,%{resolverdir},' < %{SOURCE3} \
 > $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1

# jaxp_transform_impl ghost symlink

ln -s %{_sysconfdir}/alternatives \
 $RPM_BUILD_ROOT%{_javadir}/jaxp_transform_impl.jar
# 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_transform_impl_%{name}<<EOF
%{_javadir}/jaxp_transform_impl.jar %{_javadir}/%{name}.jar 25
EOF
chmod 755 $RPM_BUILD_ROOT%{_bindir}/saxon


%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 -eq 0 ] || exit 0
 %unregister_alternatives jaxp_transform_impl_%{name}
} >/dev/null 2>&1 || :

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

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

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

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

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

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

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

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

%files
%_altdir/jaxp_transform_impl_%{name}
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-%{version}.jar
#%ghost %{_javadir}/jaxp_transform_impl.jar
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/%{name}-%{version}.jar.*
%endif

%files aelfred
%{_javadir}/%{name}-aelfred*
#%ghost %{_javadir}/jaxp_parser_impl.jar
%if %{gcj_support}
%{_libdir}/gcj/%{name}/%{name}-aelfred-%{version}.jar.*
%endif

%files fop
%{_javadir}/%{name}-fop*
%if %{gcj_support}
%{_libdir}/gcj/%{name}/%{name}-fop-%{version}.jar.*
%endif

%files jdom
%{_javadir}/%{name}-jdom*
%if %{gcj_support}
%{_libdir}/gcj/%{name}/%{name}-jdom-%{version}.jar.*
%endif

%files manual
%doc doc/*.html

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

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

%files scripts
#%defattr(0755,root,root,0755)
%{_bindir}/%{name}
%attr(0644,root,root) %{_mandir}/man1/%{name}.1*


%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin