Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 72c72e4e7948374792ed31b3e65ecc17 > scriptlet

mailman-2.0.14-1.1.91mdk.ppc.rpm

PREUN

/bin/sh
if [ $1 = 0 ]; then
  # since we compile pyc files during %post, we need to remove them here on uninstall
  find /var/lib/mailman/Mailman -name *.pyc -exec rm -f {} \;
  rm -f /var/lib/mailman/{bin,cron}/paths.pyc
fi

POSTIN

/bin/sh
cd /var/lib/mailman
bin/update | tee ./updates.log > /dev/null
bin/check_perms -f > /dev/null
if [ $1 = 1 ]; then
  if [ -f /etc/httpd/conf/httpd.conf ]; then
    echo 'Include conf/mailman.conf' >> /etc/httpd/conf/httpd.conf
  fi
  if [ -f /etc/postfix/aliases ]; then
    if [ `grep -c mailman /etc/postfix/aliases` = 0 ]; then
      echo '' >> /etc/postfix/aliases
      echo '# Added by the mailman rpm' >> /etc/postfix/aliases
      echo 'mailman:	root' >> /etc/postfix/aliases
      echo 'mailman-owner:	mailman' >> /etc/postfix/aliases
      newaliases
    fi
  fi
  crontab -u mail /var/lib/mailman/cron/crontab.in
  echo ''
  echo '*****'
  echo '* You must now "cd /var/lib/mailman/" and run "bin/mmsitepass" as root to set the'
  echo '* site password to be used for administrating all Mailman data as necessary.'
  echo '*****'
  echo ''
  /etc/rc.d/init.d/httpd update
fi
# we have to do the compilation post install otherwise buildroot is always
# embedded in the binaries
echo "Post-install compilation..."
/usr/bin/python -c 'from compileall import *; compile_dir("/var/lib/mailman/Mailman")' >/dev/null

POSTUN

/bin/sh
if [ $1 = 0 ]; then
  if [ -f /etc/httpd/conf/httpd.conf ]; then
    if [ -x /usr/bin/perl ]; then
      perl -pi -e "s|Include conf/mailman.conf\n||g;" /etc/httpd/conf/httpd.conf
      /etc/rc.d/init.d/httpd update
    fi
  fi
  if [ -f /etc/postfix/aliases ]; then
    if [ `grep -c mailman /etc/postfix/aliases` != 0 ]; then
      if [ -x /usr/bin/perl ]; then
        perl -pi -e "s|# Added by the mailman rpm\n||g;" /etc/postfix/aliases
        perl -pi -e "s|mailman:	root\n||g;" /etc/postfix/aliases
        perl -pi -e "s|mailman-owner:	mailman\n||g;" /etc/postfix/aliases
        newaliases
      fi
    fi
  fi
  crontab -u mail -r
fi