Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37765509
en ru br
Репозитории ALT
S:1.4.19-alt1_2jpp11
5.1: 1.3.1-alt1_1jpp5
4.1: 1.2.2-alt1_1jpp1.7
4.0: 1.2.2-alt1_1jpp1.7
www.altlinux.org/Changes

Группа :: Разработка/Java
Пакет: xstream

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%define _without_maven 1
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

# If you don't want to build with maven, and use straight ant instead,

# give rpmbuild option '--without maven'

%define with_maven %{!?_without_maven:1}%{?_without_maven:0}
%define without_maven %{?_without_maven:1}%{!?_without_maven:0}


Name:           xstream
Version:        1.2.2
Release:        alt1_1jpp1.7
Epoch:          0
Summary:        XML serialization library

Group:          Development/Java
License:        BSD-Style
URL:            http://xstream.codehaus.org/
Source0:        http://repository.codehaus.org/com/thoughtworks/xstream/xstream-distribution/1.2.2/xstream-distribution-1.2.2-src.tar.bz2
Source1:        %{name}-settings.xml
Source2:        %{name}-jpp-depmap.xml

Patch0:         xstream-build_xml.patch
Patch1:         xstream-pom_xml.patch
Patch2:         xstream-xstream-pom_xml.patch
Patch3:         xstream-xstream-distribution-pom_xml.patch


Requires(post): jpackage-utils >= 0:1.7.2
Requires(postun): jpackage-utils >= 0:1.7.2

%if %{gcj_support}
BuildRequires: gnu-crypto
BuildRequires: java-gcj-compat-devel
Requires(post): java-gcj-compat
Requires(postun): java-gcj-compat
%endif

%if ! %{gcj_support}
BuildArch:      noarch
%endif

BuildRequires: jpackage-utils >= 0:1.7.2
BuildRequires: ant >= 0:1.6
%if %{with_maven}
BuildRequires: maven2-plugins >= 2.0.4-10jpp
BuildRequires: maven2-plugin-compiler
BuildRequires: maven2-plugin-install
BuildRequires: maven2-plugin-jar
BuildRequires: maven2-plugin-javadoc
BuildRequires: maven2-plugin-resources
BuildRequires: maven2-plugin-surefire
BuildRequires: xsite
%endif
BuildRequires: bea-stax >= 0:1.2.0
BuildRequires: bea-stax-api >= 0:1.0.1
BuildRequires: cglib >= 0:2.1.3
BuildRequires: dom4j >= 0:1.6.1
BuildRequires: jakarta-commons-lang >= 0:2.1
BuildRequires: jakarta-oro >= 0:2.0.8
BuildRequires: jdom >= 0:1.0
BuildRequires: jettison >= 0:1.0
BuildRequires: jmock >= 0:1.0.1
BuildRequires: joda-time >= 0:1.2.1
BuildRequires: junit >= 0:3.8.1
BuildRequires: wstx >= 0:3.2.0
BuildRequires: xom >= 0:1.0
BuildRequires: xpp3 >= 0:1.1.3.4

Requires: bea-stax-api
Requires: cglib
Requires: dom4j
Requires: jakarta-commons-lang
Requires: jakarta-oro
Requires: jdom
Requires: jettison
Requires: joda-time
Requires: wstx
Requires: xom
Requires: xpp3


%description
XStream is a simple library to serialize objects to XML
and back again. A high level facade is supplied that
simplifies common use cases. Custom objects can be serialized
without need for specifying mappings. Speed and low memory
footprint are a crucial part of the design, making it suitable
for large object graphs or systems with high message throughput.
No information is duplicated that can be obtained via reflection.
This results in XML that is easier to read for humans and more
compact than native Java serialization. XStream serializes internal
fields, including private and final. Supports non-public and inner
classes. Classes are not required to have default constructor.
Duplicate references encountered in the object-model will be
maintained. Supports circular references. By implementing an
interface, XStream can serialize directly to/from any tree
structure (not just XML). Strategies can be registered allowing
customization of how particular types are represented as XML.
When an exception occurs due to malformed XML, detailed diagnostics
are provided to help isolate and fix the problem.

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

%description    javadoc
%{summary}.

%if %{with_maven}
%package        manual
Summary:        Documents for %{name}
Group:          Development/Documentation

%description    manual
%{summary}.
%endif

%prep
%setup -q %{name}-%{version}
for j in $(find . -name "*.jar"); do
   mv $j $j.no
done
cp %{SOURCE1} settings.xml

%patch0 -b .sav
%patch1 -b .sav
%patch2 -b .sav
%patch3 -b .sav

# This test requires megginson's sax2

rm xstream/src/test/com/thoughtworks/xstream/io/xml/SaxWriterTest.java
# These sources are for Java5
rm -rf xstream/src/java/com/thoughtworks/xstream/annotations/
rm -rf xstream/src/test/com/thoughtworks/acceptance/annotations/

mkdir -p xstream-distribution/target/xsite

%build
%if %{with_maven}
sed -i -e "s|<url>__JPP_URL_PLACEHOLDER__</url>|<url>file://`pwd`/.m2/repository</url>|g" settings.xml
sed -i -e "s|<url>__JAVADIR_PLACEHOLDER__</url>|<url>file://`pwd`/external_repo</url>|g" settings.xml
sed -i -e "s|<url>__MAVENREPO_DIR_PLACEHOLDER__</url>|<url>file://`pwd`/.m2/repository</url>|g" settings.xml
sed -i -e "s|<url>__MAVENDIR_PLUGIN_PLACEHOLDER__</url>|<url>file:///usr/share/maven2/plugins</url>|g" settings.xml
sed -i -e "s|<url>__ECLIPSEDIR_PLUGIN_PLACEHOLDER__</url>|<url>file:///usr/share/eclipse/plugins</url>|g" settings.xml

export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
mkdir -p $MAVEN_REPO_LOCAL

mkdir external_repo
ln -s %{_javadir} external_repo/JPP

mvn-jpp \
       -e \
       -s $(pwd)/settings.xml \
       -Dmaven2.jpp.mode=true \
       -Dmaven2.jpp.depmap.file=%{SOURCE2} \
       -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
       install javadoc:javadoc

%else
cd xstream
pushd lib
# cglib-nodep-2.1_3.jar.no
ln -sf $(build-classpath cglib-nodep)
# commons-lang-2.1.jar.no
ln -sf $(build-classpath commons-lang)
# dom4j-1.6.1.jar.no
ln -sf $(build-classpath dom4j)
# jdom-1.0.jar.no
ln -sf $(build-classpath jdom)
# jettison-1.0-RC1.jar.no
ln -sf $(build-classpath jettison)
# jmock-1.0.1.jar.no
ln -sf $(build-classpath jmock)
# joda-time-1.2.1.jar.no
ln -sf $(build-classpath joda-time)
# junit-3.8.1.jar.no
ln -sf $(build-classpath junit)
# oro-2.0.8.jar.no
ln -sf $(build-classpath oro)
# stax-1.2.0.jar.no
ln -sf $(build-classpath bea-stax-ri)
# stax-api-1.0.1.jar.no
ln -sf $(build-classpath bea-stax-api)
# wstx-asl-3.2.0.jar.no
ln -sf $(build-classpath wstx/wstx-asl)
# xml-writer-0.2.jar.no

#xom-1.1.jar.no

ln -sf $(build-classpath xom)
# xpp3_min-1.1.3.4.O.jar.no
ln -sf $(build-classpath xpp3)
popd
ant library javadoc
%endif

%install
install -Dpm 644 xstream/target/%{name}-%{version}.jar \
 $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
%if %{with_maven}
install -Dpm 644 xstream-benchmark/target/%{name}-benchmark-%{version}.jar \
 $RPM_BUILD_ROOT%{_javadir}/%{name}-benchmark-%{version}.jar
%else
install -Dpm 644 xstream/target/%{name}-benchmark-%{version}.jar \
 $RPM_BUILD_ROOT%{_javadir}/%{name}-benchmark-%{version}.jar
%endif

%add_to_maven_depmap com.thoughtworks.xstream xstream %{version} JPP %{name}
%add_to_maven_depmap com.thoughtworks.xstream xstream-benchmark %{version} JPP %{name}-benchmark
%add_to_maven_depmap com.thoughtworks.xstream xstream-parent %{version} JPP %{name}-parent

(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed  "s|-%{version}||g"`; done)

# poms

install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
install -pm 644 pom.xml \
   $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}-parent.pom
install -pm 644 xstream/pom.xml \
   $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}.pom
install -pm 644 xstream-benchmark/pom.xml \
   $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}-benchmark.pom

#

install -dm 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/core
%if %{with_maven}
cp -pr xstream/target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/core
%else
cp -pr xstream/target/javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/core
%endif
install -dm 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/benchmark
%if %{with_maven}
cp -pr xstream-benchmark/target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/benchmark
%else
cp -pr xstream/target/javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/benchmark
%endif
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink

# manual

install -dm 755 $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/xsite
cp LICENSE.txt $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
%if %{with_maven}
rm -rf xstream-distribution/target/xsite/javadoc
cp -pr xstream-distribution/target/xsite/* $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/xsite
%endif

%if %{gcj_support}
export CLASSPATH=$(build-classpath gnu-crypto)
%{_bindir}/aot-compile-rpm
%endif

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

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

%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
%{_docdir}/%{name}-%{version}/LICENSE.txt
%{_javadir}/*.jar
%{_datadir}/maven2/poms/*
%{_mavendepmapfragdir}
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/%{name}-*%{version}.jar.*
%endif

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

%if %{with_maven}
%files manual
%doc %{_docdir}/%{name}-%{version}/xsite
%endif

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin