Bladeren bron

Complete for compliance with features described by ticket #202

Michael Schloh von Bennewitz 22 jaren geleden
bovenliggende
commit
420ca6e62b
1 gewijzigde bestanden met toevoegingen van 21 en 1 verwijderingen
  1. 21 1
      imapd/imapd.spec

+ 21 - 1
imapd/imapd.spec

@@ -33,7 +33,7 @@ Distribution: OpenPKG [PLUS]
 Group:        Mail
 License:      BSD
 Version:      2.1.14
-Release:      20030806
+Release:      20030808
 
 #   package options
 %option       with_fsl    yes
@@ -239,6 +239,26 @@ AutoReqProv:  no
         '%dir %attr(0750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/imapd/*' \
         '%dir %attr(0770,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/imapd/*/*' \
         '%dir %attr(0770,%{l_musr},%{l_rgrp}) %{l_prefix}/var/imapd/socket'
+%pre
+    #   before upgrade, save status and stop service
+    [ $1 -eq 2 ] || exit 0
+    eval `%{l_rc} imapd status 2>/dev/null | tee %{l_tmpfile}`
+    %{l_rc} imapd stop 2>/dev/null
+    exit 0
+
+%post
+    if [ $1 -eq 2 ]; then
+        #   after upgrade, restore status
+        eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
+        [ ".$imapd_active" = .yes ] && %{l_rc} imapd start
+    fi
+    exit 0
+
+%preun
+    #   before erase, stop service and remove log files
+    [ $1 -eq 0 ] || exit 0
+    %{l_rc} imapd stop 2>/dev/null
+    exit 0
 
 %files -f files