Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37659087
en ru br
ALT Linux repositórios
5.0: 1.1.2.1-alt1_4jpp5
4.1: 0.9.9.1-alt1_2jpp1.7
4.0: 0.9.9.1-alt1_2jpp1.7

Group :: Desenvolvimento/Java
RPM: castor

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

BuildRequires: jakarta-commons-logging
BuildRequires: /proc
BuildRequires: jpackage-1.4-compat
# 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.
#

%define gcj_support 0

# If you don't want to run the unit tests

# give rpmbuild option '--without tests'

%define with_tests %{!?_without_tests:1}%{?_without_tests:0}
%define without_tests %{?_without_tests:1}%{!?_without_tests:0}


Summary:        An open source data binding framework for Java
Name:           castor
Version:        0.9.9.1
Release:        alt1_2jpp1.7
Epoch:          0
Group:          Development/Java
License:        Exolab Software License, BSD-like
URL:            http://castor.codehaus.org/
#http://dist.codehaus.org/castor/0.9.9.1/castor-0.9.9.1-src.tgz
Source0:        castor-0.9.9.1-src.tgz
%if ! %{gcj_support}
BuildArch:      noarch
%endif
Requires: adaptx
Requires: cglib
Requires: java
Requires: jdbc-stdext
Requires: jndi
Requires: jta
Requires: ldapsdk
Requires: oro
Requires: regexp
Requires: xerces-j2
BuildRequires: adaptx
BuildRequires: ant
BuildRequires: cglib
##BuildRequires: java-devel
BuildRequires: jdbc-stdext
BuildRequires: jndi
BuildRequires: jpackage-utils >= 0:1.6
BuildRequires: jta
BuildRequires: ldapsdk
BuildRequires: oro
BuildRequires: regexp
BuildRequires: xerces-j2

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

%description
Castor is an open source data binding framework for Java. It's basically
the shortest path between Java objects, XML documents and SQL tables.
Castor provides Java to XML binding, Java to SQL persistence, and then
some more.

%package test
Group:          Development/Java
Summary:        Tests for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: junit
BuildRequires: junit

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

%description test
Tests for %{name}.

%package xml
Group:          Development/Java
Summary:        XML support for %{name}.
Requires: %{name} = %{epoch}:%{version}-%{release}

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

%description xml
XML support for Castor.

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

%description javadoc
Javadoc for %{name}.

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

%description doc
Documentation for %{name}.

%prep
%setup -q
find . -name "*.jar" -exec rm -f {} \;
perl -p -i -e 's|org.apache.xerces.utils.regex|org.apache.xerces.impl.xpath.regex|g;' \
src/main/org/exolab/castor/util/XercesRegExpEvaluator.java
find . -name "*.java" -exec perl -p -i -e 's|assert\(|assertTrue\(|g;' {} \;
find . -name "*.java" -exec perl -p -i -e 's|_test.name\(\)|_test.getName\(\)|g;' {} \;

# FIXME: These tests require mockejb, which we don't have yet.

rm -f src/tests/jdo/JDOJ2EECategory.java
rm -f src/tests/jdo/TestTransactionManagedEnvironment.java

%build
[ -z "$JAVA_HOME" ] && export JAVA_HOME=%{_jvmdir}/java
export CLASSPATH=%(build-classpath adaptx jdbc-stdext cglib jndi jta junit ldapsdk oro regexp xerces-j2)
ant -buildfile src/build.xml jar
%if %{with_tests}
ant -buildfile src/build.xml CTFjar
%endif
ant -buildfile src/build.xml javadoc

%install
%{__rm} -rf %{buildroot}

# jar

%{__install} -d -m 755 %{buildroot}%{_javadir}
%{__install} -m 644 dist/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
%{__install} -m 644 dist/%{name}-%{version}-xml.jar %{buildroot}%{_javadir}/%{name}-xml-%{version}.jar
%if %{with_tests}
%{__install} -m 644 dist/CTF-%{version}.jar %{buildroot}%{_javadir}/%{name}-tests-%{version}.jar
%endif
pushd %{buildroot}%{_javadir}
  for jar in *-%{version}.jar; do
     ln -sf ${jar} $(echo $jar| sed  -e "s|-%{version}||g")
  done
popd

# javadoc

%{__install} -d -m 755 %{buildroot}%{_javadocdir}/%{name}-%{version}
%{__cp} -pr build/doc/javadoc/* %{buildroot}%{_javadocdir}/%{name}-%{version}

# do this last, since it will delete all build directories

export CLASSPATH=%(build-classpath adaptx)
ant -buildfile src/build.xml doc

# like magic

%jpackage_script org.exolab.castor.builder.SourceGenerator %{nil} %{nil} xerces-j2:%{name} %{name}

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

%clean
%{__rm} -rf %{buildroot}

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

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

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

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

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

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

%files
%doc src/etc/{CHANGELOG,LICENSE,README}
%attr(0755,root,root) %{_bindir}/%{name}
%{_javadir}/%{name}-%{version}.jar
%{_javadir}/%{name}.jar
%if %{gcj_support}
%dir %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/castor-0.9.9.1.jar.*
%endif

%if %{with_tests}
%files test
%{_javadir}/%{name}-tests-%{version}.jar
%{_javadir}/%{name}-tests.jar
%endif

%if %{gcj_support}
%dir %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/castor-test-0.9.9.1.jar.*
%endif

%files xml
%{_javadir}/%{name}-xml-%{version}.jar
%{_javadir}/%{name}-xml.jar

%if %{gcj_support}
%dir %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/castor-xml-0.9.9.1.jar.*
%endif

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

%files doc
%doc build/doc/*

%changelog

Todas as alterações você pod ver aqui

 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009