Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37045650
en ru br
ALT Linux repos
S:1.2.10-alt1_13jpp11
5.0: 1.2-alt1_0.b2.4jpp5
4.1: 1.0-alt3_6jpp1.7
4.0: 1.0-alt3_6jpp1.7

Group :: Development/Java
RPM: xom

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Packager: Igor Vlasenko <viy at altlinux.ru>
BuildRequires: dom4j
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()          %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
%define without()       %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
%define bcond_with()    %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
%define bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}

%bcond_with test
%bcond_with bootstrap

%define gcj_support 0


Name:           xom
Version:        1.2
Release:        alt1_0.b2.4jpp5
Epoch:          0
Summary:        XML Pull Parser
License:        LGPLv2+
URL:            http://www.xom.nu/
Group:          Development/Java
Source0:        http://www.cafeconleche.org/XOM/xom-1.2b2-src.tar.gz
Source1:        http://repo1.maven.org/maven2/xom/xom/1.2/xom-1.2.pom
Patch0:         xom-1.2b2-remove-jaxen.patch
Patch1:         xom-1.1-clean-dist.patch
Patch2:         xom-1.1-compile15.patch
Patch3:         xom-1.1-remove_sun_import.patch
Patch4:         xom-1.2b2-crosslink.patch
Patch5:         xom-1.1-sinjdoc.patch
Patch6:         xom-1.2b2-javadoc-stack-size.patch
BuildRequires: ant >= 0:1.6
BuildRequires: ant-junit
BuildRequires: java-javadoc
BuildRequires: jaxen
BuildRequires: junit
BuildRequires: junit-javadoc
BuildRequires: xalan-j2
BuildRequires: xerces-j2
BuildRequires: icu4j
BuildRequires: xml-commons-jaxp-1.3-apis

%if %without bootstrap
BuildRequires: tagsoup
BuildRequires: saxon
BuildRequires: jaxp_parser_impl
BuildRequires: xml-commons-resolver12
BuildRequires: servlet
%endif
Requires: xalan-j2
Requires: xerces-j2
Requires: icu4j
Requires: xml-commons-jaxp-1.3-apis
%if !%{gcj_support}
BuildArch:      noarch
%endif

%if %{gcj_support}
BuildRequires: java-gcj-compat-devel
%endif

%description
XOM is a new XML object model. It is an open source (LGPL),
tree-based API for processing XML with Java that strives
for correctness, simplicity, and performance, in that order.
XOM is designed to be easy to learn and easy to use. It
works very straight-forwardly, and has a very shallow
learning curve. Assuming you're already familiar with XML,
you should be able to get up and running with XOM very quickly.

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

%description javadoc
%{summary}.

%if %without bootstrap
%package demo
Summary:        Samples for %{name}
Group:          Development/Documentation
Requires: %{name} = %{epoch}:%{version}-%{release}

%description demo
%{summary}.
%endif

%prep
%setup -q -n XOM
# remove all binary libs
%{_bindir}/find . -name "*.jar" -o -name "*.class" | %{_bindir}/xargs -t %{__rm}
%patch0 -p0
%patch1 -p0
%patch2 -p1
%patch3 -p1
%patch4 -p1
# XXX: (dwalluck): Required only for sinjdoc
%if 0
%patch5 -p1
%endif
%patch6 -p1
%{__perl} -pi -e 's/\r$//g' *.html *.txt
%{__perl} -pi -e 's/compress="no"/compress="yes"/g' build.xml

%build
export CLASSPATH=$(build-classpath jaxen)
export OPT_JAR_LIST="junit ant/ant-junit"
export ANT_OPTS="-Xss5m"
pushd lib
ln -sf $(build-classpath junit) junit.jar
ln -sf $(build-classpath xerces-j2) xercesImpl.jar
ln -sf $(build-classpath xalan-j2) xalan.jar
ln -sf $(build-classpath icu4j) normalizer.jar
ln -sf $(build-classpath xml-commons-jaxp-1.3-apis) xmlParserAPIs.jar
popd
mkdir lib2
%if %without bootstrap
pushd lib2
ln -sf $(build-classpath tagsoup) tagsoup-1.0rc1.jar
ln -sf $(build-classpath saxon) saxon.jar
ln -sf $(build-classpath jaxp_parser_impl) gnujaxp.jar
ln -sf $(build-classpath xml-commons-resolver12) resolver.jar
DOM4J_PRESENT=$(build-classpath dom4j 2>/dev/null || :)
if [ -n "$DOM4J_PRESENT" ]; then
ln -sf $(build-classpath dom4j) dom4j-1.5.1.jar
fi
ln -sf $(build-classpath servlet) servlet.jar
popd
%endif

ant -Dant.build.javac.source=1.4 -Dant.build.javac.target=1.4 -Dbuild.sysclasspath=first -Dj2se.api=%{_javadocdir}/java -Djunit.api=%{_javadocdir}/junit jar javadoc
%if %without bootstrap
ant -Dant.build.javac.source=1.4 -Dant.build.javac.target=1.4 -Dbuild.sysclasspath=first samples
%if %with test
ant -Dant.build.javac.source=1.4 -Dant.build.javac.target=1.4 -Dbuild.sysclasspath=first test
%endif
%endif

%install

# jars

install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -m 644 build/xom-1.2b2.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)

# poms

%add_to_maven_depmap %{name} %{name} %{version} JPP %{name}
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
install -pm 644 %{SOURCE1} \
   $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP-%{name}.pom

# javadoc

install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -a build/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}

%if %without bootstrap
# demo
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}
install -m 644 build/xom-samples.jar $RPM_BUILD_ROOT%{_datadir}/%{name}
install -m 644 xom.graffle $RPM_BUILD_ROOT%{_datadir}/%{name}
%endif

%if %{gcj_support}
%{_bindir}/aot-compile-rpm
%endif

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

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

%files
%doc overview.html README.txt LICENSE.txt Todo.txt lgpl.txt
%if %without bootstrap
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/xom.graffle
%endif
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-%{version}.jar
%{_datadir}/maven2/poms/*
%{_mavendepmapfragdir}/*
%if %{gcj_support}
%dir %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/*
%endif

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

%if %without bootstrap
%files demo
%{_datadir}/%{name}/xom-samples.jar
%endif

%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