]>
Commit | Line | Data |
---|---|---|
27124d3b ER |
1 | # TODO |
2 | # - selinux_variants macro missing. something from fedora? | |
a922c5fb | 3 | # - merge with fedora-ds-base.spec |
27124d3b ER |
4 | # |
5 | # Conditional build: | |
58981443 | 6 | %bcond_with selinux # build with selinux |
fe3eda58 | 7 | |
7d96e9d8 | 8 | #%define subver .a1 |
9 | #%define rel 0.1 | |
fe3eda58 | 10 | |
11 | Summary: 389 Directory Server (base) | |
12 | Name: 389-ds-base | |
7d96e9d8 | 13 | Version: 1.2.8.1 |
14 | Release: 0 | |
27124d3b | 15 | License: GPL v2 with exceptions |
fe3eda58 | 16 | Group: Daemons |
17 | URL: http://directory.fedoraproject.org/ | |
7d96e9d8 | 18 | Source0: http://directory.fedoraproject.org/sources/%{name}-%{version}.tar.bz2 |
19 | # Source0-md5: d12829ca71b28222fbe66b0939d2af4f | |
fe3eda58 | 20 | BuildRequires: cyrus-sasl-devel |
58981443 | 21 | BuildRequires: db-devel |
fe3eda58 | 22 | BuildRequires: libicu-devel |
23 | BuildRequires: libnl-devel | |
f43b38c9 | 24 | BuildRequires: libstdc++-devel |
fe3eda58 | 25 | BuildRequires: mozldap-devel |
26 | BuildRequires: nspr-devel | |
27 | BuildRequires: nss-devel | |
c6944e7d | 28 | BuildRequires: pciutils-devel |
fe3eda58 | 29 | BuildRequires: pcre-devel |
f43b38c9 | 30 | BuildRequires: perl-devel |
31 | BuildRequires: pkgconfig | |
32 | BuildRequires: rpm-pythonprov | |
58981443 | 33 | BuildRequires: rpmbuild(macros) >= 1.268 |
fe3eda58 | 34 | BuildRequires: svrcore-devel |
fe3eda58 | 35 | %ifnarch sparc sparc64 ppc ppc64 s390 s390x |
36 | BuildRequires: lm_sensors-devel | |
37 | %endif | |
38 | BuildRequires: bzip2-devel | |
39 | BuildRequires: openssl-devel | |
fe3eda58 | 40 | BuildRequires: zlib-devel |
58981443 ER |
41 | # The following are needed to build the snmp ldap-agent |
42 | BuildRequires: net-snmp-devel | |
fe3eda58 | 43 | # The following are needed to build the SELinux policy |
27124d3b ER |
44 | %if %{with selinux} |
45 | BuildRequires: checkpolicy | |
46 | BuildRequires: policycoreutils | |
47 | %endif | |
fe3eda58 | 48 | # the following is for the pam passthru auth plug-in |
49 | BuildRequires: pam-devel | |
fe3eda58 | 50 | # the following are needed for some of our scripts |
51 | Requires: mozldap-tools | |
52 | Requires: perl-Mozilla-LDAP | |
fe3eda58 | 53 | # this is needed to setup SSL if you are not using the |
54 | # administration server package | |
55 | Requires: nss-tools | |
fe3eda58 | 56 | # these are not found by the auto-dependency method |
57 | # they are required to support the mandatory LDAP SASL mechs | |
fe3eda58 | 58 | Requires: cyrus-sasl-digest-md5 |
27124d3b | 59 | Requires: cyrus-sasl-gssapi |
fe3eda58 | 60 | # this is needed for verify-db.pl |
58981443 | 61 | Requires(post,preun): /sbin/chkconfig |
27124d3b | 62 | Requires: db-utils |
58981443 ER |
63 | Requires: rc-scripts |
64 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
fe3eda58 | 65 | |
fe3eda58 | 66 | %description |
67 | 389 Directory Server is an LDAPv3 compliant server. The base package | |
68 | includes the LDAP server and command line utilities for server | |
69 | administration. | |
70 | ||
58981443 | 71 | %package devel |
fe3eda58 | 72 | Summary: Development libraries for 389 Directory Server |
73 | Group: Development/Libraries | |
74 | Requires: %{name} = %{version}-%{release} | |
75 | Requires: mozldap-devel | |
76 | ||
77 | %description devel | |
78 | Development Libraries and headers for the 389 Directory Server base | |
79 | package. | |
80 | ||
27124d3b | 81 | %package selinux |
fe3eda58 | 82 | Summary: SELinux policy for 389 Directory Server |
83 | Group: Daemons | |
84 | Requires: %{name} = %{version}-%{release} | |
85 | Requires: selinux-policy | |
86 | ||
27124d3b | 87 | %description selinux |
fe3eda58 | 88 | SELinux policy for the 389 Directory Server base package. |
89 | ||
27124d3b | 90 | %package selinux-devel |
fe3eda58 | 91 | Summary: Development interface for 389 Directory Server base SELinux policy |
92 | Group: Development/Libraries | |
93 | ||
27124d3b | 94 | %description selinux-devel |
fe3eda58 | 95 | SELinux policy interface for the 389 Directory Server base package. |
fe3eda58 | 96 | |
fe3eda58 | 97 | %prep |
7d96e9d8 | 98 | %setup -q |
fe3eda58 | 99 | |
100 | %build | |
101 | %configure \ | |
102 | --enable-autobind \ | |
103 | --without-kerberos \ | |
27124d3b | 104 | %{?with_selinux:--with-selinux} |
fe3eda58 | 105 | |
106 | # Generate symbolic info for debuggers | |
27124d3b | 107 | export XCFLAGS="%{rpmcflags}" |
fe3eda58 | 108 | |
109 | %ifarch x86_64 ppc64 ia64 s390x sparc64 | |
110 | export USE_64=1 | |
111 | %endif | |
112 | ||
27124d3b | 113 | %{__make} |
fe3eda58 | 114 | |
27124d3b | 115 | %if %{with selinux} |
fe3eda58 | 116 | # Build the SELinux policy module for each variant |
117 | cd selinux-built | |
27124d3b ER |
118 | for selinuxvariant in %{selinux_variants}; do |
119 | %{__make} NAME=${selinuxvariant} -f %{_datadir}/selinux/devel/Makefile | |
120 | mv dirsrv.pp dirsrv.pp.${selinuxvariant} | |
121 | %{__make} NAME=${selinuxvariant} -f %{_datadir}/selinux/devel/Makefile clean | |
fe3eda58 | 122 | done |
123 | cd - | |
124 | %endif | |
125 | ||
126 | %install | |
127 | rm -rf $RPM_BUILD_ROOT | |
128 | ||
27124d3b ER |
129 | %{__make} install \ |
130 | DESTDIR=$RPM_BUILD_ROOT | |
fe3eda58 | 131 | |
132 | install -d $RPM_BUILD_ROOT/var/log/dirsrv | |
133 | install -d $RPM_BUILD_ROOT/var/lib/dirsrv | |
134 | install -d $RPM_BUILD_ROOT/var/lock/dirsrv | |
135 | install -d $RPM_BUILD_ROOT%{_includedir}/dirsrv | |
136 | ||
27124d3b | 137 | # remove libtool and static libs |
fe3eda58 | 138 | rm -f $RPM_BUILD_ROOT%{_libdir}/dirsrv/*.a |
139 | rm -f $RPM_BUILD_ROOT%{_libdir}/dirsrv/*.la | |
140 | rm -f $RPM_BUILD_ROOT%{_libdir}/dirsrv/plugins/*.a | |
141 | rm -f $RPM_BUILD_ROOT%{_libdir}/dirsrv/plugins/*.la | |
142 | ||
143 | install -p ldap/servers/slapd/slapi-plugin.h $RPM_BUILD_ROOT%{_includedir}/dirsrv/ | |
144 | install -p ldap/servers/plugins/replication/winsync-plugin.h $RPM_BUILD_ROOT%{_includedir}/dirsrv/ | |
145 | ||
146 | # make sure perl scripts have a proper shebang | |
147 | sed -i -e 's|#{{PERL-EXEC}}|#!/usr/bin/perl|' $RPM_BUILD_ROOT%{_datadir}/dirsrv/script-templates/template-*.pl | |
148 | ||
27124d3b | 149 | %if %{with selinux} |
fe3eda58 | 150 | # Install the SELinux policy |
151 | cd selinux-built | |
27124d3b ER |
152 | for selinuxvariant in %{selinux_variants}; do |
153 | install -d $RPM_BUILD_ROOT%{_datadir}/selinux/${selinuxvariant} | |
154 | install -p -m 644 dirsrv.pp.${selinuxvariant} \ | |
155 | $RPM_BUILD_ROOT%{_datadir}/selinux/${selinuxvariant}/dirsrv.pp | |
fe3eda58 | 156 | done |
157 | cd - | |
158 | ||
159 | # Install the SELinux policy interface | |
160 | cd selinux-built | |
161 | install -d $RPM_BUILD_ROOT%{_datadir}/dirsrv-selinux | |
162 | install -p dirsrv.if $RPM_BUILD_ROOT%{_datadir}/dirsrv-selinux/dirsrv.if | |
163 | install -p dirsrv.te $RPM_BUILD_ROOT%{_datadir}/dirsrv-selinux/dirsrv.te | |
164 | install -p dirsrv.fc $RPM_BUILD_ROOT%{_datadir}/dirsrv-selinux/dirsrv.fc | |
165 | cd - | |
166 | %endif | |
167 | ||
168 | %clean | |
169 | rm -rf $RPM_BUILD_ROOT | |
170 | ||
171 | %post | |
27124d3b | 172 | /sbin/chkconfig --add dirsrv |
fe3eda58 | 173 | /sbin/chkconfig --add dirsrv-snmp |
174 | if [ ! -e %{_localstatedir}/run/dirsrv ]; then | |
58981443 | 175 | install -d %{_localstatedir}/run/dirsrv |
36e6ee8d | 176 | fi |
fe3eda58 | 177 | |
178 | %preun | |
27124d3b ER |
179 | if [ "$1" = 0 ]; then |
180 | %service dirsrv stop | |
181 | /sbin/chkconfig --del dirsrv | |
182 | %service dirsrv-snmp stop | |
183 | /sbin/chkconfig --del dirsrv-snmp | |
fe3eda58 | 184 | fi |
185 | ||
fe3eda58 | 186 | %post selinux |
187 | if [ "$1" -le "1" ] ; then # First install | |
27124d3b ER |
188 | for selinuxvariant in %{selinux_variants}; do |
189 | semodule -s ${selinuxvariant} -i %{_datadir}/selinux/${selinuxvariant}/dirsrv.pp 2>/dev/null || : | |
190 | done | |
191 | fixfiles -R %{name} restore || : | |
192 | /sbin/service dirsrv condrestart > /dev/null 2>&1 || : | |
193 | /sbin/service dirsrv-snmp condrestart > /dev/null 2>&1 || : | |
fe3eda58 | 194 | fi |
195 | ||
196 | %preun selinux | |
197 | if [ "$1" -lt "1" ]; then # Final removal | |
27124d3b ER |
198 | for selinuxvariant in %{selinux_variants}; do |
199 | semodule -s ${selinuxvariant} -r dirsrv 2>/dev/null || : | |
200 | done | |
201 | fixfiles -R %{name} restore || : | |
202 | %service dirsrv condrestart > /dev/null 2>&1 || : | |
203 | %service dirsrv-snmp condrestart > /dev/null 2>&1 || : | |
fe3eda58 | 204 | fi |
205 | ||
206 | %postun selinux | |
207 | if [ "$1" -ge "1" ]; then # Upgrade | |
27124d3b ER |
208 | for selinuxvariant in %{selinux_variants}; do |
209 | semodule -s ${selinuxvariant} -i %{_datadir}/selinux/${selinuxvariant}/dirsrv.pp 2>/dev/null || : | |
210 | done | |
fe3eda58 | 211 | fi |
fe3eda58 | 212 | |
213 | %files | |
214 | %defattr(644,root,root,755) | |
215 | %doc LICENSE EXCEPTION LICENSE.GPLv2 | |
216 | %dir %{_sysconfdir}/dirsrv | |
217 | %dir %{_sysconfdir}/dirsrv/schema | |
fe3eda58 | 218 | %dir %{_sysconfdir}/dirsrv/config |
27124d3b ER |
219 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dirsrv/schema/*.ldif |
220 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dirsrv/config/slapd-collations.conf | |
221 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dirsrv/config/certmap.conf | |
222 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dirsrv/config/ldap-agent.conf | |
223 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dirsrv/config/template-initconfig | |
224 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dirsrv | |
fe3eda58 | 225 | %{_datadir}/dirsrv |
226 | %attr(754,root,root) /etc/rc.d/init.d/dirsrv | |
227 | %attr(754,root,root) /etc/rc.d/init.d/dirsrv-snmp | |
228 | %attr(755,root,root) %{_bindir}/* | |
229 | %attr(755,root,root) %{_sbindir}/* | |
230 | %dir %{_libdir}/dirsrv | |
231 | %attr(755,root,root) %{_libdir}/dirsrv/*.so.* | |
232 | %{_libdir}/dirsrv/perl | |
233 | %dir %{_libdir}/dirsrv/plugins | |
234 | %{_libdir}/dirsrv/plugins/*.so | |
235 | %dir %{_localstatedir}/lib/dirsrv | |
236 | %dir %{_localstatedir}/log/dirsrv | |
237 | %dir %{_localstatedir}/lock/dirsrv | |
238 | %{_mandir}/man1/* | |
239 | %{_mandir}/man8/* | |
240 | ||
241 | %files devel | |
242 | %defattr(644,root,root,755) | |
243 | %{_includedir}/dirsrv | |
244 | %{_libdir}/dirsrv/*.so | |
7d96e9d8 | 245 | %{_pkgconfigdir}/dirsrv.pc |
fe3eda58 | 246 | |
27124d3b | 247 | %if %{with selinux} |
fe3eda58 | 248 | %files selinux |
249 | %defattr(644,root,root,755) | |
250 | %{_datadir}/selinux/*/dirsrv.pp | |
251 | ||
252 | %files selinux-devel | |
253 | %defattr(644,root,root,755) | |
254 | %{_datadir}/dirsrv-selinux | |
fe3eda58 | 255 | %endif |