File jcifs.spec of Package jcifs

#
# spec file for package jcifs (Version 1.3.8)
#
# Copyright (c) 2009 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 section free

Name:           jcifs
Version:        1.3.8
Release:        2
Summary:        Common Internet File System Client in 100% Java
License:        LGPL v2.1 or later
Url:            http://jcifs.samba.org/
Source0:        http://jcifs.samba.org/src/jcifs-%{version}.tar.bz2
Group:          Development/Libraries/Java
Requires:       servlet_2_4_api
BuildRequires:  ant
BuildRequires:  java-devel
BuildRequires:  geronimo-servlet-2_4-api
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The jCIFS SMB client library enables any Java application to remotely
access shared files and directories on SMB file servers(i.e. a
Microsoft Windows "share") in addition to domain, workgroup, and server
enumeration of NetBIOS over TCP/IP networks. It is an advanced
implementation of the CIFS protocol supporting Unicode, batching,
multiplexing of threaded callers, encrypted authentication,
transactions, the Remote Access Protocol (RAP), and much more. It is
licensed under LGPL which means commercial organizations can
legitimately use it with their proprietary code(you just can't sell or
give away a modified binary only version of the library itself without
reciprocation).



%package javadoc
License:        LGPL v2.1 or later
Summary:        Common Internet File System Client in 100% Java
Group:          Development/Libraries/Java

%description javadoc
The jCIFS SMB client library enables any Java application to remotely
access shared files and directories on SMB file servers(i.e. a
Microsoft Windows "share") in addition to domain, workgroup, and server
enumeration of NetBIOS over TCP/IP networks. It is an advanced
implementation of the CIFS protocol supporting Unicode, batching,
multiplexing of threaded callers, encrypted authentication,
transactions, the Remote Access Protocol (RAP), and much more. It is
licensed under LGPL which means commercial organizations can
legitimately use it with their proprietary code(you just can't sell or
give away a modified binary only version of the library itself without
reciprocation).



%package demo
License:        LGPL v2.1 or later
Summary:        Common Internet File System Client in 100% Java
Requires:       %{name} = %{version}
Group:          Development/Libraries/Java

%description demo
The jCIFS SMB client library enables any Java application to remotely
access shared files and directories on SMB file servers(i.e. a
Microsoft Windows "share") in addition to domain, workgroup, and server
enumeration of NetBIOS over TCP/IP networks. It is an advanced
implementation of the CIFS protocol supporting Unicode, batching,
multiplexing of threaded callers, encrypted authentication,
transactions, the Remote Access Protocol (RAP), and much more. It is
licensed under LGPL which means commercial organizations can
legitimately use it with their proprietary code(you just can't sell or
give away a modified binary only version of the library itself without
reciprocation).



%prep
%setup -q -n %{name}_%{version}
find . -name "*.jar" | xargs -t rm
# failed to build
rm examples/GetLocalGroupsMap.java

%build
export CLASSPATH=$(build-classpath servlet_2_4_api)
export OPT_JAR_LIST=:
%ant -Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 jar javadoc
export CLASSPATH=$(build-classpath servlet_2_4_api):`pwd`/%{name}-%{version}.jar
(cd examples && %javac -target 1.5 -source 1.5 *.java)

%install
# jar
mkdir -p %{buildroot}%{_javadir}
install -p -m 644 %{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} ${jar/-%{version}/}; done)
# javadoc
mkdir -p %{buildroot}%{_javadocdir}/%{name}-%{version}
cp -pr docs/api/* %{buildroot}%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}
# data
mkdir -p %{buildroot}%{_datadir}/%{name}/examples
cp -pr examples/*{.class,.java} %{buildroot}%{_datadir}/%{name}/examples

%clean
rm -rf %{buildroot}

%files
%defattr(0644,root,root,0755)
%doc README.txt docs/*.{html,txt,gif}
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-%{version}.jar

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

%files demo
%defattr(0644,root,root,0755)
%{_datadir}/%{name}

%changelog
* Thu May 14 2009 mvyskocil@suse.cz
- 'Initial SUSE packaging (from jpackage.5.0)'
openSUSE Build Service is sponsored by