LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File saxon9.spec of Package saxon9 (Project Java:packages)

#
# spec file for package saxon9
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Summary:        The SAXON XSLT Processor from Michael Kay
License:        MPL-1.0 and Apache-2.0
Group:          Productivity/Publishing/XML
# net.sf.saxon.om.XMLChar is from ASL-licensed Xerces
Name:           saxon9
Version:        9.4.0.7
Release:        0
Url:            http://saxon.sourceforge.net/
#Source0:        https://downloads.sourceforge.net/project/saxon/Saxon-HE/9.3/saxon9-4-0-7source.zip
Source0:        saxon9-4-0-7source.zip
Source1:        %{name}.saxon.script
Source2:        %{name}.saxonq.script
Source3:        %{name}.build.script
Source4:        %{name}.1
Source5:        %{name}q.1
Source6:        https://downloads.sourceforge.net/project/saxon/Saxon-HE/9.4/saxon-resources9-4.zip
#Made from original pom file
#Source7:        http://irrational.googlecode.com/svn/trunk/maven-repo/net/sf/saxon/saxon-he/9.3.0.7/saxon-he-9.3.0.7.pom
Source7:        saxon-he-9.4.0.7.pom
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

BuildRequires:  ant
BuildRequires:  bea-stax-api
BuildRequires:  dom4j
BuildRequires:  java-devel
BuildRequires:  jdom
BuildRequires:  unzip
BuildRequires:  xml-commons-apis
BuildRequires:  xom

BuildRequires:  java-javadoc
#BuildRequires:  jdom-javadoc >= 1.0
#BuildRequires:  fop-javadoc

Requires:       bea-stax
Requires:       bea-stax-api
Provides:       jaxp_transform_impl = %{version}-%{release}

# Older versions were split into multile packages
Obsoletes:      %{name}-dom < %{version}-%{release}
Provides:       %{name}-dom = %{version}-%{release}
Obsoletes:      %{name}-jdom < %{version}-%{release}
Provides:       %{name}-jdom = %{version}-%{release}
Obsoletes:      %{name}-sql < %{version}-%{release}
Provides:       %{name}-sql = %{version}-%{release}
Obsoletes:      %{name}-xom < %{version}-%{release}
Provides:       %{name}-xom = %{version}-%{release}
Obsoletes:      %{name}-xpath < %{version}-%{release}
Provides:       %{name}-xpath = %{version}-%{release}

%description
The most recent version of the open-source implementation of XSLT 2.0 and XPath
2.0, and XQuery 1.0. This provides the "basic" conformance level of these
languages: in effect, this provides all the features of the languages except
schema-aware processing. This version reflects the syntax of the final XSLT
2.0, XQuery 1.0, and XPath 2.0 Recommendations of 23 January 2007 as amended in
the second editions of those specifications where appropriate. 

%package        manual
Summary:        Manual for %{name}
Group:          Productivity/Publishing/XML

%description    manual
Manual for %{name}.

%package        javadoc
Summary:        Javadoc for %{name}
Group:          Productivity/Publishing/XML

%description    javadoc
Javadoc for %{name}.

%package        demo
Summary:        Demos for %{name}
Group:          Productivity/Publishing/XML
Requires:       %{name} = %{version}-%{release}

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

%package        scripts
Summary:        Utility scripts for %{name}
Group:          Productivity/Publishing/XML
Requires:       %{name} = %{version}-%{release}
Requires:       jaxp_parser_impl
Requires:       jpackage-utils >= 1.6
Requires:       xml-commons-apis

%description    scripts
Utility scripts for %{name}.


%prep
%setup -q -c

unzip -q %{SOURCE6}
cp -p %{SOURCE3} ./build.xml

# deadNET
rm -rf net/sf/saxon/dotnet

# Depends on XQJ (javax.xml.xquery)
rm -rf net/sf/saxon/xqj

# This requires a EE edition feature (com.saxonica.xsltextn)
rm -rf net/sf/saxon/option/sql/SQLElementFactory.java

# cleanup unnecessary stuff we'll build ourselves
rm -rf docs/api
find . \( -name "*.jar" -name "*.pyc" \) -delete

%build
mkdir -p build/classes
cat >build/classes/edition.properties <<EOF
config=net.sf.saxon.Configuration
platform=net.sf.saxon.java.JavaPlatform
EOF

export CLASSPATH=%(build-classpath xml-commons-apis jdom xom bea-stax-api dom4j xml-commons-resolver12)
ant \
  -Dj2se.javadoc=%{_javadocdir}/java \
  -Djdom.javadoc=%{_javadocdir}/jdom

%install

# jars
mkdir -p $RPM_BUILD_ROOT%{_javadir}
cp -p build/lib/saxon.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar

# javadoc
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -pr build/api/* $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}
install -p -m755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/%{name}
install -p -m755 %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}q
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
install -p -m644 %{SOURCE4} $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
install -p -m644 %{SOURCE5} $RPM_BUILD_ROOT%{_mandir}/man1/%{name}q.1

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

# a simple POM
install -dm 755 $RPM_BUILD_ROOT%{_mavenpomdir}
install -m 644 %{SOURCE7} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom
sed -i -e 's/saxon-he/saxon/' $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom
#FIXME: some strange python exception even with javapackages-tools 0.3.1
# % add_maven_depmap JPP-%{name}.pom %{name}.jar
%add_to_maven_depmap JPP-%{name}.pom %{name}.jar

%clean
rm -rf $RPM_BUILD_ROOT

%post
update-alternatives --install %{_javadir}/jaxp_transform_impl.jar \
  jaxp_transform_impl %{_javadir}/%{name}.jar 25

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

%pre javadoc
# workaround for rpm bug
[ $1 -gt 1 ] && [ -L %{_javadocdir}/%{name} ] && \
rm -rf $(readlink -f %{_javadocdir}/%{name}) %{_javadocdir}/%{name} || :

%files
%defattr(0644,root,root,0755)
%{_javadir}/%{name}.jar
%{_mavenpomdir}/JPP-%{name}.pom
%{_mavendepmapfragdir}/%{name}
%ghost %{_javadir}/jaxp_transform_impl.jar

%files manual
%defattr(0644,root,root,0755)
%doc doc/*.html

%files javadoc
%defattr(0644,root,root,0755)
%doc %{_javadocdir}/%{name}

%files demo
%defattr(0644,root,root,0755)
%{_datadir}/%{name}

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

%changelog