File nanoxml.spec of Package nanoxml

# Copyright (c) 2000-2005, 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.
#


Name:           nanoxml
Summary:        NanoXML is a small XML parser for Java
Version:        2.2.3
Release:        5 
License:        zlib/libpng License
Group:          Text Processing/Markup/XML
Url:            http://nanoxml.cyberelf.be/
Vendor:         openSUSE-Education
Source0:        NanoXML-2.2.3.tar.bz2
Source1:        %{name}-java-1.4.2-package-list
Patch0:         %{name}-build.patch
Patch1:         %{name}-%{version}_build.patch
Patch2:         %{name}-%{version}_enum.patch
Recommends:     %{name}-manual = %{version}
BuildRequires:  jpackage-utils >= 1.6 
BuildRequires:  java-devel
%if 0%{?suse_version}
BuildRequires:  unzip
%endif
Requires:       java
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot

%description
The intent of NanoXML is to be a small parser which is easy to use.
Although many features were added to NanoXML, it is very small.
The full parser with builder fits in a JAR file of about 32K.


Author:
-------
    Marc De Scheemaecker


%package        lite
Summary:        Lite version of %{name}
Group:          Text Processing/Markup/XML
License:        zlib/libpng License
Recommends:     %{name}-manual-lite = %{version}

%description    lite
Lite version of %{name} - the small XML parser.


Author:
-------
    Marc De Scheemaecker


%package        manual
Summary:        Manual for %{name}
Group:          Text Processing/Markup/XML
License:        zlib/libpng License
Recommends:     %{name} = %{version}

%description    manual
Documentation for %{name}, the small XML parser which is easy to use.


Author:
-------
    Marc De Scheemaecker


%package        manual-lite
Summary:        Manual for the lite version of %{name}
Group:          Text Processing/Markup/XML
License:        zlib/libpng License
Recommends:     %{name}-lite = %{version}

%description    manual-lite
Documentation for the lite version of %{name}.


Author:
-------
    Marc De Scheemaecker


%package        javadoc
Summary:        Javadoc for %{name}
Group:          Text Processing/Markup/XML
License:        zlib/libpng License

%description    javadoc
Java documentation for %{name}.

Author:
-------
    Marc De Scheemaecker


%prep
%setup -q -n NanoXML-%{version}
%patch0
%patch1
%patch2
cp %{SOURCE1} package-list
find . -name "*.jar" | xargs -r rm -f

%build
sh ./build.sh

%install
# jars
install -dm 755 $RPM_BUILD_ROOT%{_javadir}
install -pm 644 Output/%{name}-lite.jar \
  $RPM_BUILD_ROOT%{_javadir}/%{name}-lite-%{version}.jar
install -pm 644 Output/%{name}-sax.jar \
  $RPM_BUILD_ROOT%{_javadir}/%{name}-sax-%{version}.jar
install -pm 644 Output/%{name}.jar \
  $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)

# javadoc
install -dm 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr Documentation/JavaDoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink

%clean
rm -rf $RPM_BUILD_ROOT

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

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

%files
%defattr(-,root,root,-)
%{_javadir}/%{name}-%{version}.jar
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-sax-%{version}.jar
%{_javadir}/%{name}-sax.jar

%files lite
%defattr(-,root,root,-)
%{_javadir}/%{name}-lite-%{version}.jar
%{_javadir}/%{name}-lite.jar

%files manual
%defattr(0644,root,root,0755)
%doc Documentation/NanoXML-Java/*

%files manual-lite
%defattr(0644,root,root,0755)
%doc Documentation/NanoXML-Lite/*

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


%changelog
openSUSE Build Service is sponsored by