Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37512407
en ru br
ALT Linux repositórios
S:2.6.4-alt1
5.0: 2.3.43-alt2
4.1: 2.3.41-alt3.M41.3
4.0: 2.3.35-alt1.M40.1
3.0: 2.2.27-alt1.1

Group :: Sistema/Servidores
RPM: openldap

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

### Build switches for enable or disable fiture ###
%def_enable doc
%def_enable sql
%def_enable perl
%def_disable shell
%def_enable sasl
%def_enable krb
### Disable, because while build by rpm is not passed
%def_disable test
%def_disable debug
%def_enable slapi
%def_enable slp
%def_enable overlay
%def_enable aci
%def_enable slurpd
%def_enable ldbm
%def_enable yielding
%def_disable aacls

Name: openldap
Version: 2.2.27
Release: alt1.1

%define so_maj 2.2
%define ldap_ssl_dir %_sysconfdir/%name/ssl
%define ssl_dir %_localstatedir/ssl/certs

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.tar.bz2

# Docs for this products

Source1: %name-guide-2.2.tar.bz2
#Source2: %name-README.upgrading
Source3: %name-README.ALT
Source4: %name-config-README.ALT

# System Specific source

Source11: %name.sysconfig
Source12: %name-slapd.init
Source13: %name.logrotate
Source14: %name-slurpd.init
## Chroot config
Source15: %name-ldap.all
Source16: %name-ldap.conf
Source17: %name-ldap.lib
#This file we need to build from original dynamic
Source18: %name-slapd.conf
Source19: %name-bdb-DB_CONFIG
Source20: %name-slapd-access.conf

# Extended OpenLDAP schemas

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

%if_enabled aacls
## AACLS patch
Source60: %name-aacls-patch-1.6a.tgz
%endif

### PATCHES

## This path for chrooting ldap
Patch8: %name-2.1.29-alt-chroot.patch
Patch9: %name-2.2.15-alt-servers-path.patch

## Patch created by Alexander Bokovoy <ab at altlinux.ru>

Patch19: %name-2.2.14-alt-pid.patch
Patch20: %name-2.1.22-autoconf-2.5-alt.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
%if_enabled slp
BuildPreReq: libopenslp-devel
%endif

# Automatically added by buildreq on Sun Jun 19 2005 (-bi)

BuildRequires: chrooted gcc-c++ gcc-g77 libdb4-devel libe2fs-devel libg2c-devel libkrb5-devel libltdl-devel libopenslp-devel libsasl2-devel libssl-devel libstdc++-devel libunixODBC-devel libwrap-devel openldap-servers perl-devel python-base python-modules-compiler python-modules-encodings sdf shtool 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
%if_enabled slp
Requires: libopenslp-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
%if_enabled slp
Requires: libopenslp
%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.

Server build with: TLS/SSL support, threads, build shared libraries, monitor backend, metadirectory backend, ldbm backend with btree..., ldap backend, Hierarchical DB backend, dnssrv backend, Berkeley DB backend, tcp wrapper, DN rewriting in back-ldap and the rwm overlay, dynamic module support,
per-object ACIs (experimental),
SLAPI support (experimental),
SLPv2 support,
shell backend, but disable slurpd and threads,
sql backend,
Cyrus SASL support and (Cyrus) SASL password verification,
perl backend,
Kerberos support and Kerbeross password verification,
Dynamic Group overlay, Proxy Cache overlay,  
with debug information.
Build SLURPD
SLURPD disable
AACLS enable (aacls.sf.net)

%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

%patch8 -p1
%patch9 -p1
#%patch10 -p1
%patch19 -p1
%patch20 -p1

### Extract AACLS patch

%if_enabled aacls
tar -zxf %SOURCE60
%__patch -p1 < ./patch-0.6/patch-2.2.11
%endif

### Extract Administrator Guide to sourcedoc dir

%if_enabled doc
pushd doc
tar -jxf %SOURCE1
popd
%endif

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

pushd servers/slapd
tar -jxf %SOURCE50
popd


%build
%if_enabled krb
# Made OpenLDAP with 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 -DLOG_DAEMON=1 -DLDAP_CONNECTIONLESS=1"

shtoolize all
aclocal
autoconf

%configure \
--enable-syslog \
--enable-proctitle \
--enable-dynamic \
--disable-ipv6 \
--with-tls=openssl \
--with-threads \
\
--enable-slapd \
--enable-lmpasswd \
--enable-crypt \
--enable-modules \
--enable-rewrite \
--enable-wrappers \
--enable-bdb=mod \
--enable-hdb=mod \
--enable-dnssrv=mod \
--enable-ldap=mod \
%if_enabled ldbm
--enable-ldbm=mod \
 --with-ldbm-api=berkeley \
 --with-ldbm-type=btree \
%else
--disable-ldbm \
%endif
--enable-meta=mod \
--enable-monitor=mod \
--enable-null=mod \
--enable-passwd=mod \
\
%if_enabled yielding
--with-yielding-select \
%else
--without-yielding-select \
%endif
%if_enabled aci
--enable-aci \
%else
--disable-aci \
%endif
%if_enabled slapi
--enable-slapi \
%else
--disable-slapi \
%endif
%if_enabled slp
--enable-slp \
%else
--disable-slp \
%endif
%if_enabled shell
--enable-shell=mod \
 --disable-slurpd \
 --without-threads \
%else
--disable-shell \
 --with-threads \
%endif
%if_enabled sql
--enable-sql=mod \
%else
--disable-sql \
%endif
%if_enabled sasl
--with-cyrus-sasl \
 --enable-spasswd \
%elseif
--without-cyrus-sasl \
%endif
%if_enabled perl
--enable-perl=mod \
%elseif
--disable-perl \
%endif
%if_enabled krb
--with-kerberos \
 --enable-kpasswd \
%elseif
--without-kerberos \
%endif
%if_enabled overlay
--enable-dyngroup=mod \
--enable-proxycache=mod \
%else
--disable-dyngroup \
--disable--proxycache \
%endif
%if_enabled slurpd
--enable-slurpd \
%else
--disable-slurpd \
%endif
%if_enabled debug
--enable-debug \
%endif
%if_enabled aacls
--enable-aacls \
%endif

%__subst 's/^AC_CFLAGS.*/& %optflags_shared/' libraries/librewrite/Makefile

%make depend
export NPROCS=1
%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
%endif
%endif ### test

%if_enabled doc
# Build Administrator Guide in html and text mode
pushd doc/%name-guide-2.2/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 and chroot enviroment.

%__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%_libdir/sasl2
%__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 $RPM_BUILD_ROOT%_sysconfdir/chroot.d/ldap.all
%__install -pD -m750 %SOURCE16 $RPM_BUILD_ROOT%_sysconfdir/chroot.d/ldap.conf
%__install -pD -m750 %SOURCE17 $RPM_BUILD_ROOT%_sysconfdir/chroot.d/ldap.lib




# 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 -m600 %SOURCE19 $RPM_BUILD_ROOT%_localstatedir/ldap/bases/DB_CONFIG
%__install -pD -m600 %SOURCE20 $RPM_BUILD_ROOT%_sysconfdir/%name/slapd-access.conf
%__install -pD -m644 %SOURCE51 $RPM_BUILD_ROOT%_sysconfdir/%name/rootdse.ldif


# 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-{null,perl,sql},schema,slapi,overlays}/
%__install -D -m644 servers/slapd/back-ldap/TODO.proxy \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/back-ldap/TODO.proxy
%__install -D -m644 servers/slapd/back-meta/TODO \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/back-meta/TODO
%__cp -r servers/slapd/back-meta/data \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/back-meta/
%__install -D -m644 servers/slapd/back-monitor/README \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/back-monitor/README
%__install -D -m644 servers/slapd/back-null/README \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/back-null/README
%if_enabled perl
%__install -D -m644 servers/slapd/back-perl/{README,SampleLDAP.pm} \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/back-perl/
%endif
%if_enabled shell
%__install -D -m644 servers/slapd/back-shell/searchexample.{conf,sh} \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/back-shell/
%endif
%if_enabled sql
%__install -D -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
%if_enabled slapi
%__install -pD -m644 servers/slapd/slapi/TODO \
       $RPM_BUILD_ROOT%_docdir/%name-servers-%version/slapi/TODO
%endif
%if_enabled overlay
%__install -pD -m644 servers/slapd/overlays/README \
       $RPM_BUILD_ROOT%_docdir/%name-servers-%version/overlays/README
%endif
%__install -p -m644 servers/slapd/schema/README \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/schema/README
%__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
%__install -p -m644 %SOURCE4 \
$RPM_BUILD_ROOT%_docdir/%name-servers-%version/config-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.2/admin/*.gif \
$RPM_BUILD_ROOT%_docdir/HTML/en/OpenLDAP-Guide/
%__install -pD -m644 doc/%name-guide-2.2/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
for n in ldap lber; do
for f in $RPM_BUILD_ROOT%_libdir/lib$n.so; do
t=`objdump -p "$f" |awk '/SONAME/ {print $2}'`
[ -n "$t" ]
%__ln_s -nf ../../%_lib/"$t" "$f"
done
%__mv $RPM_BUILD_ROOT%_libdir/lib$n-*.so.* $RPM_BUILD_ROOT/%_lib/
done


%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
if [ -d "$ldap_ssl_dir" -a ! -L "$ldap_ssl_dir" ]; then
echo "Your sertificates are moved to $ldap_ssl_dir.rpmsave, please CHECK!"
%__mv "$ldap_ssl_dir" "$ldap_ssl_dir".rpmsave
fi
# Create links for to ssl certs dir
echo "Create Soft Link /etc/openldap/ssl to /var/lib/ssl/certs"
%__ln_s -nf /var/lib/ssl/certs /etc/openldap/ssl


%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
### System configs files
%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
### Servers config files
%defattr(-,ldap,ldap)
%config(noreplace) %_sysconfdir/%name/slapd.conf
%config(noreplace) %_sysconfdir/%name/rootdse.ldif
%config(noreplace) %_sysconfdir/%name/slapd-access.conf
#%ghost %_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.2/admin/guide.txt
%doc %_docdir/HTML/en/OpenLDAP-Guide
%endif

###

# TODO for 2.2.x
#
#[global] correct install all docs to %_docdir
#[global] Correct build with SASL(+++) Need tests
#[FR] Translate Admin Guide
#[FR] Translate LDAP Tools and add working in LOCALE Run-Time envirement.
#[FR] Make load modules correctly by dlopen without *.la files
#[global] Copy or not in back-meta/data directory (may be need to copy this data to Docs dir).
#[NeedBugFix] Remove TEXTREL from back-{modules}
#[global] What is back-tcl ?? man is here, but back modules isn't.
#[global] Generate slapd.conf according slapd.conf in source and man pages back-*
#[global] Create new config shema
#[FR] Import, may be, backup shema from MDK
#[global] Work on SSL/TLS cert dir!(+++) Need tests.
#[FR] Correct patch for aacls for latest version
#[FR] Create separate package with OpenLDAP test for ALT Specific chroot env
#[FR] Create chroot-scripts dynamic while build package

%changelog

Todas as alterações você pod ver aqui

 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009