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