File crimson.spec of Package crimson

#
# spec file for package crimson (Version 1.1.3)
#
# Copyright (c) 2008 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/
#


%define section free

Name:           crimson
Version:        1.1.3
Release:        2
Summary:        Java XML parser
Group:          Development/Libraries/Java
License:        The Apache Software License
Url:            http://xml.apache.org/crimson
Source0:        http://xml.apache.org/dist/%{name}/%{name}-%{version}-src.tar.bz2
Patch0:         %{name}-noapis.patch
Patch1:         %{name}-javac6-build.patch
Patch2:         %{name}-javac-target-15.patch
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Provides:       jaxp_parser_impl
BuildRequires:  ant
BuildRequires:  jpackage-utils >= 1.6
BuildRequires:  xml-commons-apis
BuildRequires:  java-devel
Requires:       xml-commons-apis
Requires(post): /usr/sbin/update-alternatives
Requires(preun): /usr/sbin/update-alternatives
Requires:       jpackage-utils >= 1.7

%description
Crimson is a Java XML parser which supports XML 1.0 via the
   following APIs: - Java API for XML Processing (JAXP) 1.1 minus
   the javax.xml.transform package. JAXP is a pluggable API that
   allows applications to access XML documents in a
   parser-independent manner. It endorses the industry standard SAX
   and DOM APIs and also adds a few classes under the
   javax.xml.parsers package to implement pluggability and utility
   methods Note: the javax.xml.transform package hierarchy of JAXP
   is not implemented by Crimson. One implementation of
   javax.xml.transform can be found at Xalan Java 2.

- SAX 2.0

- SAX2 Extensions version 1.0

- DOM Level 2 Core Recommendation



%package manual
License:        The Apache Software License
Summary:        Java XML parser
Group:          Development/Libraries/Java

%description manual
Crimson is a Java XML parser which supports XML 1.0 via the
   following APIs: - Java API for XML Processing (JAXP) 1.1 minus
   the javax.xml.transform package. JAXP is a pluggable API that
   allows applications to access XML documents in a
   parser-independent manner. It endorses the industry standard SAX
   and DOM APIs and also adds a few classes under the
   javax.xml.parsers package to implement pluggability and utility
   methods Note: the javax.xml.transform package hierarchy of JAXP
   is not implemented by Crimson. One implementation of
   javax.xml.transform can be found at Xalan Java 2.

- SAX 2.0

- SAX2 Extensions version 1.0

- DOM Level 2 Core Recommendation



%package javadoc
License:        The Apache Software License
Summary:        Java XML parser
Group:          Development/Libraries/Java

%description javadoc
Crimson is a Java XML parser which supports XML 1.0 via the
   following APIs: - Java API for XML Processing (JAXP) 1.1 minus
   the javax.xml.transform package. JAXP is a pluggable API that
   allows applications to access XML documents in a
   parser-independent manner. It endorses the industry standard SAX
   and DOM APIs and also adds a few classes under the
   javax.xml.parsers package to implement pluggability and utility
   methods Note: the javax.xml.transform package hierarchy of JAXP
   is not implemented by Crimson. One implementation of
   javax.xml.transform can be found at Xalan Java 2.

- SAX 2.0

- SAX2 Extensions version 1.0

- DOM Level 2 Core Recommendation



%package demo
License:        The Apache Software License
Summary:        Java XML parser
Group:          Development/Libraries/Java
Requires:       %{name} = %{version}-%{release}

%description demo
Crimson is a Java XML parser which supports XML 1.0 via the
   following APIs: - Java API for XML Processing (JAXP) 1.1 minus
   the javax.xml.transform package. JAXP is a pluggable API that
   allows applications to access XML documents in a
   parser-independent manner. It endorses the industry standard SAX
   and DOM APIs and also adds a few classes under the
   javax.xml.parsers package to implement pluggability and utility
   methods Note: the javax.xml.transform package hierarchy of JAXP
   is not implemented by Crimson. One implementation of
   javax.xml.transform can be found at Xalan Java 2.

- SAX 2.0

- SAX2 Extensions version 1.0

- DOM Level 2 Core Recommendation



%prep
%setup -q
%patch0 -p0
%patch1 -b .sav1
%patch2 -b .sav2

%build
export CLASSPATH=$(build-classpath xml-commons-apis)
ant jar javadoc

%install
# jars
%{__mkdir} -p ${RPM_BUILD_ROOT}%{_javadir}
%{__cp} -p build/%{name}.jar \
    ${RPM_BUILD_ROOT}%{_javadir}/%{name}-%{version}.jar
(
    cd $RPM_BUILD_ROOT%{_javadir}
    for jar in *-%{version}*; do 
        %{__ln_s} -f ${jar} `echo $jar | sed "s|-%{version}||g"`
    done
)
# javadoc
%{__mkdir} -p ${RPM_BUILD_ROOT}%{_javadocdir}/%{name}-%{version}
%{__cp} -pr build/docs/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 examples ${RPM_BUILD_ROOT}%{_datadir}/%{name}
# jaxp_parser_impl ghost symlink
%{__ln_s} %{_sysconfdir}/alternatives \
    ${RPM_BUILD_ROOT}%{_javadir}/jaxp_parser_impl.jar

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%post
update-alternatives --install %{_javadir}/jaxp_parser_impl.jar \
    jaxp_parser_impl %{_javadir}/%{name}.jar 20

%preun
if [ "$1" -eq 0 ]; then
    update-alternatives --remove jaxp_parser_impl %{_javadir}/%{name}.jar
fi

%files
%defattr(0644,root,root,0755)
%doc ChangeLog README.txt
%{_javadir}/%{name}*.jar
%ghost %{_javadir}/jaxp_parser_impl.jar

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

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

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

%changelog
* Fri Aug 22 2008 mvyskocil@suse.cz
- Initial packaging in SUSE - version 1.1.13 (based on JPP1.7)
openSUSE Build Service is sponsored by