]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blame - openldap/openldap.nm
openldap: Rebuild against libdb
[people/amarx/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
d695fb13 7version = 2.4.40
eb424a87 8release = 2
8b63a194 9
802ea3af
MT
10groups = System/Daemons
11url = http://www.openldap.org/
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
641c402a 24source_dl = ftp://ftp.openldap.org/pub/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
eb424a87 32 libdb-devel
802ea3af
MT
33 libtool
34 libtool-devel
35 openssl-devel
36 pth-devel
d236d00d 37 shadow-utils
802ea3af 38 end
25d74477 39
802ea3af 40 configure_options += \
c8784213 41 --libexecdir=%{libdir} \
802ea3af
MT
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 \
8fed81c8
SS
54 --enable-hdb=yes \
55 --enable-monitor=yes \
802ea3af 56 --disable-static
8b63a194 57
d236d00d
SS
58 prepare_cmds
59 %{create_user}
d695fb13
MT
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
d236d00d
SS
65 end
66
802ea3af 67 install_cmds
c8784213 68 mv -v %{BUILDROOT}%{libdir}/slapd %{BUILDROOT}/usr/sbin/slapd
802ea3af
MT
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
d236d00d 79 # Remove unneeded files.
8fed81c8 80 rm -rvf %{BUILDROOT}%{sysconfidir}/slapd.{conf,ldif}
d236d00d
SS
81 rm -rvf %{BUILDROOT}%{localstatedir}/openldap-data
82 rm -rvf %{BUILDROOT}%{localstatedir}/run
802ea3af
MT
83
84 for LINK in lber ldap ldap_r; do
c8784213 85 chmod -v 0755 %{BUILDROOT}%{libdir}/$(readlink %{BUILDROOT}%{libdir}/lib${LINK}.so)
802ea3af
MT
86 done
87
8fed81c8
SS
88 # Install configuration file.
89 mkdir -pv %{BUILDROOT}%{datadir}/%{name}
90 cp -vf %{DIR_SOURCE}/openldap-conf.ldif \
91 %{BUILDROOT}%{datadir}/%{name}/
d236d00d 92
f2dfd577
SS
93 # Install ldapcert.sh script.
94 install -m 0755 %{DIR_SOURCE}/ldapcert.sh \
95 %{BUILDROOT}%{datadir}/%{name}/
96
d236d00d
SS
97 # Create directoires.
98 mkdir -pv %{BUILDROOT}%{sysconfdir}/%{name}/slapd.d
f2dfd577 99 mkdir -pv %{BUILDROOT}%{sysconfdir}/%{name}/certs
58568575 100 mkdir -pv %{BUILDROOT}/run/%{name}
d236d00d
SS
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
802ea3af
MT
108 end
109end
8b63a194 110
d236d00d
SS
111create_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
115end
116
802ea3af
MT
117packages
118 package %{name}
f2dfd577
SS
119 prerequires
120 openssl
121 shadow-utils
122 end
d236d00d
SS
123
124 script prein
125 %{create_user}
126 end
127
128 datafiles
129 %{sysconfdir}/%{name}/slapd.d
f2dfd577 130 %{sysconfdir}/%{name}/certs
d236d00d
SS
131 %{sharedstatedir}/ldap
132 end
133
b0a34906
SS
134 script postin
135 systemctl daemon-reload >/dev/null 2>&1 || :
d236d00d 136 systemctl enable openldap.socket >/dev/null 2>&1 || :
b0a34906
SS
137 end
138
139 script preun
140 systemctl --no-reload disable openldap.service >/dev/null 2>&1 || :
d236d00d 141 systemctl --no-reload disable openldap.socket >/dev/null 2>&1 || :
b0a34906 142 systemctl stop openldap.service >/dev/null 2>&1 || :
d236d00d 143 systemctl stop openldap.socket >/dev/null 2>&1 || :
b0a34906
SS
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
8b63a194 155
802ea3af
MT
156 package %{name}-libs
157 template LIBS
158 end
8b63a194 159
802ea3af
MT
160 package %{name}-devel
161 template DEVEL
162 end
1f9bc2f0
MT
163
164 package %{name}-debuginfo
165 template DEBUGINFO
166 end
802ea3af 167end