Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1584619
 поиск   регистрация   авторизация 
 
Группа :: Система/Серверы
Пакет: openldap

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

%def_enable doc
%def_enable sql
%def_enable perl
%def_disable shell
%def_enable sasl
%def_enable krb
%def_disable test
%def_disable debug

Name: openldap
Version: 2.1.30
Release: alt3.M24.1
%define so_maj 2

Summary: LDAP libraries and sample clients
License: OpenLDAP Public License
Group: System/Servers
Url: http://www.openldap.org/
Packager: Serge A. Volkov <vserge at altlinux.ru>

# OpenLDAP source

Source: ftp://ftp.OpenLDAP.org/pub/OpenLDAP/%name-release/%name-%version.tgz

# Docs for this products

Source1: %name-guide-2.1.tar.bz2
Source2: openldap-README.upgrading
Source3: openldap-README.ALT

# System Specific source

Source11: openldap.sysconfig
Source12: openldap-slapd.init
Source13: openldap.logrotate
Source14: openldap-slurpd.init
Source15: ldap.all
Source16: ldap.conf
Source17: ldap.lib
Source18: openldap-slapd.conf

# Extended OpenLDAP schemas

Source50: %name-addon-schemas.tar.bz2
Source51: %name-ALT-rootdse.ldif

### PATCHES


Patch5: %name-2.1.19-ALT-Masato-Taruishi-030326.patch
Patch8: %name-2.1.29-alt-chroot.patch
Patch9: %name-2.1.29-alt-servers-path.patch

## For support libtinfo but it's may be not need, becose utils "ud" removed

Patch14: %name-2.0.25-ALT-configure-tinfo.patch
Patch15: %name-ALT-OLAG.patch
Patch16: %name-2.1.20-ALT-test-dinamic-modules.patch
Patch17: %name-mark-benson-030616.patch
## Patch created by Alexander Bokovoy <ab at altlinux.ru>
Patch19: %name-2.1.21-alt-pid.patch
Patch20: %name-2.1.22-autoconf-2.5-alt.patch
## Patches from PLD
Patch22: %name-perl-PLD.patch

## security

Patch90: openldap-2.1.30-alt-gentoo-tls_slave.patch

### REQUIRE Section


%if_enabled doc
# For compile documentations need "sdf".
BuildPreReq: sdf >= 2
%endif
%if_enabled sasl
BuildPreReq: libsasl2-devel
%endif
%if_enabled krb
BuildPreReq: libkrb5-devel >= 1.3.1-alt3
%endif
%if_enabled sql
BuildPreReq: libunixODBC-devel
%endif
%if_enabled perl
BuildPreReq: perl-devel
%endif

# Automatically added by buildreq on Sun Apr 18 2004 (-bi)

BuildRequires: chrooted gcc-c++ libdb4.2-devel libe2fs-devel libltdl-devel
BuildRequires: libssl-devel libunixODBC-devel termutils

%package -n libldap
Summary: OpenLDAP libraries
Group: System/Libraries
Conflicts: %name < %version-%release
%if_enabled krb
Requires: libkrb5 >= 1.3.1-alt3
%endif

%package -n libldap-devel
Summary: OpenLDAP development libraries and header files
Group: Development/C
Provides: openldap-devel = %version
Requires: libldap = %version-%release
Obsoletes: openldap-devel
%if_enabled krb5
Requires: libkrb5-devel >= 1.3.1-alt3
%endif
%if_enabled sasl
Requires: libsasl2-devel
%endif

%package -n libldap-devel-static
Summary: OpenLDAP development static libraries
Group: Development/C
Provides: openldap-devel-static = %version
Requires: libldap-devel = %version-%release
%if_enabled krb5
Requires: libkrb5-devel-static >= 1.3.1-alt3
%endif
Obsoletes: openldap-devel-static

%package servers
Summary: LDAP servers
Group: System/Servers
PreReq: libldap = %version-%release, %name = %version-%release, coreutils, shadow-utils, libunixODBC, service >= 0.3, openssl
Requires: gawk
%if_enabled perl
Requires: perl
%endif

%package clients
Summary: LDAP utilities, tools and sample clients
Group: Networking/Remote access
PreReq: libldap = %version-%release, %name = %version-%release

%if_enabled doc
%package doc
Summary: OpenLDAP administration guide
Group: Books/Computer books
Requires: %name = %version-%release
Obsoletes: %name-guide
%endif

%description
OpenLDAP is an open source suite of LDAP (Lightweight Directory Access
Protocol) applications and development tools.  LDAP is a set of
protocols for accessing directory services (usually phone book style
information, but other information is possible) over the Internet,
similar to the way DNS (Domain Name System) information is propagated
over the Internet.  The suite includes a stand-alone LDAP server
(slapd), a stand-alone LDAP replication server (slurpd), libraries for
implementing the LDAP protocol, utilities, tools, and sample clients.

Install %name if you need to run LDAP-based applications and tools.

%description -n libldap
OpenLDAP is an open source suite of LDAP (Lightweight Directory Access
Protocol) applications and development tools.  LDAP is a set of
protocols for accessing directory services (usually phone book style
information, but other information is possible) over the Internet,
similar to the way DNS (Domain Name System) information is propagated
over the Internet.  The suite includes a stand-alone LDAP server
(slapd), a stand-alone LDAP replication server (slurpd), libraries for
implementing the LDAP protocol, utilities, tools, and sample clients.

This package contains shared libraries needed for make works %name-based softare.

%description -n libldap-devel
OpenLDAP is an open source suite of LDAP (Lightweight Directory Access
Protocol) applications and development tools.  LDAP is a set of
protocols for accessing directory services (usually phone book style
information, but other information is possible) over the Internet,
similar to the way DNS (Domain Name System) information is propagated
over the Internet.  The suite includes a stand-alone LDAP server
(slapd), a stand-alone LDAP replication server (slurpd), libraries for
implementing the LDAP protocol, utilities, tools, and sample clients.

This package includes the development libraries and header files needed
for developing applications that use LDAP internals. Install this package
only if you plan to develop or will need to compile customized LDAP clients.

%description -n libldap-devel-static
OpenLDAP is an open source suite of LDAP (Lightweight Directory Access
Protocol) applications and development tools.  LDAP is a set of
protocols for accessing directory services (usually phone book style
information, but other information is possible) over the Internet,
similar to the way DNS (Domain Name System) information is propagated
over the Internet.  The suite includes a stand-alone LDAP server
(slapd), a stand-alone LDAP replication server (slurpd), libraries for
implementing the LDAP protocol, utilities, tools, and sample clients.

This package includes the static libraries needed for developing statically
linked applications that use LDAP internals.

%description servers
OpenLDAP is an open source suite of LDAP (Lightweight Directory Access
Protocol) applications and development tools.  LDAP is a set of
protocols for accessing directory services (usually phone book style
information, but other information is possible) over the Internet,
similar to the way DNS (Domain Name System) information is propagated
over the Internet.  The suite includes a stand-alone LDAP server
(slapd), a stand-alone LDAP replication server (slurpd), libraries for
implementing the LDAP protocol, utilities, tools, and sample clients.

Install %name-servers if you need LDAP servers.

%description clients
OpenLDAP is an open source suite of LDAP (Lightweight Directory Access
Protocol) applications and development tools.  LDAP is a set of
protocols for accessing directory services (usually phone book style
information, but other information is possible) over the Internet,
similar to the way DNS (Domain Name System) information is propagated
over the Internet.  The suite includes a stand-alone LDAP server
(slapd), a stand-alone LDAP replication server (slurpd), libraries for
implementing the LDAP protocol, utilities, tools, and sample clients.

Install %name-client if you need LDAP applications and tools.

%if_enabled doc
%description doc
OpenLDAP Administration Guide
HTML and TXT versions
%endif

%prep
%setup -q

### Don't backup files, becose it's brake tests

%patch5 -p0
%patch8 -p1
%patch9 -p1
%patch14 -p1
%patch16 -p3
%patch19 -p1
%patch20 -p1

### Extract Administrator Guide to sourcedoc dir

%if_enabled doc
pushd doc
tar -jxf %SOURCE1
pushd openldap-guide-2.1
%patch17 -p0 -b .repl
%patch15 -p3 -b .OLAG
popd
popd
%endif

# Add some more schema for the sake of migration scripts and others

pushd servers/slapd/schema
tar -jxf %SOURCE50
popd

%if_enabled perl
%patch22 -p1
%endif

%patch90 -p1

%build
%if_enabled krb
# Made OpenLDAP with SASL and Kerboros
export CPPFLAGS="`krb5-config --cflags`"
export CPATH="`krb5-config --cflags`"
export LDFLAGS="`krb5-config --libs`"
%endif

# Options -lresolv in line below need for some bad configure scripts like in auth_ldap package

#export LDFLAGS="$LDFLAGS -lresolv"
export CPPFLAGS="$CPPFLAGS -DNEW_LOGGING=1"

aclocal
autoconf

%configure \
\
--enable-syslog \
--enable-dynamic \
--disable-ipv6 \
--enable-crypt \
--enable-lmpasswd \
--enable-modules \
--enable-slurpd \
--enable-rewrite \
\
--enable-bdb \
 --with-bdb-module=dynamic \
--enable-dnssrv \
 --with-dnssrv-module=dynamic \
--enable-ldap \
 --with-ldap-module=dynamic \
--enable-ldbm \
 --with-ldbm-module=dynamic \
 --with-ldbm-api=berkeley \
 --with-ldbm-type=btree \
--enable-meta \
 --with-meta-module=dynamic \
--enable-monitor \
 --with-monitor-module=dynamic \
--enable-null \
 --with-null-module=dynamic \
--enable-passwd \
 --with-passwd-module=dynamic \
\
--with-readline \
--with-tls=openssl \
--with-yielding-select \
\
%if_enabled shell
--enable-shell \
 --with-shell-module=dynamic \
 --disable-slurpd \
 --without-threads \
%else
--disable-shell \
 --with-threads \
%endif
%if_enabled sql
--enable-sql \
 --with-sql-module=dynamic \
%else
--disable-sql \
%endif
%if_enabled sasl
--with-cyrus-sasl \
 --enable-spasswd \
%elseif
--without-cyrus-sasl \
%endif
%if_enabled perl
--enable-perl \
 --with-perl-module=dynamic \
%elseif
--disable-perl \
%endif
%if_enabled krb
--with-kerberos \
 --enable-kpasswd \
%elseif
--without-kerberos \
%endif
%if_enabled debug
--enable-debug \
%endif


%make depend
%make_build

%if_enabled test
%if "%__buildreqs" != "1"
#If test is OK in compilation time that's ALL OK.
### Remark all test while back_bdb will be work
%make_build test
###pushd tests
###%%make bdb
###%%make ldbm
###%%make passwd
###%%make test-nis-schema
###popd
%endif
%endif ### test

%if_enabled doc
# Build Administrator Guide in html and text mode
pushd doc/%name-guide-2.1/admin
sdf -2topics index.sdf
sdf -2txt guide.sdf
popd
%endif

%install
%make DESTDIR=$RPM_BUILD_ROOT install

###

## Install all slapd's file
###

# Create the /var/lib data directory.

%__mkdir_p -m750 $RPM_BUILD_ROOT%_localstatedir/ldap
%__mkdir_p -m750 $RPM_BUILD_ROOT%_localstatedir/ldap/bases
%__mkdir_p -m750 $RPM_BUILD_ROOT%_localstatedir/ldap/replica
%__mkdir_p -m750 $RPM_BUILD_ROOT%_localstatedir/ldap/dev
%__mkdir_p -m750 $RPM_BUILD_ROOT%_localstatedir/ldap%_sysconfdir/ssl
%__mkdir_p -m750 $RPM_BUILD_ROOT%_localstatedir/ldap%_sysconfdir/schema
%__ln_s . $RPM_BUILD_ROOT%_localstatedir/ldap%_sysconfdir/%name
%__mkdir_p -m750 $RPM_BUILD_ROOT%_localstatedir/ldap/lib
%__mkdir_p -m750 $RPM_BUILD_ROOT%_localstatedir/ldap/%_libdir/%name
%__mkdir_p -m750 $RPM_BUILD_ROOT%_localstatedir/ldap%_datadir/%name/ucdata
%__mkdir_p -m750 $RPM_BUILD_ROOT%_localstatedir/ldap/var/run
%__mkdir_p -m750 $RPM_BUILD_ROOT%_localstatedir/ldap%_localstatedir/ldap
%__ln_s ../../../bases $RPM_BUILD_ROOT%_localstatedir/ldap%_localstatedir/ldap/

# Install init scripts.

%__install -pD -m644 %SOURCE11 $RPM_BUILD_ROOT%_sysconfdir/sysconfig/ldap
%__install -pD -m755 %SOURCE12 $RPM_BUILD_ROOT%_initdir/slapd
%__install -pD -m755 %SOURCE14 $RPM_BUILD_ROOT%_initdir/slurpd
%__mkdir_p -m750 $RPM_BUILD_ROOT%_sysconfdir/chroot.d
%__install -pD -m750 %SOURCE15 %SOURCE16 %SOURCE17 $RPM_BUILD_ROOT%_sysconfdir/chroot.d/

# log repository and logrotate config

%__mkdir_p -m750 $RPM_BUILD_ROOT%_logdir/ldap
%__install -pD -m644 %SOURCE13 $RPM_BUILD_ROOT%_sysconfdir/logrotate.d/ldap

# config files

%__install -pD -m600 %SOURCE18 $RPM_BUILD_ROOT%_sysconfdir/%name/slapd.conf
%__install -pD -m644 %SOURCE51 $RPM_BUILD_ROOT%_sysconfdir/%name/rootdse.ldif
%__mkdir_p -m700 $RPM_BUILD_ROOT%_sysconfdir/%name/ssl

# We don't need the default files - let's move it.

%__mkdir_p $RPM_BUILD_ROOT%_docdir/%name-servers-%version/default
%__mv $RPM_BUILD_ROOT%_sysconfdir/%name/*.default \
$RPM_BUILD_ROOT%_sysconfdir/%name/schema/*.default \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/default/

# Documentations for servers

%__mkdir_p $RPM_BUILD_ROOT%_docdir/%name-servers-%version/{back-{ldap,meta,monitor,null,perl,sql},schema}/
%__install -pD -m644 servers/slapd/back-ldap/{Changes,Copyright,TODO.proxy} \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/back-ldap/
%__install -pD -m644 servers/slapd/back-meta/{Changes,Copyright,TODO,Documentation} \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/back-meta/
%__install -pD -m644 servers/slapd/back-monitor/{Copyright,README} \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/back-monitor/
%__install -p -m644 servers/slapd/back-null/README \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/back-null/
%__install -pD -m644 servers/slapd/back-perl/{README,SampleLDAP.pm} \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/back-perl/
%if_enabled shell
%__install -pD -m644 servers/slapd/back-shell/searchexample.{conf,sh} \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/back-shell/
%endif
%if_enabled sql
%__install -pD -m644 servers/slapd/back-sql/docs/* \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/back-sql/
%__cp -r servers/slapd/back-sql/rdbms_depend \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/back-sql/
%endif
%__install -p -m644 servers/slapd/schema/README \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/schema/
%__install -p -m644 servers/slurpd/{DESIGN,NOTES} \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/
# slapd slurpd
%__install -p -m644 servers/slurpd/{DESIGN,NOTES} \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/
%__install -p -m644 %SOURCE2 \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/README.upgrade
%__install -p -m644 %SOURCE3 \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/README.ALT

%if_enabled doc
# Install Administration Guide to HTML docdir
%__mkdir_p $RPM_BUILD_ROOT%_docdir/HTML/en/OpenLDAP-Guide
%__install -pD -m644 doc/%name-guide-2.1/admin/*.gif \
$RPM_BUILD_ROOT%_docdir/HTML/en/OpenLDAP-Guide/
%__install -pD -m644 doc/%name-guide-2.1/admin/*.html \
$RPM_BUILD_ROOT%_docdir/HTML/en/OpenLDAP-Guide/
%endif

# Purge dependency_libs from .la files.

%__subst -p 's/^\(dependency_libs=\).*/\1'\'\'/ \
$RPM_BUILD_ROOT%_libdir/%name/*.la

# Relocate some shared libraries from %_libdir/ to /lib/.

%__mkdir_p $RPM_BUILD_ROOT/lib
pushd $RPM_BUILD_ROOT%_libdir
for n in ldap lber; do
%__mv lib$n.so.%{so_maj}* ../../lib/
%__ln_s -nf ../../lib/lib$n.so.%so_maj lib$n.so
done
popd


%post -n libldap -p /sbin/post_ldconfig
%postun -n libldap -p /sbin/postun_ldconfig

%pre servers
# Take care to only do ownership-changing if we're adding the user.
/usr/sbin/groupadd -rf ldap
/usr/sbin/useradd  -rM -c "LDAP User" -g ldap -u 55 -s /dev/null -d %_localstatedir/ldap ldap &>/dev/null
if [ -d %_localstatedir/ldap/bases ]; then
chown -R ldap:ldap %_localstatedir/ldap/bases
fi

%post servers
%post_service slapd

%preun servers
%preun_service slapd


%files -n libldap
/lib/*
%_libdir/*.so.*

%files -n libldap-devel
%_libdir/*.so
%_includedir/*
%_man3dir/*
%doc doc/{drafts,rfc,devel}

%files -n libldap-devel-static
%_libdir/*.a

%files
%dir %_sysconfdir/%name
%doc ANNOUNCEMENT CHANGES COPYRIGHT LICENSE README

##### SERVERS

%files servers
%config(noreplace) %_sysconfdir/sysconfig/ldap
%config(noreplace) %_sysconfdir/logrotate.d/ldap
%config(noreplace) %_initdir/slapd
%config(noreplace) %_initdir/slurpd
%_sysconfdir/chroot.d/*

%_sbindir/*
%_libdir/%name
%_datadir/%name
%_man5dir/*
%_man8dir/*
%doc %_docdir/%name-servers-%version
%attr(770,root,ldap) %dir %_logdir/ldap

%defattr(-,ldap,ldap)
%config(noreplace) %_sysconfdir/%name/slapd.conf
%config(noreplace) %_sysconfdir/%name/rootdse.ldif
%_sysconfdir/%name/ssl
%_sysconfdir/%name/schema
%_localstatedir/ldap

##### CLIENTS

%files clients
%config(noreplace) %_sysconfdir/%name/ldap.conf
%_bindir/*
%_man1dir/*

%if_enabled doc
##### GUIDE
%files doc
%doc doc/%name-guide-2.1/admin/guide.txt
%doc %_docdir/HTML/en/OpenLDAP-Guide
%endif

###

# TODO
##
# Correct build with sasl try to make two instance openldap and openldap-sasl
# Translate Admin Guide
# Translate ldap tools and add locale setup
# Change requirements for back_* modules *.la files (dlopen) -- see 2.1.23 ldv correction

%changelog

Полный changelog можно просмотреть здесь

 
design & coding: Vladimir Lettiev aka crux © 2004-2005