1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
10 groups = System/Daemons
11 url = http://www.openldap.org/
13 summary = LDAP support libraries.
16 OpenLDAP is an open source suite of LDAP (Lightweight Directory Access
17 Protocol) applications and development tools. LDAP is a set of
18 protocols for accessing directory services over the Internet, similar
19 to the way DNS information is propagated over the Internet. The
20 openldap package contains configuration files, libraries, and
21 documentation for OpenLDAP.
24 source_dl = ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/
25 sources = %{thisapp}.tgz
40 configure_options += \
41 --libexecdir=%{libdir} \
43 --localstatedir=/var \
44 --with-threads=posix \
50 --enable-backends=mod \
51 --enable-overlays=mod \
55 --enable-monitor=yes \
62 for i in $(find . -name config.guess -or -name config.sub); do
63 cp -vf %{datadir}/automake-*/config.{guess,sub} $(dirname ${i})
68 mv -v %{BUILDROOT}%{libdir}/slapd %{BUILDROOT}/usr/sbin/slapd
69 ln -svf slapd %{BUILDROOT}/usr/sbin/slapacl
70 ln -svf slapd %{BUILDROOT}/usr/sbin/slapadd
71 ln -svf slapd %{BUILDROOT}/usr/sbin/slapauth
72 ln -svf slapd %{BUILDROOT}/usr/sbin/slapcat
73 ln -svf slapd %{BUILDROOT}/usr/sbin/slapdn
74 ln -svf slapd %{BUILDROOT}/usr/sbin/slapindex
75 ln -svf slapd %{BUILDROOT}/usr/sbin/slappasswd
76 ln -svf slapd %{BUILDROOT}/usr/sbin/slapschema
77 ln -svf slapd %{BUILDROOT}/usr/sbin/slaptest
79 # Remove unneeded files.
80 rm -rvf %{BUILDROOT}%{sysconfidir}/slapd.{conf,ldif}
81 rm -rvf %{BUILDROOT}%{localstatedir}/openldap-data
82 rm -rvf %{BUILDROOT}%{localstatedir}/run
84 for LINK in lber ldap ldap_r; do
85 chmod -v 0755 %{BUILDROOT}%{libdir}/$(readlink %{BUILDROOT}%{libdir}/lib${LINK}.so)
88 # Install configuration file.
89 mkdir -pv %{BUILDROOT}%{datadir}/%{name}
90 cp -vf %{DIR_SOURCE}/openldap-conf.ldif \
91 %{BUILDROOT}%{datadir}/%{name}/
93 # Install ldapcert.sh script.
94 install -m 0755 %{DIR_SOURCE}/ldapcert.sh \
95 %{BUILDROOT}%{datadir}/%{name}/
98 mkdir -pv %{BUILDROOT}%{sysconfdir}/%{name}/slapd.d
99 mkdir -pv %{BUILDROOT}%{sysconfdir}/%{name}/certs
100 mkdir -pv %{BUILDROOT}/run/%{name}
101 mkdir -pv %{BUILDROOT}%{sharedstatedir}/ldap
103 # Fix permissions and ownerships.
104 chown -Rv ldap:ldap %{BUILDROOT}%{sysconfdir}/%{name}
105 chown ldap:ldap %{BUILDROOT}/run/%{name}
106 chown ldap:ldap %{BUILDROOT}%{sharedstatedir}/ldap
107 chmod 700 -Rv %{BUILDROOT}%{sharedstatedir}/ldap
112 getent group ldap >/dev/null || groupadd -r ldap
113 getent passwd ldap >/dev/null || useradd -r -g ldap \
114 -d /var/lib/ldap -s /sbin/nologin -c "OpenLDAP server" ldap
129 %{sysconfdir}/%{name}/slapd.d
130 %{sysconfdir}/%{name}/certs
131 %{sharedstatedir}/ldap
135 systemctl daemon-reload >/dev/null 2>&1 || :
136 systemctl enable openldap.socket >/dev/null 2>&1 || :
140 systemctl --no-reload disable openldap.service >/dev/null 2>&1 || :
141 systemctl --no-reload disable openldap.socket >/dev/null 2>&1 || :
142 systemctl stop openldap.service >/dev/null 2>&1 || :
143 systemctl stop openldap.socket >/dev/null 2>&1 || :
147 systemctl daemon-reload >/dev/null 2>&1 || :
151 systemctl daemon-reload >/dev/null 2>&1 || :
152 systemctl try-restart openldap.service >/dev/null 2>&1 || :
160 package %{name}-devel
164 package %{name}-debuginfo