LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File jakarta-slide-webdavclient.spec of Package jakarta-slide-webdavclient (Project home:cseader:branches:Java:packages)

#
# spec file for package jakarta-slide-webdavclient
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define _with_repolib 1
%define with_repolib %{?_with_repolib:1}%{!?_with_repolib:0}
%define without_repolib %{!?_with_repolib:1}%{?_with_repolib:0}
%define repodir %{_javadir}/repository.jboss.com/apache-slide/2.1-brew
%define repodirlib %{repodir}/lib
%define repodirsrc %{repodir}/src
%define section   devel
%define base_name slide
%define jakarta_version 2.1

Name:           jakarta-slide-webdavclient
Version:        %{jakarta_version}
Release:        0
Summary:        Slide WebDAV client
License:        Apache-2.0
Group:          Development/Libraries/Java
Url:            http://jakarta.apache.org/slide/
Source0:        jakarta-slide-webdavclient-src-2.1.tar.bz2
Source1:        %{name}.sh
Source2:        jakarta-slide-webdavclient-2.2-WebdavResource.java
Source3:        jakarta-slide-webdavclient-component-info.xml
Source4:        http://mirrors.ibiblio.org/pub/mirrors/maven2/slide/slide-webdavlib/2.1/slide-webdavlib-2.1.pom
# FIXME Temporary fix !!!
Patch0:         jakarta-slide-webdavclient-3.0-compat.patch
Patch1:         jakarta-slide-webdavclient-build-jdk15.patch
Patch2:         jakarta-slide-webdavclient-jdk15.patch
BuildArch:      noarch
BuildRequires:  java-devel
BuildRequires:  ant >= 1.6
BuildRequires:  ant-antlr
BuildRequires:  antlr
BuildRequires:  geronimo-j2ee-connector-1_5-api
BuildRequires:  jakarta-commons-httpclient3
BuildRequires:  jakarta-commons-transaction
BuildRequires:  javapackages-tools
BuildRequires:  jdom
BuildRequires:  xml-im-exporter
Requires:       geronimo-j2ee-connector-1_5-api
Requires:       jakarta-commons-httpclient3
Requires:       jakarta-commons-transaction
Requires:       jdom
Requires:       xml-im-exporter
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Slide includes a fully featured WebDAV client library and command line
client.



%if %{with_repolib}

%package	 repolib
Summary:        Slide WebDAV client
Group:          Development/Libraries/Java

%description	 repolib
Slide includes a fully featured WebDAV client library and command line
client.



%endif

%package        javadoc
Summary:        Slide WebDAV client
Group:          Development/Libraries/Java

%description    javadoc
Slide includes a fully featured WebDAV client library and command line
client.



%prep
%setup -q -n jakarta-slide-webdavclient-src-2.1
find . -name "*.jar" | xargs %{__rm}
#for j in $(find . -name "*.jar"); do
#	mv $j $j.no
#done
cp -p %{SOURCE2} clientlib/src/java/org/apache/webdav/lib/WebdavResource.java
%patch0 -b .sav
%patch1 -b .sav
%patch2 -b .sav

%build
export CLASSPATH=$(build-classpath \
antlr \
commons-httpclient3 \
commons-transaction \
geronimo-j2ee-1.4-apis \
jdom \
xml-im-exporter \
)
ant -v -d -Dbuild.sysclasspath=first

%install
install -dm 755 $RPM_BUILD_ROOT%{_bindir}
install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/webdavclient
install -dm 755 $RPM_BUILD_ROOT%{_javadir}/%{base_name}
install -pm 644 \
 dist/lib/jakarta-slide-webdavlib-%{jakarta_version}.jar \
 $RPM_BUILD_ROOT%{_javadir}/%{base_name}
ln -s jakarta-slide-webdavlib-%{jakarta_version}.jar \
 $RPM_BUILD_ROOT%{_javadir}/%{base_name}/%{name}-webdavlib-%{version}.jar
install -pm 644 \
 dist/lib/jakarta-slide-commandline-%{jakarta_version}.jar \
 $RPM_BUILD_ROOT%{_javadir}/%{base_name}
ln -s jakarta-slide-commandline-%{jakarta_version}.jar \
 $RPM_BUILD_ROOT%{_javadir}/%{base_name}/%{name}-commandline-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir}/%{base_name} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed  "s|-%{version}||g"`; done)
(cd $RPM_BUILD_ROOT%{_javadir}/%{base_name} && for jar in jakarta-*.jar; do ln -sf ${jar} `echo $jar| sed  "s|jakarta-||g"`; done)
#javadoc
install -dm 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr dist/doc/clientjavadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
# poms
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
install -pm 644 %{SOURCE4} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}.pom
#FIXME
# % add_maven_depmap JPP.%{name}.pom %{base_name}/jakarta-slide-webdavlib.jar

%if %{with_repolib}
	install -d -m 755 $RPM_BUILD_ROOT%{repodir}
	install -d -m 755 $RPM_BUILD_ROOT%{repodirlib}
	install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{repodir}/component-info.xml
        tag=`echo %{name}-%{version}-%{release} | sed 's|\.|_|g'`
        sed -i "s/@TAG@/$tag/g" $RPM_BUILD_ROOT%{repodir}/component-info.xml
        sed -i "s/@VERSION@/%{version}-brew/g" $RPM_BUILD_ROOT%{repodir}/component-info.xml
	install -d -m 755 $RPM_BUILD_ROOT%{repodirsrc}
	install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{repodirsrc}
	install -p -m 644 %{PATCH0} $RPM_BUILD_ROOT%{repodirsrc}
	install -p -m 644 %{SOURCE0} $RPM_BUILD_ROOT%{repodirsrc}
	cp -p $RPM_BUILD_ROOT%{_javadir}/slide/jakarta-slide-webdavlib.jar $RPM_BUILD_ROOT%{repodirlib}
%endif

%files
%defattr(0644,root,root,0755)
%doc LICENSE
%{_javadir}/%{base_name}/*.jar
%attr(0755,root,root) %{_bindir}/webdavclient
%{_mavenpomdir}/*
# % config %{_mavendepmapfragdir}/*
%dir %{_javadir}/%{base_name}

%files javadoc
%defattr(0644,root,root,0755)
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}
%if %{with_repolib}

%files repolib
%defattr(0644,root,root,0755)
%{repodir}
%dir %{_javadir}/repository.jboss.com
%dir %{_javadir}/repository.jboss.com/apache-%{base_name}
%endif

%changelog