]> git.ipfire.org Git - people/pmueller/ipfire-3.x.git/blame - openldap/openldap.nm
elfutils: Correctly configure debuginfod
[people/pmueller/ipfire-3.x.git] / openldap / openldap.nm
CommitLineData
8b63a194 1###############################################################################
802ea3af
MT
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
8b63a194 4###############################################################################
5
802ea3af 6name = openldap
fd83b393 7version = 2.6.4
fb0b5f5a 8release = 3.1
8b63a194 9
802ea3af 10groups = System/Daemons
d9b1e5cf 11url = https://www.openldap.org/
802ea3af
MT
12license = OpenLDAP
13summary = LDAP support libraries.
8b63a194 14
802ea3af
MT
15description
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
8b63a194 21 documentation for OpenLDAP.
802ea3af 22end
8b63a194 23
d9b1e5cf 24source_dl = https://mirror.eu.oneandone.net/software/openldap/openldap-release/
802ea3af 25sources = %{thisapp}.tgz
8b63a194 26
802ea3af
MT
27build
28 requires
d695fb13 29 automake
802ea3af
MT
30 cyrus-sasl-devel
31 groff
32 libtool
33 libtool-devel
f86e1166 34 libxcrypt-devel
802ea3af 35 openssl-devel
d236d00d 36 shadow-utils
802ea3af 37 end
25d74477 38
802ea3af 39 configure_options += \
c8784213 40 --libexecdir=%{libdir} \
802ea3af
MT
41 --with-threads=posix \
42 --disable-perl \
d9b1e5cf 43 --disable-wt \
802ea3af
MT
44 --enable-dynamic \
45 --enable-crypt \
46 --enable-modules \
47 --enable-rlookups \
48 --enable-backends=mod \
49 --enable-overlays=mod \
50 --enable-sql=no \
802ea3af 51 --disable-static
8b63a194 52
d236d00d
SS
53 prepare_cmds
54 %{create_user}
55 end
56
870c2f84
SS
57 # Do not strip the binaries during install.
58 make_install_targets += \
59 STRIP_OPTS=
60
802ea3af 61 install_cmds
c8784213 62 mv -v %{BUILDROOT}%{libdir}/slapd %{BUILDROOT}/usr/sbin/slapd
802ea3af
MT
63 ln -svf slapd %{BUILDROOT}/usr/sbin/slapacl
64 ln -svf slapd %{BUILDROOT}/usr/sbin/slapadd
65 ln -svf slapd %{BUILDROOT}/usr/sbin/slapauth
66 ln -svf slapd %{BUILDROOT}/usr/sbin/slapcat
67 ln -svf slapd %{BUILDROOT}/usr/sbin/slapdn
68 ln -svf slapd %{BUILDROOT}/usr/sbin/slapindex
69 ln -svf slapd %{BUILDROOT}/usr/sbin/slappasswd
70 ln -svf slapd %{BUILDROOT}/usr/sbin/slapschema
71 ln -svf slapd %{BUILDROOT}/usr/sbin/slaptest
d9b1e5cf 72 ln -svf slapd %{BUILDROOT}/usr/sbin/slapmodify
802ea3af 73
d236d00d 74 # Remove unneeded files.
8fed81c8 75 rm -rvf %{BUILDROOT}%{sysconfidir}/slapd.{conf,ldif}
d236d00d
SS
76 rm -rvf %{BUILDROOT}%{localstatedir}/openldap-data
77 rm -rvf %{BUILDROOT}%{localstatedir}/run
802ea3af
MT
78
79 for LINK in lber ldap ldap_r; do
c8784213 80 chmod -v 0755 %{BUILDROOT}%{libdir}/$(readlink %{BUILDROOT}%{libdir}/lib${LINK}.so)
802ea3af
MT
81 done
82
8fed81c8
SS
83 # Install configuration file.
84 mkdir -pv %{BUILDROOT}%{datadir}/%{name}
85 cp -vf %{DIR_SOURCE}/openldap-conf.ldif \
86 %{BUILDROOT}%{datadir}/%{name}/
d236d00d 87
f2dfd577
SS
88 # Install ldapcert.sh script.
89 install -m 0755 %{DIR_SOURCE}/ldapcert.sh \
90 %{BUILDROOT}%{datadir}/%{name}/
91
d236d00d
SS
92 # Create directoires.
93 mkdir -pv %{BUILDROOT}%{sysconfdir}/%{name}/slapd.d
f2dfd577 94 mkdir -pv %{BUILDROOT}%{sysconfdir}/%{name}/certs
d236d00d
SS
95 mkdir -pv %{BUILDROOT}%{sharedstatedir}/ldap
96
97 # Fix permissions and ownerships.
98 chown -Rv ldap:ldap %{BUILDROOT}%{sysconfdir}/%{name}
d236d00d
SS
99 chown ldap:ldap %{BUILDROOT}%{sharedstatedir}/ldap
100 chmod 700 -Rv %{BUILDROOT}%{sharedstatedir}/ldap
802ea3af
MT
101 end
102end
8b63a194 103
d236d00d
SS
104create_user
105 getent group ldap >/dev/null || groupadd -r ldap
106 getent passwd ldap >/dev/null || useradd -r -g ldap \
107 -d /var/lib/ldap -s /sbin/nologin -c "OpenLDAP server" ldap
108end
109
802ea3af
MT
110packages
111 package %{name}
f2dfd577
SS
112 prerequires
113 openssl
114 shadow-utils
115 end
d236d00d
SS
116
117 script prein
118 %{create_user}
119 end
120
121 datafiles
122 %{sysconfdir}/%{name}/slapd.d
f2dfd577 123 %{sysconfdir}/%{name}/certs
d236d00d
SS
124 %{sharedstatedir}/ldap
125 end
126
b0a34906
SS
127 script postin
128 systemctl daemon-reload >/dev/null 2>&1 || :
d236d00d 129 systemctl enable openldap.socket >/dev/null 2>&1 || :
b0a34906
SS
130 end
131
132 script preun
133 systemctl --no-reload disable openldap.service >/dev/null 2>&1 || :
d236d00d 134 systemctl --no-reload disable openldap.socket >/dev/null 2>&1 || :
b0a34906 135 systemctl stop openldap.service >/dev/null 2>&1 || :
d236d00d 136 systemctl stop openldap.socket >/dev/null 2>&1 || :
b0a34906
SS
137 end
138
139 script postun
140 systemctl daemon-reload >/dev/null 2>&1 || :
141 end
142
143 script postup
144 systemctl daemon-reload >/dev/null 2>&1 || :
145 systemctl try-restart openldap.service >/dev/null 2>&1 || :
146 end
147 end
8b63a194 148
802ea3af
MT
149 package %{name}-libs
150 template LIBS
151 end
8b63a194 152
802ea3af
MT
153 package %{name}-devel
154 template DEVEL
155 end
1f9bc2f0
MT
156
157 package %{name}-debuginfo
158 template DEBUGINFO
159 end
802ea3af 160end