File ldapjdk.spec of Package ldapjdk

#
# spec file for package ldapjdk (Version 4.17)
#
# 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/
#

# norootforbuild


Name:           ldapjdk
BuildRequires:  java2-devel-packages oro xerces-j2
%define name		ldapjdk
%define spname		ldapsp
%define version		4.17
%define tar_name	ldapsdk_java
%define tar_version	20020819
%define release		1jpp
%define section		free
Version:        4.17
Release:        270
Summary:        The Mozilla LDAP Java SDK
License:        MPL-1.1
Group:          Development/Libraries/Java
Url:            http://www.mozilla.org/directory/javasdk.html
Source0:        ftp://ftp.mozilla.org/pub/directory/java-sdk/%{tar_name}_%{tar_version}.tar.gz
# FIXME: A jpackage must be created for the
# Mozilla Network Security Services for Java (JSS)
Source2:        jss34.jar
Patch:          ldap-javasource14.patch
Requires:       oro
Requires:       jaas
Requires:       jndi
Requires:       jpackage-utils >= 1.5
Requires:       jsse
# Provides:	jndi-ldap = 1.3.0
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The Mozilla LDAP SDKs enable you to write applications that access,
manage, and update the information stored in an LDAP directory.



%package javadoc
License:        MPL-1.1
PreReq:         coreutils
Group:          Development/Libraries/Java
Summary:        Javadoc for ldapjdk
Obsoletes:      openjmx-javadoc

%description javadoc
The Mozilla LDAP SDKs enable you to write applications which access,
manage, and update the information stored in an LDAP directory.

This package contains the javadoc documentation for the Mozilla LDAP
SDKs.



%prep
%setup -q -c
%patch

%build
# cleanup CVS dirs
rm -fr $(find . -name CVS -type d)
# cleanup jars
rm -fr $(find . -name "*.jar"  -type f)
mv mozilla/directory/* .
rm -fr mozilla
cd java-sdk
if [ ! -e "$JAVA_HOME" ] ; then export JAVA_HOME="%{_jvmdir}/java" ; fi
# FIXME: A jpackage must be created for this
cp %{SOURCE2} .
export CLASSPATH=`pwd`/jss34.jar:%(build-classpath oro)
export MOZ_SRC=`pwd`
export JAVA_VERSION=1.4
# Main jar
%__make -f ldap.mk clean
%__make -f ldap.mk
%__make -f ldap.mk basepackage
%__make -f ldap.mk doc
# ldap jdndi service provides
%__make -f ldapsp.mk clean
%__make -f ldapsp.mk
%__make -f ldapsp.mk basepackage
%__make -f ldapsp.mk doc

%install
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -m 644 java-sdk/dist/packages/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
install -m 644 java-sdk/dist/packages/%{spname}.jar $RPM_BUILD_ROOT%{_javadir}/%{spname}-%{version}.jar
pushd $RPM_BUILD_ROOT%{_javadir}
	for jar in *-%{version}.jar ; do
		ln -fs ${jar} $(echo $jar | sed "s|-%{version}.jar|.jar|g")
	done
popd
# install -d -m 755 $RPM_BUILD_ROOT%{_javadir}-1.3.0
# 
# pushd $RPM_BUILD_ROOT%{_javadir}-1.3.0
# 	ln -fs ../java/*%{spname}.jar jndi-ldap.jar
# popd
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -r java-sdk/dist/doc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(0644,root,root,0755)
%doc buildjsdk.txt java-sdk/*.htm
%{_javadir}/%{name}*.jar
%{_javadir}/%{spname}*.jar
# %{_javadir}-1.3.0/*.jar

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

%changelog
* Thu Dec 14 2006 jsmeix@suse.de
- Removed xml-commons-apis from BuildRequires because xerces-j2
  already provides xml-commons-apis but xerces-j2 would be
  deinstalled when rpm installs xml-commons-apis after xerces-j2
  (which is rpm standard behaviour in this case) but without
  xerces-j2 the RPM capabilities jaxp_parser_impl and
  xml-commons-resolver are no longer provided in the
  installed system.
* Wed Sep 20 2006 ro@suse.de
- set source=1.4 for java
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Tue Oct 11 2005 jsmeix@suse.de
- Removed jndi, jaas, jsse, from build-classpath because
  those are not needed for build.
* Thu Jul 28 2005 jsmeix@suse.de
- Adjustments in the spec file.
* Mon Jul 18 2005 jsmeix@suse.de
- Current version 4.17 from JPackage.org
* Fri Feb 18 2005 skh@suse.de
- disable support for java 1.3.0
- don't use icecream
* Thu Sep 02 2004 skh@suse.de
- Initial package created with version 4.1 (JPackage 1.5)
openSUSE Build Service is sponsored by