]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - openldap/openldap.nm
Merge remote-tracking branch 'stevee/openldap-improvements'
[people/ms/ipfire-3.x.git] / openldap / openldap.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = openldap
7 version = 2.4.32
8 release = 2
9
10 groups = System/Daemons
11 url = http://www.openldap.org/
12 license = OpenLDAP
13 summary = LDAP support libraries.
14
15 description
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.
22 end
23
24 source_dl = ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/
25 sources = %{thisapp}.tgz
26
27 build
28 requires
29 db4-devel
30 cyrus-sasl-devel
31 groff
32 libtool
33 libtool-devel
34 openssl-devel
35 pth-devel
36 shadow-utils
37 end
38
39 configure_options += \
40 --libexecdir=%{libdir} \
41 --sysconfdir=/etc \
42 --localstatedir=/var \
43 --with-threads=posix \
44 --disable-perl \
45 --enable-dynamic \
46 --enable-crypt \
47 --enable-modules \
48 --enable-rlookups \
49 --enable-backends=mod \
50 --enable-overlays=mod \
51 --enable-sql=no \
52 --enable-ndb=no \
53 --disable-static
54
55 prepare_cmds
56 %{create_user}
57 end
58
59 install_cmds
60 mv -v %{BUILDROOT}%{libdir}/slapd %{BUILDROOT}/usr/sbin/slapd
61 ln -svf slapd %{BUILDROOT}/usr/sbin/slapacl
62 ln -svf slapd %{BUILDROOT}/usr/sbin/slapadd
63 ln -svf slapd %{BUILDROOT}/usr/sbin/slapauth
64 ln -svf slapd %{BUILDROOT}/usr/sbin/slapcat
65 ln -svf slapd %{BUILDROOT}/usr/sbin/slapdn
66 ln -svf slapd %{BUILDROOT}/usr/sbin/slapindex
67 ln -svf slapd %{BUILDROOT}/usr/sbin/slappasswd
68 ln -svf slapd %{BUILDROOT}/usr/sbin/slapschema
69 ln -svf slapd %{BUILDROOT}/usr/sbin/slaptest
70
71 # Remove unneeded files.
72 rm -rvf %{BUILDROOT}%{localstatedir}/openldap-data
73 rm -rvf %{BUILDROOT}%{localstatedir}/run
74
75 for LINK in lber ldap ldap_r; do
76 chmod -v 0755 %{BUILDROOT}%{libdir}/$(readlink %{BUILDROOT}%{libdir}/lib${LINK}.so)
77 done
78
79 # Install configuration
80 mkdir -pv %{BUILDROOT}/etc/%{name}
81 cp -vf %{DIR_SOURCE}/slapd.conf %{BUILDROOT}%{sysconfdir}/%{name}/slapd.conf
82
83 # Create directoires.
84 mkdir -pv %{BUILDROOT}%{sysconfdir}/%{name}/slapd.d
85 mkdir -pv %{BUILDROOT}%{localstatedir}/%{name}
86 mkdir -pv %{BUILDROOT}%{sharedstatedir}/ldap
87
88 # Fix permissions and ownerships.
89 chown -Rv ldap:ldap %{BUILDROOT}%{sysconfdir}/%{name}
90 chown ldap:ldap %{BUILDROOT}/run/%{name}
91 chown ldap:ldap %{BUILDROOT}%{sharedstatedir}/ldap
92 chmod 700 -Rv %{BUILDROOT}%{sharedstatedir}/ldap
93 end
94 end
95
96 create_user
97 getent group ldap >/dev/null || groupadd -r ldap
98 getent passwd ldap >/dev/null || useradd -r -g ldap \
99 -d /var/lib/ldap -s /sbin/nologin -c "OpenLDAP server" ldap
100 end
101
102 packages
103 package %{name}
104 prerequires += shadow-utils
105
106 script prein
107 %{create_user}
108 end
109
110 datafiles
111 %{sysconfdir}/%{name}/slapd.d
112 %{sharedstatedir}/ldap
113 end
114
115 script postin
116 systemctl daemon-reload >/dev/null 2>&1 || :
117 systemctl enable openldap.socket >/dev/null 2>&1 || :
118 end
119
120 script preun
121 systemctl --no-reload disable openldap.service >/dev/null 2>&1 || :
122 systemctl --no-reload disable openldap.socket >/dev/null 2>&1 || :
123 systemctl stop openldap.service >/dev/null 2>&1 || :
124 systemctl stop openldap.socket >/dev/null 2>&1 || :
125 end
126
127 script postun
128 systemctl daemon-reload >/dev/null 2>&1 || :
129 end
130
131 script postup
132 systemctl daemon-reload >/dev/null 2>&1 || :
133 systemctl try-restart openldap.service >/dev/null 2>&1 || :
134 end
135 end
136
137 package %{name}-libs
138 template LIBS
139 end
140
141 package %{name}-devel
142 template DEVEL
143 end
144
145 package %{name}-debuginfo
146 template DEBUGINFO
147 end
148 end