LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File jxta.spec of Package jxta (Project Java:jpackage-1.7)

# 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 %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}

%define	section		free


Name:		jxta
Summary:	JXTA P2P protocols
Url:		http://www.jxta.org/
Version:	2.3.2
Release:	0
License:	Apache 1.1 -style License
Group:		Development/Libraries/Java
Vendor:		JPackage Project
Distribution:	JPackage
Source0:	http://download.jxta.org/build/release/2.3.2/jxta-src-2.3.2.tar.gz
Source1:	jxta_license.txt
Patch0:		jxta-2.3.2-build_xml.patch
Patch1:		jxta-2.3.2-HttpMessageReceiver.patch

BuildRequires:	jpackage-utils >= 1.6
BuildRequires:	ant
BuildRequires:	junit
BuildRequires:	java-devel >= 1.4
BuildRequires:	servletapi5
BuildRequires:	jetty5
BuildRequires:	log4j
BuildRequires:	bouncycastle
BuildRequires:	jaxen
BuildRequires:	jdom
BuildRequires:	swixml
BuildRequires:	xerces-j2
BuildRequires:	xml-commons-apis
%if %defined suse_version
BuildRequires:  unzip
%endif
Requires:	java >= 1.4
Requires:	servletapi5
Requires:	jetty5
Requires:	log4j
Requires:	bouncycastle
Requires:	jaxen
Requires:	jdom
Requires:	swixml
Requires:	xerces-j2
Requires:	xml-commons-apis
%if %{gcj_support}
BuildRequires:          java-gcj-compat-devel
Requires(post):         java-gcj-compat
Requires(postun):       java-gcj-compat
%endif
%if ! %{gcj_support}
BuildArch:      noarch
%endif
BuildRoot:	%{_tmppath}/%{name}-%{version}-buildroot

%description
JXTA(tm) technology is a set of open protocols that allow 
any connected device on the network ranging from cell 
phones and wireless PDAs to PCs and servers to communicate 
and collaborate in a P2P manner. 

JXTA peers create a virtual network where any peer can 
interact with other peers and resources directly even when 
some of the peers and resources are behind firewalls and 
NATs or are on different network transports.


%package javadoc
Summary:	Javadoc for %{name}
Group:		Development/Documentation
Requires(post):   /bin/rm,/bin/ln
Requires(postun): /bin/rm

%description javadoc
Javadoc for %{name}.

%prep
%setup -q -c -n %{name}-%{version}
chmod -R go=u-w *
cp %{SOURCE1} jxta_license.txt
for j in $(find . -name "*.jar"); do
	mv $j $j.no
done

%patch0 -b .sav
%patch1 -b .sav

%build
pushd lib
ln -sf $(build-classpath servletapi5) javax.servlet.jar
ln -sf $(build-classpath jetty5/jetty5) org.mortbay.jetty.jar
ln -sf $(build-classpath log4j) log4j.jar
ln -sf $(build-classpath bouncycastle-jdk1.4/bcprov) bcprov-jdk14.jar
popd
pushd ext/lib
ln -sf $(build-classpath jaxen) jaxen-core.jar
ln -sf $(build-classpath jaxen) saxpath.jar
ln -sf $(build-classpath jaxen) jaxen-jdom.jar
ln -sf $(build-classpath jdom)
ln -sf $(build-classpath swixml)
ln -sf $(build-classpath xerces-j2)
ln -sf $(build-classpath xml-commons-apis)
popd
pushd tools
ln -sf $(build-classpath junit) junit.jar
popd
ant jar javadoc service jxtaSwing runtest

%install
# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -m 644 dist/jxta.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
install -m 644 dist/jxtaext.jar $RPM_BUILD_ROOT%{_javadir}/%{name}ext-%{version}.jar
install -m 644 dist/jxtaSwing.jar $RPM_BUILD_ROOT%{_javadir}/%{name}Swing-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed  "s|-%{version}||g"`; done)
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}
install -m 644 dist/jxtaextservice.war $RPM_BUILD_ROOT%{_datadir}/%{name}

# javadoc
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/api
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/impl
cp -pr www/java/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/api
cp -pr www/java/impl/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/impl
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink

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

%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

%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

%files
%defattr(-,root,root)
%doc jxta_license.txt
%{_javadir}/*
%{_datadir}/%{name}
%if %{gcj_support}
%attr(-,root,root) %dir %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/%{name}*%{version}.jar.*
%endif

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

%changelog
- Tue Aug 03 2010 Peter Linnell mrdocs@opensuse.org
- Nuke Epoch
- try to build against java 1.5
* Tue Oct 17 2006 Ralph Apel <r.apel at r-apel.de> 0:2.3.2-2jpp
- First JPP-1.7 release
- Add post/postun Requires for javadoc
- Add gcj_support option

* Tue Mar 01 2005 Ralph Apel <r.apel at r-apel.de> 0:2.3.2-1jpp
- First release