Sophie

Sophie

distrib > Altlinux > 4.1 > i586 > by-pkgid > 8489c0b024616880107cc4c61daec47d > files > 2

oldcastor-0.9.6-alt3_2jpp1.7.src.rpm

BuildRequires: jakarta-commons-logging
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


Summary:        An open source data binding framework for Java
Name:           oldcastor
Version:        0.9.6
Release:        alt3_2jpp1.7
Epoch:          0
Group:          Development/Java
License:        Exolab Software License, BSD-like
URL:            http://castor.codehaus.org/
Source0:        http://dist.codehaus.org/castor/0.9.6/castor-0.9.6-src.tgz
Requires: adaptx
Requires: cglib
Requires: jta
Requires: ldapsdk
Requires: jakarta-oro
Requires: regexp
Requires: xerces-j2
BuildRequires: adaptx
BuildRequires: ant
BuildRequires: cglib
BuildRequires: jpackage-utils >= 0:1.6
BuildRequires: jta
BuildRequires: ldapsdk
BuildRequires: jakarta-oro
BuildRequires: regexp
BuildRequires: xerces-j2
%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

%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

%description test
Tests for %{name}.

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

%description xml
XML support for Castor.

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

%description javadoc
Javadoc for %{name}.

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

%description manual
Documentation for %{name}.

%prep
%setup -q -n castor-%{version}
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;' {} \;

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

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

# jar
%{__install} -d -m 755 %{buildroot}%{_javadir}
%{__install} -m 644 dist/castor-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
%{__install} -m 644 dist/castor-%{version}-xml.jar %{buildroot}%{_javadir}/%{name}-xml-%{version}.jar
%{__install} -m 644 dist/CTF-%{version}.jar %{buildroot}%{_javadir}/%{name}-tests-%{version}.jar
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}
export CLASSPATH=$(build-classpath gnu-crypto)
%{_bindir}/aot-compile-rpm
%endif

mkdir -p $RPM_BUILD_ROOT`dirname /etc/java/%{name}.conf`
touch $RPM_BUILD_ROOT/etc/java/%{name}.conf

%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

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

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

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

%if %{gcj_support}
%postun test
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}/%{name}-%{version}.jar.*
%endif
%config(noreplace,missingok) /etc/java/%{name}.conf

%files test
%{_javadir}/%{name}-tests-%{version}.jar
%{_javadir}/%{name}-tests.jar
%if %{gcj_support}
%{_libdir}/gcj/%{name}/%{name}-tests-%{version}.jar.*
%endif

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

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

%files manual
%doc build/doc/*

%changelog
* Tue Oct 30 2007 Igor Vlasenko <viy@altlinux.ru> 0:0.9.6-alt3_2jpp1.7
- fixed unmet /etc/java/oldcastor.conf

* Mon Oct 29 2007 Igor Vlasenko <viy@altlinux.ru> 0:0.9.6-alt2_2jpp1.7
- fixed unmet

* Sun Oct 28 2007 Igor Vlasenko <viy@altlinux.ru> 0:0.9.6-alt1_2jpp1.7
- converted from JPackage by jppimport script