]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blob - openldap/openldap.nm
eaaea2f05453a6b1be79c5cece2189e9e70b0c26
[people/amarx/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.40
8 release = 1
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 automake
30 db4-devel
31 cyrus-sasl-devel
32 groff
33 libtool
34 libtool-devel
35 openssl-devel
36 pth-devel
37 shadow-utils
38 end
39
40 configure_options += \
41 --libexecdir=%{libdir} \
42 --sysconfdir=/etc \
43 --localstatedir=/var \
44 --with-threads=posix \
45 --disable-perl \
46 --enable-dynamic \
47 --enable-crypt \
48 --enable-modules \
49 --enable-rlookups \
50 --enable-backends=mod \
51 --enable-overlays=mod \
52 --enable-sql=no \
53 --enable-ndb=no \
54 --enable-hdb=yes \
55 --enable-monitor=yes \
56 --disable-static
57
58 prepare_cmds
59 %{create_user}
60
61 # for aarch64
62 for i in $(find . -name config.guess -or -name config.sub); do
63 cp -vf %{datadir}/automake-*/config.{guess,sub} $(dirname ${i})
64 done
65 end
66
67 install_cmds
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
78
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
83
84 for LINK in lber ldap ldap_r; do
85 chmod -v 0755 %{BUILDROOT}%{libdir}/$(readlink %{BUILDROOT}%{libdir}/lib${LINK}.so)
86 done
87
88 # Install configuration file.
89 mkdir -pv %{BUILDROOT}%{datadir}/%{name}
90 cp -vf %{DIR_SOURCE}/openldap-conf.ldif \
91 %{BUILDROOT}%{datadir}/%{name}/
92
93 # Install ldapcert.sh script.
94 install -m 0755 %{DIR_SOURCE}/ldapcert.sh \
95 %{BUILDROOT}%{datadir}/%{name}/
96
97 # Create directoires.
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
102
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
108 end
109 end
110
111 create_user
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
115 end
116
117 packages
118 package %{name}
119 prerequires
120 openssl
121 shadow-utils
122 end
123
124 script prein
125 %{create_user}
126 end
127
128 datafiles
129 %{sysconfdir}/%{name}/slapd.d
130 %{sysconfdir}/%{name}/certs
131 %{sharedstatedir}/ldap
132 end
133
134 script postin
135 systemctl daemon-reload >/dev/null 2>&1 || :
136 systemctl enable openldap.socket >/dev/null 2>&1 || :
137 end
138
139 script preun
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 || :
144 end
145
146 script postun
147 systemctl daemon-reload >/dev/null 2>&1 || :
148 end
149
150 script postup
151 systemctl daemon-reload >/dev/null 2>&1 || :
152 systemctl try-restart openldap.service >/dev/null 2>&1 || :
153 end
154 end
155
156 package %{name}-libs
157 template LIBS
158 end
159
160 package %{name}-devel
161 template DEVEL
162 end
163
164 package %{name}-debuginfo
165 template DEBUGINFO
166 end
167 end