252 ) || exit $? |
252 ) || exit $? |
253 %endif |
253 %endif |
254 |
254 |
255 %install |
255 %install |
256 rm -rf $RPM_BUILD_ROOT |
256 rm -rf $RPM_BUILD_ROOT |
257 %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" |
257 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
258 |
258 |
259 %if "%{with_sieve}" == "yes" |
259 %if "%{with_sieve}" == "yes" |
260 # install optional Dovecot LDA sieve plugin |
260 # install optional Dovecot LDA sieve plugin |
261 ( cd dovecot-%{V_sieve_base}-sieve-%{V_sieve} |
261 ( cd dovecot-%{V_sieve_base}-sieve-%{V_sieve} |
262 %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" |
262 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
263 ) || exit $? |
263 ) || exit $? |
264 %endif |
264 %endif |
265 %if "%{with_managesieve}" == "yes" |
265 %if "%{with_managesieve}" == "yes" |
266 # install optional Dovecot LDA managesieve daemon |
266 # install optional Dovecot LDA managesieve daemon |
267 ( cd dovecot-%{V_managesieved_base}-managesieve-%{V_managesieved} |
267 ( cd dovecot-%{V_managesieved_base}-managesieve-%{V_managesieved} |
268 %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" |
268 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
269 ) || exit $? |
269 ) || exit $? |
270 %endif |
270 %endif |
271 |
271 |
272 # create additional dirctories |
272 # create additional dirctories |
273 %{l_shtool} mkdir -f -p -m 755 \ |
273 %{l_shtool} mkdir -f -p -m 755 \ |
274 $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot/ssl \ |
274 $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot/ssl \ |
|
275 $RPM_BUILD_ROOT%{l_prefix}/var/dovecot/dat \ |
275 $RPM_BUILD_ROOT%{l_prefix}/var/dovecot/log \ |
276 $RPM_BUILD_ROOT%{l_prefix}/var/dovecot/log \ |
276 $RPM_BUILD_ROOT%{l_prefix}/var/dovecot/run/login |
277 $RPM_BUILD_ROOT%{l_prefix}/var/dovecot/run/login |
277 |
278 |
278 # install run-command script |
279 # install runcommand script |
279 %{l_shtool} mkdir -f -p -m 755 \ |
280 %{l_shtool} mkdir -f -p -m 755 \ |
280 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d |
281 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d |
281 %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
282 %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
282 %{SOURCE rc.dovecot} \ |
283 %{SOURCE rc.dovecot} \ |
283 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
284 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
284 |
285 |
285 # strip installation |
286 # strip installation |
286 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot/dovecot*example.conf |
287 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot/dovecot*example.conf |
287 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/dovecot/{,*}/*.la \ |
288 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/dovecot/{,*}/*.la \ |
288 >/dev/null 2>&1 || true |
289 >/dev/null 2>&1 || true |
|
290 rmdir $RPM_BUILD_ROOT%{l_prefix}/lib/dovecot/auth \ |
|
291 $RPM_BUILD_ROOT%{l_prefix}/include/dovecot \ |
|
292 $RPM_BUILD_ROOT%{l_prefix}/include \ |
|
293 >/dev/null 2>&1 || true |
289 strip \ |
294 strip \ |
290 $RPM_BUILD_ROOT%{l_prefix}/sbin/* \ |
295 $RPM_BUILD_ROOT%{l_prefix}/sbin/* \ |
291 $RPM_BUILD_ROOT%{l_prefix}/libexec/dovecot/* \ |
296 $RPM_BUILD_ROOT%{l_prefix}/libexec/dovecot/* \ |
292 >/dev/null 2>&1 || true |
297 >/dev/null 2>&1 || true |
293 |
298 |
294 # install default server configuration |
299 # install default server configuration |
295 %{l_shtool} mkdir -f -p -m 755 \ |
300 %{l_shtool} mkdir -f -p -m 755 \ |
296 $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot |
301 $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot |
297 %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
302 %{l_shtool} install -c -m 640 %{l_value -s -a} \ |
298 %{SOURCE dovecot.conf} \ |
303 %{SOURCE dovecot.conf} \ |
299 $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot/ |
304 $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot/ |
300 |
305 |
301 # install OSSP fsl configuration |
306 # install OSSP fsl configuration |
302 %{l_shtool} mkdir -f -p -m 755 \ |
307 %{l_shtool} mkdir -f -p -m 755 \ |
308 # generate file list |
313 # generate file list |
309 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \ |
314 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \ |
310 '%not %dir %{l_prefix}/etc/fsl' \ |
315 '%not %dir %{l_prefix}/etc/fsl' \ |
311 '%config %{l_prefix}/etc/fsl/fsl.dovecot' \ |
316 '%config %{l_prefix}/etc/fsl/fsl.dovecot' \ |
312 '%config %attr(0600,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/dovecot/*' \ |
317 '%config %attr(0600,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/dovecot/*' \ |
313 '%config %attr(0644,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/dovecot/dovecot.conf' \ |
318 '%config %attr(0640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/dovecot/dovecot.conf' \ |
314 '%dir %attr(0700,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/dovecot/ssl' \ |
319 '%dir %attr(0700,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/dovecot/ssl' \ |
315 '%dir %attr(0755,%{l_susr},%{l_mgrp}) %{l_prefix}/var/dovecot' \ |
320 '%dir %attr(0755,%{l_musr},%{l_mgrp}) %{l_prefix}/var/dovecot' \ |
316 '%dir %attr(0770,%{l_susr},%{l_rgrp}) %{l_prefix}/var/dovecot/log' \ |
321 '%dir %attr(0770,%{l_musr},%{l_rgrp}) %{l_prefix}/var/dovecot/dat' \ |
317 '%dir %attr(0755,%{l_susr},%{l_mgrp}) %{l_prefix}/var/dovecot/run' \ |
322 '%dir %attr(0770,%{l_musr},%{l_rgrp}) %{l_prefix}/var/dovecot/log' \ |
318 '%dir %attr(0750,%{l_susr},%{l_mgrp}) %{l_prefix}/var/dovecot/run/login' \ |
323 '%dir %attr(0750,%{l_musr},%{l_rgrp}) %{l_prefix}/var/dovecot/run' \ |
|
324 '%dir %attr(0750,%{l_musr},%{l_ngrp}) %{l_prefix}/var/dovecot/run/login' \ |
319 '%doc %{l_prefix}/share/dovecot/doc' \ |
325 '%doc %{l_prefix}/share/dovecot/doc' \ |
320 '%doc %{l_prefix}/share/dovecot/doc/wiki' |
326 '%doc %{l_prefix}/share/dovecot/doc/wiki' |
321 |
327 |
322 %files -f files |
328 %files -f files |
323 |
329 |
334 %preun |
340 %preun |
335 # before erase, stop service and remove log files |
341 # before erase, stop service and remove log files |
336 [ $1 -eq 0 ] || exit 0 |
342 [ $1 -eq 0 ] || exit 0 |
337 %{l_rc} dovecot stop 2>/dev/null |
343 %{l_rc} dovecot stop 2>/dev/null |
338 rm -f $RPM_INSTALL_PREFIX/var/dovecot/* >/dev/null 2>&1 || true |
344 rm -f $RPM_INSTALL_PREFIX/var/dovecot/* >/dev/null 2>&1 || true |
|
345 rm -f $RPM_INSTALL_PREFIX/var/dovecot/dat/* >/dev/null 2>&1 || true |
339 rm -f $RPM_INSTALL_PREFIX/var/dovecot/log/* >/dev/null 2>&1 || true |
346 rm -f $RPM_INSTALL_PREFIX/var/dovecot/log/* >/dev/null 2>&1 || true |
340 rm -f $RPM_INSTALL_PREFIX/var/dovecot/run/* >/dev/null 2>&1 || true |
347 rm -f $RPM_INSTALL_PREFIX/var/dovecot/run/* >/dev/null 2>&1 || true |
341 rm -f $RPM_INSTALL_PREFIX/var/dovecot/run/login/* >/dev/null 2>&1 || true |
348 rm -f $RPM_INSTALL_PREFIX/var/dovecot/run/login/* >/dev/null 2>&1 || true |
342 exit 0 |
349 exit 0 |
343 |
350 |