Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37763820
en ru br
ALT Linux repos
5.0: 6.0.6-alt1
4.1: 6.0.2-alt1
4.0: 6.0.2-alt1

Group :: System/Libraries
RPM: mozldap

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

%define major  6
%define minor  0
%define submin 2

Summary:        Mozilla LDAP C SDK
Name:           mozldap
Version:        6.0.2
Release:        alt1
License: MPL/GPL/LGPL
URL: http://www.mozilla.org/directory/csdk.html
Group:          System/Libraries
Requires: libnspr, libnss

Source0:        ldapcsdk.tar
Source2: fix_headers.sh

Patch1: ldapcsdk-5.1.7-alt-nss-libs.patch
Patch2: ldapcsdk-5.1.7-alt-rpath-link.patch
Patch3: mozldap-alt-allow-x86_64-host-build.patch
Patch4: mozldap-alt-fix-sasl2-link.patch
Patch5: mozldap-alt-pc-fix.patch

# Automatically added by buildreq on Mon Feb 26 2007 (-bi)

BuildRequires: chrpath gcc-c++ libsasl2-devel libsvrcore-devel nss-utils python-base

Conflicts: mozilla < 1.8

BuildRequires: autoconf_2.13
%set_autoconf_version 2.13

%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:            Development/Other
Requires:         %name = %version-%release

%description tools
The mozldap-tools package provides the ldapsearch,
ldapmodify, and ldapdelete tools that use the
Mozilla LDAP C SDK libraries.

%package devel
Summary:          Development libraries and examples for Mozilla LDAP C SDK
Group:            Development/C
Requires:         %name = %version-%release

%description devel
Header and Library files for doing development with the Mozilla LDAP C SDK

%prep
%setup -q -n %name-%version -c
cd ldapcsdk

%patch1 -p0 -b .fix1
%patch2 -p0 -b .fix2
%patch3 -p0 -b .fix3
%patch4 -p0 -b .fix4
%patch5 -p1 -b .fix5

%build
cd ldapcsdk/mozilla/directory/c-sdk

# Enable compiler optimizations and disable debugging code

export BUILD_OPT=1

# Generate symbolic info for debuggers

export XCFLAGS="$RPM_OPT_FLAGS $(pkg-config --cflags-only-I nss) $(pkg-config --cflags-only-I nspr)"
export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1

%ifarch x86_64
export USE_64=1
%endif

# Build ldapsdk

%add_optflags %optflags_shared
%__subst 's|AC_CONFIG_AUX_DIR(\${srcdir}/config/autoconf)|AC_CONFIG_AUX_DIR(config/autoconf)|' configure.in
%__autoconf

%configure \
   --with-sasl \
   --enable-clu \
   --with-system-nss \
   --with-system-nspr \
   --with-system-svrcore \
   --with-pthreads \
   \
   --enable-strip \
   --enable-optimize="$RPM_OPT_FLAGS" \
   --enable-mdupdate \
   --disable-debug \
%ifarch x86_64
   --enable-64bit \
%endif
   #
%make

%install
cd ldapcsdk

# There is no make install target so we'll do it ourselves.

%__mkdir_p %buildroot/%_bindir \
   %buildroot/%_includedir/%name \
   %buildroot/%_libdir/%name \
   %buildroot/%_datadir/%name/etc \
   #

# Copy the binary libraries we want

find mozilla/dist/lib/ -name '*.so' -execdir %__install -m 755 -t %buildroot/%_libdir \{\} \;

# Copy the binaries we want

find mozilla/dist/bin/ -name 'ldap*' |
while read f; do
   %__install -m 755 -- "$f" "%buildroot/%_bindir/moz${f##*/}"
done

# Copy the include files

find mozilla/dist/public/ldap -name '*.h' -execdir %__install -m 644 -t %buildroot/%_includedir/%name \{\} \;
%SOURCE2 %_includedir %buildroot/%_includedir/%name

# Copy the developer files

cp -r mozilla/directory/c-sdk/ldap/examples %buildroot/%_datadir/%name

%__install -m 644 -t %buildroot/%_datadir/%name/etc \
   mozilla/directory/c-sdk/ldap/examples/xmplflt.conf \
   mozilla/directory/c-sdk/ldap/libraries/libldap/ldaptemplates.conf \
   mozilla/directory/c-sdk/ldap/libraries/libldap/ldapfilter.conf \
   mozilla/directory/c-sdk/ldap/libraries/libldap/ldapsearchprefs.conf \
   #

# Set up our package file

%__mkdir_p %buildroot/%_libdir/pkgconfig
sed \
   -e "s,%%bindir%%,%_bindir,g" \
   -e "s,%%libdir%%,%_libdir,g" \
   -e "s,%%prefix%%,%_prefix,g" \
   -e "s,%%exec_prefix%%,%_prefix,g" \
   -e "s,%%includedir%%,%_includedir/%name,g" \
   -e "s,%%major%%,%major,g" \
   -e "s,%%minor%%,%minor,g" \
   -e "s,%%submin%%,%submin,g" \
   -e "s,%%libsuffix%%,%major%minor,g" \
   -e "s,%%NSPR_VERSION%%,$(pkg-config --modversion nspr),g" \
   -e "s,%%NSS_VERSION%%,$(pkg-config --modversion nss),g" \
   -e "s,%%MOZLDAP_VERSION%%,%version,g" \
   mozilla/directory/c-sdk/mozldap.pc.in > \
   %buildroot/%_libdir/pkgconfig/%name.pc

# Rename the libraries and create the symlinks

cd %buildroot/%_libdir
for f in *.so; do
 mv    "$f"                       "$f.%major.%minor.%submin"
 ln -s "$f.%major"                "$f"
 ln -s "$f.%major.%minor"         "$f.%major"
 ln -s "$f.%major.%minor.%submin" "$f.%major.%minor"  
done

find -type f |
while read f; do
 %__file "$f" |grep -qs ELF || continue
 if chrpath -l "$f" |fgrep -qs "RPATH="; then
   chrpath -d "$f"
 fi
done

%post -p %post_ldconfig
%postun -p %postun_ldconfig

%files
%_libdir/*.so*

%files tools
%_bindir/*

%files devel
%_libdir/pkgconfig/*.pc
%_includedir/%name
%_datadir/%name

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin