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