dovecot/dovecot.spec

changeset 153
b9de35d46e4e
parent 149
31dfae41ec78
child 161
79e49c6c1eb1
equal deleted inserted replaced
1:05ce7d2fdf7b 2:478875ad4025
168 --sysconfdir=%{l_prefix}/etc/dovecot \ 168 --sysconfdir=%{l_prefix}/etc/dovecot \
169 --with-ssldir=%{l_prefix}/etc/dovecot/ssl \ 169 --with-ssldir=%{l_prefix}/etc/dovecot/ssl \
170 --datadir=%{l_prefix}/share/dovecot \ 170 --datadir=%{l_prefix}/share/dovecot \
171 --docdir=%{l_prefix}/share/dovecot/doc \ 171 --docdir=%{l_prefix}/share/dovecot/doc \
172 --with-rundir=%{l_prefix}/var/dovecot/run \ 172 --with-rundir=%{l_prefix}/var/dovecot/run \
173 --with-statedir=%{l_prefix}/var/dovecot/dat \
173 --with-libiconv-prefix=%{l_prefix} \ 174 --with-libiconv-prefix=%{l_prefix} \
174 --with-ssl=openssl \ 175 --with-ssl=openssl \
175 --with-deliver \ 176 --with-deliver \
176 --with-docs \ 177 --with-docs \
177 %if "%{with_ldap}" == "yes" 178 %if "%{with_ldap}" == "yes"
248 ) || exit $? 249 ) || exit $?
249 %endif 250 %endif
250 251
251 # adjust file names of configuration files 252 # adjust file names of configuration files
252 ( cd $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot 253 ( cd $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot
253 for i in dovecot dovecot-ldap dovecot-sql; do 254 for i in dovecot dovecot-db dovecot-ldap dovecot-sql; do
254 mv ${i}{-example,}.conf 255 mv ${i}{-example,}.conf
255 done 256 done
256 ) || exit $? 257 ) || exit $?
257 258
258 # create additional dirctories 259 # create additional dirctories
259 %{l_shtool} mkdir -f -p -m 755 \ 260 %{l_shtool} mkdir -f -p -m 755 \
260 $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot/ssl \ 261 $RPM_BUILD_ROOT%{l_prefix}/etc/dovecot/ssl \
262 $RPM_BUILD_ROOT%{l_prefix}/var/dovecot/dat \
261 $RPM_BUILD_ROOT%{l_prefix}/var/dovecot/log \ 263 $RPM_BUILD_ROOT%{l_prefix}/var/dovecot/log \
262 $RPM_BUILD_ROOT%{l_prefix}/var/dovecot/run/login 264 $RPM_BUILD_ROOT%{l_prefix}/var/dovecot/run/login
263 265
264 # install run-command script 266 # install runcommand script
265 %{l_shtool} mkdir -f -p -m 755 \ 267 %{l_shtool} mkdir -f -p -m 755 \
266 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d 268 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
267 %if "%{with_pop3d}" == "yes" 269 %if "%{with_pop3d}" == "yes"
268 cmd='/<\/\{0,1\}with_pop3d>/d' 270 cmd='/<\/\{0,1\}with_pop3d>/d'
269 %else 271 %else
280 %{SOURCE fsl.dovecot} \ 282 %{SOURCE fsl.dovecot} \
281 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ 283 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
282 284
283 # strip installation 285 # strip installation
284 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/dovecot/{,*}/*.la \ 286 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/dovecot/{,*}/*.la \
287 >/dev/null 2>&1 || true
288 rmdir $RPM_BUILD_ROOT%{l_prefix}/include/dovecot \
289 $RPM_BUILD_ROOT%{l_prefix}/include \
285 >/dev/null 2>&1 || true 290 >/dev/null 2>&1 || true
286 strip \ 291 strip \
287 $RPM_BUILD_ROOT%{l_prefix}/sbin/* \ 292 $RPM_BUILD_ROOT%{l_prefix}/sbin/* \
288 $RPM_BUILD_ROOT%{l_prefix}/libexec/dovecot/* \ 293 $RPM_BUILD_ROOT%{l_prefix}/libexec/dovecot/* \
289 >/dev/null 2>&1 || true 294 >/dev/null 2>&1 || true
294 '%config %{l_prefix}/etc/fsl/fsl.dovecot' \ 299 '%config %{l_prefix}/etc/fsl/fsl.dovecot' \
295 '%config %attr(0600,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/dovecot/*' \ 300 '%config %attr(0600,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/dovecot/*' \
296 '%config %attr(0640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/dovecot/dovecot.conf' \ 301 '%config %attr(0640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/dovecot/dovecot.conf' \
297 '%dir %attr(0700,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/dovecot/ssl' \ 302 '%dir %attr(0700,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/dovecot/ssl' \
298 '%dir %attr(0755,%{l_susr},%{l_mgrp}) %{l_prefix}/var/dovecot' \ 303 '%dir %attr(0755,%{l_susr},%{l_mgrp}) %{l_prefix}/var/dovecot' \
304 '%dir %attr(0770,%{l_susr},%{l_rgrp}) %{l_prefix}/var/dovecot/dat' \
299 '%dir %attr(0770,%{l_susr},%{l_rgrp}) %{l_prefix}/var/dovecot/log' \ 305 '%dir %attr(0770,%{l_susr},%{l_rgrp}) %{l_prefix}/var/dovecot/log' \
300 '%dir %attr(0755,%{l_susr},%{l_mgrp}) %{l_prefix}/var/dovecot/run' \ 306 '%dir %attr(0755,%{l_susr},%{l_rgrp}) %{l_prefix}/var/dovecot/run' \
301 '%dir %attr(0750,%{l_susr},%{l_mgrp}) %{l_prefix}/var/dovecot/run/login' \ 307 '%dir %attr(0750,%{l_susr},%{l_ngrp}) %{l_prefix}/var/dovecot/run/login' \
302 '%doc %{l_prefix}/share/dovecot/doc' \ 308 '%doc %{l_prefix}/share/dovecot/doc' \
303 '%doc %{l_prefix}/share/dovecot/doc/wiki' 309 '%doc %{l_prefix}/share/dovecot/doc/wiki'
304 310
305 %files -f files 311 %files -f files
306 312
317 %preun 323 %preun
318 # before erase, stop service and remove log files 324 # before erase, stop service and remove log files
319 [ $1 -eq 0 ] || exit 0 325 [ $1 -eq 0 ] || exit 0
320 %{l_rc} dovecot stop 2>/dev/null 326 %{l_rc} dovecot stop 2>/dev/null
321 rm -f $RPM_INSTALL_PREFIX/var/dovecot/* >/dev/null 2>&1 || true 327 rm -f $RPM_INSTALL_PREFIX/var/dovecot/* >/dev/null 2>&1 || true
328 rm -f $RPM_INSTALL_PREFIX/var/dovecot/dat/* >/dev/null 2>&1 || true
322 rm -f $RPM_INSTALL_PREFIX/var/dovecot/log/* >/dev/null 2>&1 || true 329 rm -f $RPM_INSTALL_PREFIX/var/dovecot/log/* >/dev/null 2>&1 || true
323 rm -f $RPM_INSTALL_PREFIX/var/dovecot/run/* >/dev/null 2>&1 || true 330 rm -f $RPM_INSTALL_PREFIX/var/dovecot/run/* >/dev/null 2>&1 || true
324 rm -f $RPM_INSTALL_PREFIX/var/dovecot/run/login/* >/dev/null 2>&1 || true 331 rm -f $RPM_INSTALL_PREFIX/var/dovecot/run/login/* >/dev/null 2>&1 || true
325 exit 0 332 exit 0
326 333

mercurial