]>
Commit | Line | Data |
---|---|---|
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 | 6 | name = openldap |
b0a34906 | 7 | version = 2.4.32 |
d236d00d | 8 | release = 2 |
8b63a194 | 9 | |
802ea3af MT |
10 | groups = System/Daemons |
11 | url = http://www.openldap.org/ | |
12 | license = OpenLDAP | |
13 | summary = LDAP support libraries. | |
8b63a194 | 14 | |
802ea3af MT |
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 | |
8b63a194 | 21 | documentation for OpenLDAP. |
802ea3af | 22 | end |
8b63a194 | 23 | |
641c402a | 24 | source_dl = ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/ |
802ea3af | 25 | sources = %{thisapp}.tgz |
8b63a194 | 26 | |
802ea3af MT |
27 | build |
28 | requires | |
29 | db4-devel | |
30 | cyrus-sasl-devel | |
31 | groff | |
32 | libtool | |
33 | libtool-devel | |
34 | openssl-devel | |
35 | pth-devel | |
d236d00d | 36 | shadow-utils |
802ea3af | 37 | end |
25d74477 | 38 | |
802ea3af | 39 | configure_options += \ |
c8784213 | 40 | --libexecdir=%{libdir} \ |
802ea3af MT |
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 | |
8b63a194 | 54 | |
d236d00d SS |
55 | prepare_cmds |
56 | %{create_user} | |
57 | end | |
58 | ||
802ea3af | 59 | install_cmds |
c8784213 | 60 | mv -v %{BUILDROOT}%{libdir}/slapd %{BUILDROOT}/usr/sbin/slapd |
802ea3af MT |
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 | ||
d236d00d SS |
71 | # Remove unneeded files. |
72 | rm -rvf %{BUILDROOT}%{localstatedir}/openldap-data | |
73 | rm -rvf %{BUILDROOT}%{localstatedir}/run | |
802ea3af MT |
74 | |
75 | for LINK in lber ldap ldap_r; do | |
c8784213 | 76 | chmod -v 0755 %{BUILDROOT}%{libdir}/$(readlink %{BUILDROOT}%{libdir}/lib${LINK}.so) |
802ea3af MT |
77 | done |
78 | ||
79 | # Install configuration | |
80 | mkdir -pv %{BUILDROOT}/etc/%{name} | |
d236d00d SS |
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 | |
802ea3af MT |
93 | end |
94 | end | |
8b63a194 | 95 | |
d236d00d SS |
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 | ||
802ea3af MT |
102 | packages |
103 | package %{name} | |
d236d00d SS |
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 | ||
b0a34906 SS |
115 | script postin |
116 | systemctl daemon-reload >/dev/null 2>&1 || : | |
d236d00d | 117 | systemctl enable openldap.socket >/dev/null 2>&1 || : |
b0a34906 SS |
118 | end |
119 | ||
120 | script preun | |
121 | systemctl --no-reload disable openldap.service >/dev/null 2>&1 || : | |
d236d00d | 122 | systemctl --no-reload disable openldap.socket >/dev/null 2>&1 || : |
b0a34906 | 123 | systemctl stop openldap.service >/dev/null 2>&1 || : |
d236d00d | 124 | systemctl stop openldap.socket >/dev/null 2>&1 || : |
b0a34906 SS |
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 | |
8b63a194 | 136 | |
802ea3af MT |
137 | package %{name}-libs |
138 | template LIBS | |
139 | end | |
8b63a194 | 140 | |
802ea3af MT |
141 | package %{name}-devel |
142 | template DEVEL | |
143 | end | |
1f9bc2f0 MT |
144 | |
145 | package %{name}-debuginfo | |
146 | template DEBUGINFO | |
147 | end | |
802ea3af | 148 | end |