-%define nspr_version 1:4.6
-%define nss_version 1:3.11
-%define svrcore_version 4.0.1
-%define major 5
-%define minor 17
+%define nspr_version 4.6
+%define nspr_evr 1:%{nspr_version}
+%define nss_version 3.11
+%define nss_evr 1:%{nss_version}
+%define svrcore_version 4.0.3
Summary: Mozilla LDAP C SDK
-Summary(pl): Mozilla LDAP C SDK
+Summary(pl.UTF-8): Biblioteki Mozilla LDAP C SDK
Name: mozldap
-Version: %{major}.%{minor}
-Release: 0.1
-License: MPL/GPL/LGPL
-Group: System
-Source0: ftp://ftp.mozilla.org/pub/mozilla.org/directory/c-sdk/releases/v%{major}.17/src/ldapcsdk-%{version}.tar.gz
-# Source0-md5 453341111111111
-URL: http://www.mozilla.org/directory/csdk.html
+Version: 6.0.5
+Release: 1
+License: MPL v1.1 or GPL v2+ or LGPL v2.1+
+Group: Libraries
+Source0: ftp://ftp.mozilla.org/pub/mozilla.org/directory/c-sdk/releases/v%{version}/src/%{name}-%{version}.tar.gz
+# Source0-md5: 9719bd5b9efc13f810c85a47fb8c6412
+Patch0: %{name}-link.patch
+Patch1: %{name}-ac.patch
+URL: http://wiki.mozilla.org/LDAP_C_SDK
+BuildRequires: autoconf >= 2.13
+BuildRequires: cyrus-sasl-devel >= 2.0
BuildRequires: gawk
-BuildRequires: nspr-devel >= %{nspr_version}
-BuildRequires: nss-devel >= %{nss_version}
+BuildRequires: libstdc++-devel
+BuildRequires: nspr-devel >= %{nspr_evr}
+BuildRequires: nss-devel >= %{nss_evr}
+BuildRequires: perl-base
BuildRequires: pkgconfig
BuildRequires: svrcore-devel >= %{svrcore_version}
-Requires: nspr >= %{nspr_version}
-Requires: nss >= %{nss_version}
-Provides: mozldap
+Requires: nspr >= %{nspr_evr}
+Requires: nss >= %{nss_evr}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+%define _noautoreqdep libldap60.so libprldap60.so libssldap60.so libldif60.so
+
%description
The Mozilla LDAP C SDK is a set of libraries that allow applications
to communicate with LDAP directory servers. These libraries are
derived from the University of Michigan and Netscape LDAP libraries.
They use Mozilla NSPR and NSS for crypto.
-%package tools
-Summary: Tools for the Mozilla LDAP C SDK
-Group: System
-BuildRequires: nspr-devel >= %{nspr_version}
-BuildRequires: nss-devel >= %{nss_version}
-BuildRequires: svrcore-devel >= %{svrcore_version}
-Requires: mozldap = %{version}-%{release}
-Provides: mozldap-tools
-
-%description tools
-The mozldap-tools package provides the ldapsearch, ldapmodify, and
-ldapdelete tools that use the Mozilla LDAP C SDK libraries.
+%description -l pl.UTF-8
+Mozilla LDAP C SDK to zestaw bibliotek pozwalających aplikacjom
+komunikować się z serwerami usług katalogowych LDAP. Biblioteki te
+wywodzą się z bibliotek LDAP University of Michigan i Netscape.
+Wykorzystują biblioteki Mozilla NSPR i NSS do kryptografii.
%package devel
-Summary: Development libraries and examples for Mozilla LDAP C SDK
+Summary: Development files and examples for Mozilla LDAP C SDK
+Summary(pl.UTF-8): Pliki programistyczne i przykłady dla bibliotek Mozilla LDAP C SDK
Group: Development/Libraries
-BuildRequires: nspr-devel >= %{nspr_version}
-BuildRequires: nss-devel >= %{nss_version}
-Requires: mozldap = %{version}-%{release}
-Provides: mozldap-devel
+Requires: %{name} = %{version}-%{release}
+Requires: nspr-devel >= %{nspr_evr}
+Requires: nss-devel >= %{nss_evr}
%description devel
-Header and Library files for doing development with the Mozilla LDAP C
-SDK
+Header and other files for doing development with the Mozilla LDAP C
+SDK.
-%prep
-%setup -q
+%description devel -l pl.UTF-8
+Pliki nagłówkowe i inne do tworzenia oprogramowania z użyciem
+bibliotek Mozilla LDAP C SDK
-%build
-%ifarch x86_64 ppc64 ia64 s390x
-arg64="--enable-64bit"
-%endif
+%package static
+Summary: Static Mozilla LDAP C SDK libraries
+Summary(pl.UTF-8): Statyczne biblioteki Mozilla LDAP C SDK
+Group: Development/Libraries
+Requires: %{name}-devel = %{version}-%{release}
+
+%description static
+Static Mozilla LDAP C SDK libraries.
-%configure $arg64 \
- --with-nss \
- --with-system-svrcore \
- --enable-optimize \
- --disable-debug
+%description static -l pl.UTF-8
+Statyczne biblioteki Mozilla LDAP C SDK.
-# Enable compiler optimizations and disable debugging code
-BUILD_OPT=1
-export BUILD_OPT
+%package tools
+Summary: Tools for the Mozilla LDAP C SDK
+Summary(pl.UTF-8): Narzędzia dla bibliotek Mozilla LDAP C SDK
+Group: Applications/System
+Requires: %{name} = %{version}-%{release}
+Requires: svrcore >= %{svrcore_version}
-# Generate symbolic info for debuggers
-XCFLAGS=%{rpmcflags}
-export XCFLAGS
+%description tools
+The mozldap-tools package provides the ldapsearch, ldapmodify, and
+ldapdelete tools that use the Mozilla LDAP C SDK libraries.
-PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
-PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
+%description tools -l pl.UTF-8
+Ten pakiet dostarcza narzędzia ldapsearch, ldapmodify i ldapdelete
+wykorzystujące biblioteki Mozilla LDAP C SDK.
-export PKG_CONFIG_ALLOW_SYSTEM_LIBS
-export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
-%ifarch x86_64 ppc64 ia64 s390x
+%build
+cd mozilla/directory/c-sdk
+%{__autoconf}
+%configure \
+%ifarch %{x8664} ia64 ppc64 s390x
+ --enable-64bit \
+%endif
+ --disable-debug \
+ --enable-clu \
+ --enable-optimize \
+ --with-sasl \
+ --with-system-nspr \
+ --with-system-nss \
+ --with-system-svrcore
+
+%ifarch %{x8664} ppc64 ia64 s390x
USE_64=1
export USE_64
%endif
-cd mozilla/directory/c-sdk
-%{__make} BUILDCLU=1 HAVE_SVRCORE=1 BUILD_OPT=1
+%{__make} \
+ XCFLAGS="%{rpmcflags}"
+
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_includedir}/mozldap
-install -d $RPM_BUILD_ROOT%{_libdir}
-install -d $RPM_BUILD_ROOT%{_libdir}/mozldap
-
-# Copy the binary libraries we want
-for file in libssldap50.so libprldap50.so libldap50.so; do
- install mozilla/dist/lib/$file $RPM_BUILD_ROOT%{_libdir}
-done
-
-# Copy the binaries we want
-for file in ldapsearch ldapmodify ldapdelete ldapcmp ldapcompare; do
- install mozilla/dist/bin/$file $RPM_BUILD_ROOT%{_libdir}/mozldap
-done
-
-# Copy the include files
-for file in mozilla/dist/public/ldap/*.h; do
- install -m 644 $file $RPM_BUILD_ROOT%{_includedir}/mozldap
-done
-
-# Copy the developer files
-install -d $RPM_BUILD_ROOT%{_datadir}/mozldap
-cp -r mozilla/directory/c-sdk/ldap/examples $RPM_BUILD_ROOT%{_datadir}/mozldap
-install -d $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir}
-install mozilla/directory/c-sdk/ldap/examples/xmplflt.conf $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir}
-install mozilla/directory/c-sdk/ldap/libraries/libldap/ldaptemplates.conf $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir}
-install mozilla/directory/c-sdk/ldap/libraries/libldap/ldapfilter.conf $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir}
-install mozilla/directory/c-sdk/ldap/libraries/libldap/ldapsearchprefs.conf $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir}
-
-# Rename the libraries and create the symlinks
-cd $RPM_BUILD_ROOT%{_libdir}
-for file in libssldap50.so libprldap50.so libldap50.so; do
- mv $file $file.%{major}.${minor}
- ln -s $file.%{major}.%{minor} $file.%{major}
- ln -s $file.%{major} $file
-done
+install -d $RPM_BUILD_ROOT{{%{_includedir},%{_libdir}}/mozldap,%{_bindir},%{_sysconfdir}/%{name}}
+
+cd mozilla
+install dist/lib/lib*.so $RPM_BUILD_ROOT%{_libdir}
+install dist/lib/lib*.a $RPM_BUILD_ROOT%{_libdir}
+install dist/public/ldap/*.h $RPM_BUILD_ROOT%{_includedir}/mozldap
+install dist/bin/ldap* $RPM_BUILD_ROOT%{_bindir}
+# what really uses these and proper install dir?
+install dist/etc/* $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
+
+install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+cd directory/c-sdk/ldap
+cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+rm -f $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/Makefile
+cd -
-# Set up our package file
install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
-sed mozldap.pc.in -e "
+sed directory/c-sdk/mozldap.pc.in -e "
s,%%libdir%%,%{_libdir},g
s,%%prefix%%,%{_prefix},g
s,%%exec_prefix%%,%{_prefix},g
s,%%includedir%%,%{_includedir}/mozldap,g
s,%%NSPR_VERSION%%,%{nspr_version},g
s,%%NSS_VERSION%%,%{nss_version},g
- s,%%SVRCORE_VERSION%%,%{svrcore_version},g
s,%%MOZLDAP_VERSION%%,%{version},g
" > $RPM_BUILD_ROOT%{_pkgconfigdir}/mozldap.pc
+cd $RPM_BUILD_ROOT%{_libdir}
+for file in lib*.so; do
+ mv $file $file.%{version}
+ ln -s $file.%{version} $file
+done
%clean
rm -rf $RPM_BUILD_ROOT
-%post -p /sbin/ldconfig
-%postun -p /sbin/ldconfig
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
%files
%defattr(644,root,root,755)
-%{_libdir}/libssldap50.so
-%{_libdir}/libprldap50.so
-%{_libdir}/libldap50.so
-%attr(755,root,root) %{_libdir}/libssldap50.so.%{major}
-%attr(755,root,root) %{_libdir}/libprldap50.so.%{major}
-%attr(755,root,root) %{_libdir}/libldap50.so.%{major}
-%attr(755,root,root) %{_libdir}/libssldap50.so.%{major}.%{minor}
-%attr(755,root,root) %{_libdir}/libprldap50.so.%{major}.%{minor}
-%attr(755,root,root) %{_libdir}/libldap50.so.%{major}.%{minor}
-
-%files tools
-%defattr(644,root,root,755)
-%{_libdir}/mozldap/ldapsearch
-%{_libdir}/mozldap/ldapmodify
-%{_libdir}/mozldap/ldapdelete
-%{_libdir}/mozldap/ldapcmp
-%{_libdir}/mozldap/ldapcompare
+%attr(755,root,root) %{_libdir}/libldap60.so.*.*
+%attr(755,root,root) %ghost %{_libdir}/libldap60.so
+%attr(755,root,root) %{_libdir}/libprldap60.so.*.*
+%attr(755,root,root) %ghost %{_libdir}/libprldap60.so
+%attr(755,root,root) %{_libdir}/libssldap60.so.*.*
+%attr(755,root,root) %ghost %{_libdir}/libssldap60.so
+%attr(755,root,root) %{_libdir}/libldif60.so.*.*
+%attr(755,root,root) %ghost %{_libdir}/libldif60.so
%files devel
%defattr(644,root,root,755)
-%{_pkgconfigdir}/mozldap.pc
%{_includedir}/mozldap
-%{_datadir}/mozldap
+%{_pkgconfigdir}/mozldap.pc
+%{_examplesdir}/%{name}-%{version}
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libiutil60.a
+%{_libdir}/liblber60.a
+%{_libdir}/libldap60.a
+%{_libdir}/libldif60.a
+
+%files tools
+%defattr(644,root,root,755)
+%dir %{_sysconfdir}/%{name}
+%{_sysconfdir}/%{name}/ldapfilter.conf
+%{_sysconfdir}/%{name}/ldapfriendly
+%{_sysconfdir}/%{name}/ldapsearchprefs.conf
+%{_sysconfdir}/%{name}/ldaptemplates.conf
+# NOTE: these probably collide with openldap
+%attr(755,root,root) %{_bindir}/ldapcmp
+%attr(755,root,root) %{_bindir}/ldapcompare
+%attr(755,root,root) %{_bindir}/ldapdelete
+%attr(755,root,root) %{_bindir}/ldapmodify
+%attr(755,root,root) %{_bindir}/ldappasswd
+%attr(755,root,root) %{_bindir}/ldapsearch