Sophie

Sophie

distrib > PLD > ac > amd64 > by-pkgid > 4bd076547d9661e9abb7e183dffbca39 > scriptlet

mailman-2.1.9-3.amd64.rpm

PREIN

/bin/sh

 
 
if [ -n "`/usr/bin/getgid mailman`" ]; then 
	if [ "`/usr/bin/getgid mailman`" != "94" ]; then 
		echo "Error: group mailman doesn't have gid=94. Correct this before installing mailman." 1>&2 
		exit 1 
	fi 
else 
	echo "Adding group mailman GID=94." 
	/usr/sbin/groupadd -g 94 -r mailman 1>&2 || exit $? 
	[ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i group || : 
fi;
 
 
 
if [ -n "`/bin/id -u mailman 2>/dev/null`" ]; then 
	if [ "`/bin/id -u mailman`" != "94" ]; then 
		echo "Error: user mailman doesn't have uid=94. Correct this before installing mailman." 1>&2 
		exit 1 
	fi 
else 
	echo "Adding user mailman UID=94." 
	/usr/sbin/useradd \
		 \
		-u 94 \
		-r \
		-d /var/lib/mailman \
		-s /bin/false \
		-c "GNU Mailing List Manager"\
		-g mailman \
		 \
		 \
		mailman 1>&2 || exit $? 
	[ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i passwd || : 
fi;

PREUN

/bin/sh
if [ "$1" = "0" ]; then
	{
if [ -f /var/lock/subsys/mailman ]; then
/sbin/service mailman stop 1>&2 || :;
fi };	/sbin/chkconfig --del mailman
fi

POSTIN

/bin/sh
if [ "$1" = "1" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/crond ] && . /etc/sysconfig/crond
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/crond ]; then
/sbin/service crond restart 1>&2 || :;
fi
fi };fi
/usr/lib64/mailman/bin/update
/sbin/chkconfig --add mailman
if [ -f /var/lock/subsys/mailman ] && [ -d /var/spool/mailman/data ]; then
	ln -sf /etc/webapps/mailman/sitelist.cfg /var/spool/mailman/data/sitelist.cfg
fi
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/mailman ] && . /etc/sysconfig/mailman
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/mailman ]; then
/sbin/service mailman restart 1>&2 || :;
else
echo 'Run "/sbin/service mailman start" to start mailman qrunner daemon.'
fi
fi };

POSTUN

/bin/sh
if [ "$1" = "0" ]; then
	/usr/lib/rpm/user_group.sh user del mailman
	/usr/lib/rpm/user_group.sh group del mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/crond ] && . /etc/sysconfig/crond
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/crond ]; then
/sbin/service crond restart 1>&2 || :;
fi
fi };fi

Triggers

apache1 < 1.3.37-3

/bin/sh
 
if [ "$1" = "1" ] && [ "$2" = "1" ]; then
	/usr/sbin/webapp register apache mailman
fi
# reload webserver if the config symlink is there and skip reload if webserver is upgraded
if [ -L /etc/apache/webapps.d/mailman.conf ] && [ "$2" -lt "2" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/apache ]; then
/sbin/service apache reload 1>&2 || :;
fi
fi };
fi

apache1-base

/bin/sh
 
# remove link if either of the packages are gone 
if [ -n "" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/apache/webapps.d/mailman.conf ]; then 
	/usr/sbin/webapp unregister apache mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/apache ]; then
/sbin/service apache reload 1>&2 || :;
fi
fi };
fi

apache1 < 1.3.37-3

/bin/sh
 
if [ "$1" = "1" ] && [ "$2" = "1" ]; then
	/usr/sbin/webapp register httpd mailman
fi
# reload webserver if the config symlink is there and skip reload if webserver is upgraded
if [ -L /etc/httpd/webapps.d/mailman.conf ] && [ "$2" -lt "2" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };
fi

apache1-base

/bin/sh
 
# remove link if either of the packages are gone 
if [ -n "" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/httpd/webapps.d/mailman.conf ]; then 
	/usr/sbin/webapp unregister httpd mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };
fi

apache < 2.2.0

/bin/sh
if [ -f /var/spool/cron/mailman ]; then
	crontab -u mailman -r
fi

if [ -f /var/lock/subsys/mailman ]; then
	ln -sf /etc/webapps/mailman/sitelist.cfg /var/spool/mailman/data/sitelist.cfg
	/sbin/service mailman stop 1>&2
	stopped=true
fi

# rescue app configs.
for i in mm_cfg.py sitelist.cfg; do
	if [ -f /etc/mailman/$i.rpmsave ]; then
		mv -f /etc/webapps/mailman/$i{,.rpmnew}
		mv -f /etc/mailman/$i.rpmsave /etc/webapps/mailman/$i
	fi
done

if [ "`getent passwd mailman | cut -d: -f6`" != "/var/lib/mailman" ]; then
	echo "Fixing passwd entry"
	/usr/sbin/usermod -d /var/lib/mailman mailman
fi
echo "Moving data from /var/spool/mailman to /var/lib/mailman"
mv -f /var/spool/mailman/archives/private/* /var/lib/mailman/archives/private/
mv -f /var/spool/mailman/archives/public/* /var/lib/mailman/archives/public/
mv -f /var/spool/mailman/data/* /var/lib/mailman/data/
mv -f /var/spool/mailman/lists/* /var/lib/mailman/lists/
mv -f /var/spool/mailman/spam/* /var/lib/mailman/spam/
mv -f /var/spool/mailman/logs/* /var/log/mailman/
mv -f /var/spool/mailman/locks/* /var/lock/mailman/
mv -f /var/spool/mailman/qfiles/* /var/spool/mailman/
# Fix symlinks for public archives
cd /var/lib/mailman/archives/public/
for i in * ; do
	link=$(readlink "$i")
	dn=$(dirname "$link")
	if [ "$dn" = "/var/spool/mailman/archives/private" ]; then
		ln -sf "/var/lib/mailman/archives/private/$i" "$i"
	fi
done
cd -
# Remove empty dirs (DON'T rm -rf here!)
rmdir --ignore-fail-on-non-empty /var/spool/mailman/{archives/{private,public},archives,data,lists,spam,logs,locks,qfiles}
if [ -f /var/lib/mailman/Mailman/mm_cfg.pyc ]; then
	rm -f /var/lib/mailman/Mailman/mm_cfg.pyc
fi
/usr/lib64/mailman/bin/update
if [ "$stopped" = "true" ]; then
	rm -f /var/spool/mailman/data/sitelist.cfg
	/sbin/service mailman start 1>&2
fi

# nuke very-old config location (this mostly for Ra)
if [ -f /etc/httpd/httpd.conf ]; then
	sed -i -e "/^Include.*mailman.conf/d" /etc/httpd/httpd.conf
fi

# migrate from httpd (apache2) config dir
if [ -f /etc/httpd/mailman.conf.rpmsave ]; then
	cp -f /etc/webapps/mailman/httpd.conf{,.rpmnew}
	mv -f /etc/httpd/mailman.conf.rpmsave /etc/webapps/mailman/httpd.conf
fi

# migrate from httpd (apache2) config dir
if [ -f /etc/httpd/httpd.conf/90_mailman.conf.rpmsave ]; then
	cp -f /etc/webapps/mailman/httpd.conf{,.rpmnew}
	mv -f /etc/httpd/httpd.conf/90_mailman.conf.rpmsave /etc/webapps/mailman/httpd.conf
fi

rm -f /etc/httpd/httpd.conf/90_mailman.conf
/usr/sbin/webapp register httpd mailman
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };

apache-base

/bin/sh
 
if [ "$1" = "1" ] && [ "$2" = "1" ]; then
	/usr/sbin/webapp register apache mailman
fi
# reload webserver if the config symlink is there and skip reload if webserver is upgraded
if [ -L /etc/apache/webapps.d/mailman.conf ] && [ "$2" -lt "2" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/apache ]; then
/sbin/service apache reload 1>&2 || :;
fi
fi };
fi

apache < 2.2.0

/bin/sh
 
# remove link if either of the packages are gone 
if [ -n "" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/apache/webapps.d/mailman.conf ]; then 
	/usr/sbin/webapp unregister apache mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/apache ]; then
/sbin/service apache reload 1>&2 || :;
fi
fi };
fi

apache-base

/bin/sh
 
if [ "$1" = "1" ] && [ "$2" = "1" ]; then
	/usr/sbin/webapp register httpd mailman
fi
# reload webserver if the config symlink is there and skip reload if webserver is upgraded
if [ -L /etc/httpd/webapps.d/mailman.conf ] && [ "$2" -lt "2" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };
fi

mailman < 1:2.1.7-2.1

/bin/sh
 
# remove link if either of the packages are gone 
if [ -n "" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/httpd/webapps.d/mailman.conf ]; then 
	/usr/sbin/webapp unregister httpd mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };
fi

apache1 < 1.3.37-3

/bin/sh
if [ -f /var/spool/cron/mailman ]; then
	crontab -u mailman -r
fi

if [ -f /var/lock/subsys/mailman ]; then
	ln -sf /etc/webapps/mailman/sitelist.cfg /var/spool/mailman/data/sitelist.cfg
	/sbin/service mailman stop 1>&2
	stopped=true
fi

# rescue app configs.
for i in mm_cfg.py sitelist.cfg; do
	if [ -f /etc/mailman/$i.rpmsave ]; then
		mv -f /etc/webapps/mailman/$i{,.rpmnew}
		mv -f /etc/mailman/$i.rpmsave /etc/webapps/mailman/$i
	fi
done

if [ "`getent passwd mailman | cut -d: -f6`" != "/var/lib/mailman" ]; then
	echo "Fixing passwd entry"
	/usr/sbin/usermod -d /var/lib/mailman mailman
fi
echo "Moving data from /var/spool/mailman to /var/lib/mailman"
mv -f /var/spool/mailman/archives/private/* /var/lib/mailman/archives/private/
mv -f /var/spool/mailman/archives/public/* /var/lib/mailman/archives/public/
mv -f /var/spool/mailman/data/* /var/lib/mailman/data/
mv -f /var/spool/mailman/lists/* /var/lib/mailman/lists/
mv -f /var/spool/mailman/spam/* /var/lib/mailman/spam/
mv -f /var/spool/mailman/logs/* /var/log/mailman/
mv -f /var/spool/mailman/locks/* /var/lock/mailman/
mv -f /var/spool/mailman/qfiles/* /var/spool/mailman/
# Fix symlinks for public archives
cd /var/lib/mailman/archives/public/
for i in * ; do
	link=$(readlink "$i")
	dn=$(dirname "$link")
	if [ "$dn" = "/var/spool/mailman/archives/private" ]; then
		ln -sf "/var/lib/mailman/archives/private/$i" "$i"
	fi
done
cd -
# Remove empty dirs (DON'T rm -rf here!)
rmdir --ignore-fail-on-non-empty /var/spool/mailman/{archives/{private,public},archives,data,lists,spam,logs,locks,qfiles}
if [ -f /var/lib/mailman/Mailman/mm_cfg.pyc ]; then
	rm -f /var/lib/mailman/Mailman/mm_cfg.pyc
fi
/usr/lib64/mailman/bin/update
if [ "$stopped" = "true" ]; then
	rm -f /var/spool/mailman/data/sitelist.cfg
	/sbin/service mailman start 1>&2
fi

# nuke very-old config location (this mostly for Ra)
if [ -f /etc/httpd/httpd.conf ]; then
	sed -i -e "/^Include.*mailman.conf/d" /etc/httpd/httpd.conf
fi

# migrate from httpd (apache2) config dir
if [ -f /etc/httpd/mailman.conf.rpmsave ]; then
	cp -f /etc/webapps/mailman/httpd.conf{,.rpmnew}
	mv -f /etc/httpd/mailman.conf.rpmsave /etc/webapps/mailman/httpd.conf
fi

# migrate from httpd (apache2) config dir
if [ -f /etc/httpd/httpd.conf/90_mailman.conf.rpmsave ]; then
	cp -f /etc/webapps/mailman/httpd.conf{,.rpmnew}
	mv -f /etc/httpd/httpd.conf/90_mailman.conf.rpmsave /etc/webapps/mailman/httpd.conf
fi

rm -f /etc/httpd/httpd.conf/90_mailman.conf
/usr/sbin/webapp register httpd mailman
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };

apache1-base

/bin/sh
 
if [ "$1" = "1" ] && [ "$2" = "1" ]; then
	/usr/sbin/webapp register apache mailman
fi
# reload webserver if the config symlink is there and skip reload if webserver is upgraded
if [ -L /etc/apache/webapps.d/mailman.conf ] && [ "$2" -lt "2" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/apache ]; then
/sbin/service apache reload 1>&2 || :;
fi
fi };
fi

apache1 < 1.3.37-3

/bin/sh
 
# remove link if either of the packages are gone 
if [ -n "" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/apache/webapps.d/mailman.conf ]; then 
	/usr/sbin/webapp unregister apache mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/apache ]; then
/sbin/service apache reload 1>&2 || :;
fi
fi };
fi

apache1-base

/bin/sh
 
if [ "$1" = "1" ] && [ "$2" = "1" ]; then
	/usr/sbin/webapp register httpd mailman
fi
# reload webserver if the config symlink is there and skip reload if webserver is upgraded
if [ -L /etc/httpd/webapps.d/mailman.conf ] && [ "$2" -lt "2" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };
fi

apache < 2.2.0

/bin/sh
 
# remove link if either of the packages are gone 
if [ -n "" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/httpd/webapps.d/mailman.conf ]; then 
	/usr/sbin/webapp unregister httpd mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };
fi

apache-base

/bin/sh
if [ -f /var/spool/cron/mailman ]; then
	crontab -u mailman -r
fi

if [ -f /var/lock/subsys/mailman ]; then
	ln -sf /etc/webapps/mailman/sitelist.cfg /var/spool/mailman/data/sitelist.cfg
	/sbin/service mailman stop 1>&2
	stopped=true
fi

# rescue app configs.
for i in mm_cfg.py sitelist.cfg; do
	if [ -f /etc/mailman/$i.rpmsave ]; then
		mv -f /etc/webapps/mailman/$i{,.rpmnew}
		mv -f /etc/mailman/$i.rpmsave /etc/webapps/mailman/$i
	fi
done

if [ "`getent passwd mailman | cut -d: -f6`" != "/var/lib/mailman" ]; then
	echo "Fixing passwd entry"
	/usr/sbin/usermod -d /var/lib/mailman mailman
fi
echo "Moving data from /var/spool/mailman to /var/lib/mailman"
mv -f /var/spool/mailman/archives/private/* /var/lib/mailman/archives/private/
mv -f /var/spool/mailman/archives/public/* /var/lib/mailman/archives/public/
mv -f /var/spool/mailman/data/* /var/lib/mailman/data/
mv -f /var/spool/mailman/lists/* /var/lib/mailman/lists/
mv -f /var/spool/mailman/spam/* /var/lib/mailman/spam/
mv -f /var/spool/mailman/logs/* /var/log/mailman/
mv -f /var/spool/mailman/locks/* /var/lock/mailman/
mv -f /var/spool/mailman/qfiles/* /var/spool/mailman/
# Fix symlinks for public archives
cd /var/lib/mailman/archives/public/
for i in * ; do
	link=$(readlink "$i")
	dn=$(dirname "$link")
	if [ "$dn" = "/var/spool/mailman/archives/private" ]; then
		ln -sf "/var/lib/mailman/archives/private/$i" "$i"
	fi
done
cd -
# Remove empty dirs (DON'T rm -rf here!)
rmdir --ignore-fail-on-non-empty /var/spool/mailman/{archives/{private,public},archives,data,lists,spam,logs,locks,qfiles}
if [ -f /var/lib/mailman/Mailman/mm_cfg.pyc ]; then
	rm -f /var/lib/mailman/Mailman/mm_cfg.pyc
fi
/usr/lib64/mailman/bin/update
if [ "$stopped" = "true" ]; then
	rm -f /var/spool/mailman/data/sitelist.cfg
	/sbin/service mailman start 1>&2
fi

# nuke very-old config location (this mostly for Ra)
if [ -f /etc/httpd/httpd.conf ]; then
	sed -i -e "/^Include.*mailman.conf/d" /etc/httpd/httpd.conf
fi

# migrate from httpd (apache2) config dir
if [ -f /etc/httpd/mailman.conf.rpmsave ]; then
	cp -f /etc/webapps/mailman/httpd.conf{,.rpmnew}
	mv -f /etc/httpd/mailman.conf.rpmsave /etc/webapps/mailman/httpd.conf
fi

# migrate from httpd (apache2) config dir
if [ -f /etc/httpd/httpd.conf/90_mailman.conf.rpmsave ]; then
	cp -f /etc/webapps/mailman/httpd.conf{,.rpmnew}
	mv -f /etc/httpd/httpd.conf/90_mailman.conf.rpmsave /etc/webapps/mailman/httpd.conf
fi

rm -f /etc/httpd/httpd.conf/90_mailman.conf
/usr/sbin/webapp register httpd mailman
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };

apache < 2.2.0

/bin/sh
 
if [ "$1" = "1" ] && [ "$2" = "1" ]; then
	/usr/sbin/webapp register apache mailman
fi
# reload webserver if the config symlink is there and skip reload if webserver is upgraded
if [ -L /etc/apache/webapps.d/mailman.conf ] && [ "$2" -lt "2" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/apache ]; then
/sbin/service apache reload 1>&2 || :;
fi
fi };
fi

apache-base

/bin/sh
 
# remove link if either of the packages are gone 
if [ -n "" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/apache/webapps.d/mailman.conf ]; then 
	/usr/sbin/webapp unregister apache mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/apache ]; then
/sbin/service apache reload 1>&2 || :;
fi
fi };
fi

mailman < 1:2.1.7-2.1

/bin/sh
 
if [ "$1" = "1" ] && [ "$2" = "1" ]; then
	/usr/sbin/webapp register httpd mailman
fi
# reload webserver if the config symlink is there and skip reload if webserver is upgraded
if [ -L /etc/httpd/webapps.d/mailman.conf ] && [ "$2" -lt "2" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };
fi

apache1 < 1.3.37-3

/bin/sh
 
# remove link if either of the packages are gone 
if [ -n "" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/httpd/webapps.d/mailman.conf ]; then 
	/usr/sbin/webapp unregister httpd mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };
fi

apache1-base

/bin/sh
if [ -f /var/spool/cron/mailman ]; then
	crontab -u mailman -r
fi

if [ -f /var/lock/subsys/mailman ]; then
	ln -sf /etc/webapps/mailman/sitelist.cfg /var/spool/mailman/data/sitelist.cfg
	/sbin/service mailman stop 1>&2
	stopped=true
fi

# rescue app configs.
for i in mm_cfg.py sitelist.cfg; do
	if [ -f /etc/mailman/$i.rpmsave ]; then
		mv -f /etc/webapps/mailman/$i{,.rpmnew}
		mv -f /etc/mailman/$i.rpmsave /etc/webapps/mailman/$i
	fi
done

if [ "`getent passwd mailman | cut -d: -f6`" != "/var/lib/mailman" ]; then
	echo "Fixing passwd entry"
	/usr/sbin/usermod -d /var/lib/mailman mailman
fi
echo "Moving data from /var/spool/mailman to /var/lib/mailman"
mv -f /var/spool/mailman/archives/private/* /var/lib/mailman/archives/private/
mv -f /var/spool/mailman/archives/public/* /var/lib/mailman/archives/public/
mv -f /var/spool/mailman/data/* /var/lib/mailman/data/
mv -f /var/spool/mailman/lists/* /var/lib/mailman/lists/
mv -f /var/spool/mailman/spam/* /var/lib/mailman/spam/
mv -f /var/spool/mailman/logs/* /var/log/mailman/
mv -f /var/spool/mailman/locks/* /var/lock/mailman/
mv -f /var/spool/mailman/qfiles/* /var/spool/mailman/
# Fix symlinks for public archives
cd /var/lib/mailman/archives/public/
for i in * ; do
	link=$(readlink "$i")
	dn=$(dirname "$link")
	if [ "$dn" = "/var/spool/mailman/archives/private" ]; then
		ln -sf "/var/lib/mailman/archives/private/$i" "$i"
	fi
done
cd -
# Remove empty dirs (DON'T rm -rf here!)
rmdir --ignore-fail-on-non-empty /var/spool/mailman/{archives/{private,public},archives,data,lists,spam,logs,locks,qfiles}
if [ -f /var/lib/mailman/Mailman/mm_cfg.pyc ]; then
	rm -f /var/lib/mailman/Mailman/mm_cfg.pyc
fi
/usr/lib64/mailman/bin/update
if [ "$stopped" = "true" ]; then
	rm -f /var/spool/mailman/data/sitelist.cfg
	/sbin/service mailman start 1>&2
fi

# nuke very-old config location (this mostly for Ra)
if [ -f /etc/httpd/httpd.conf ]; then
	sed -i -e "/^Include.*mailman.conf/d" /etc/httpd/httpd.conf
fi

# migrate from httpd (apache2) config dir
if [ -f /etc/httpd/mailman.conf.rpmsave ]; then
	cp -f /etc/webapps/mailman/httpd.conf{,.rpmnew}
	mv -f /etc/httpd/mailman.conf.rpmsave /etc/webapps/mailman/httpd.conf
fi

# migrate from httpd (apache2) config dir
if [ -f /etc/httpd/httpd.conf/90_mailman.conf.rpmsave ]; then
	cp -f /etc/webapps/mailman/httpd.conf{,.rpmnew}
	mv -f /etc/httpd/httpd.conf/90_mailman.conf.rpmsave /etc/webapps/mailman/httpd.conf
fi

rm -f /etc/httpd/httpd.conf/90_mailman.conf
/usr/sbin/webapp register httpd mailman
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };

apache1 < 1.3.37-3

/bin/sh
 
if [ "$1" = "1" ] && [ "$2" = "1" ]; then
	/usr/sbin/webapp register apache mailman
fi
# reload webserver if the config symlink is there and skip reload if webserver is upgraded
if [ -L /etc/apache/webapps.d/mailman.conf ] && [ "$2" -lt "2" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/apache ]; then
/sbin/service apache reload 1>&2 || :;
fi
fi };
fi

apache1-base

/bin/sh
 
# remove link if either of the packages are gone 
if [ -n "" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/apache/webapps.d/mailman.conf ]; then 
	/usr/sbin/webapp unregister apache mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/apache ]; then
/sbin/service apache reload 1>&2 || :;
fi
fi };
fi

apache < 2.2.0

/bin/sh
 
if [ "$1" = "1" ] && [ "$2" = "1" ]; then
	/usr/sbin/webapp register httpd mailman
fi
# reload webserver if the config symlink is there and skip reload if webserver is upgraded
if [ -L /etc/httpd/webapps.d/mailman.conf ] && [ "$2" -lt "2" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };
fi

apache-base

/bin/sh
 
# remove link if either of the packages are gone 
if [ -n "" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/httpd/webapps.d/mailman.conf ]; then 
	/usr/sbin/webapp unregister httpd mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };
fi

apache < 2.2.0

/bin/sh
if [ -f /var/spool/cron/mailman ]; then
	crontab -u mailman -r
fi

if [ -f /var/lock/subsys/mailman ]; then
	ln -sf /etc/webapps/mailman/sitelist.cfg /var/spool/mailman/data/sitelist.cfg
	/sbin/service mailman stop 1>&2
	stopped=true
fi

# rescue app configs.
for i in mm_cfg.py sitelist.cfg; do
	if [ -f /etc/mailman/$i.rpmsave ]; then
		mv -f /etc/webapps/mailman/$i{,.rpmnew}
		mv -f /etc/mailman/$i.rpmsave /etc/webapps/mailman/$i
	fi
done

if [ "`getent passwd mailman | cut -d: -f6`" != "/var/lib/mailman" ]; then
	echo "Fixing passwd entry"
	/usr/sbin/usermod -d /var/lib/mailman mailman
fi
echo "Moving data from /var/spool/mailman to /var/lib/mailman"
mv -f /var/spool/mailman/archives/private/* /var/lib/mailman/archives/private/
mv -f /var/spool/mailman/archives/public/* /var/lib/mailman/archives/public/
mv -f /var/spool/mailman/data/* /var/lib/mailman/data/
mv -f /var/spool/mailman/lists/* /var/lib/mailman/lists/
mv -f /var/spool/mailman/spam/* /var/lib/mailman/spam/
mv -f /var/spool/mailman/logs/* /var/log/mailman/
mv -f /var/spool/mailman/locks/* /var/lock/mailman/
mv -f /var/spool/mailman/qfiles/* /var/spool/mailman/
# Fix symlinks for public archives
cd /var/lib/mailman/archives/public/
for i in * ; do
	link=$(readlink "$i")
	dn=$(dirname "$link")
	if [ "$dn" = "/var/spool/mailman/archives/private" ]; then
		ln -sf "/var/lib/mailman/archives/private/$i" "$i"
	fi
done
cd -
# Remove empty dirs (DON'T rm -rf here!)
rmdir --ignore-fail-on-non-empty /var/spool/mailman/{archives/{private,public},archives,data,lists,spam,logs,locks,qfiles}
if [ -f /var/lib/mailman/Mailman/mm_cfg.pyc ]; then
	rm -f /var/lib/mailman/Mailman/mm_cfg.pyc
fi
/usr/lib64/mailman/bin/update
if [ "$stopped" = "true" ]; then
	rm -f /var/spool/mailman/data/sitelist.cfg
	/sbin/service mailman start 1>&2
fi

# nuke very-old config location (this mostly for Ra)
if [ -f /etc/httpd/httpd.conf ]; then
	sed -i -e "/^Include.*mailman.conf/d" /etc/httpd/httpd.conf
fi

# migrate from httpd (apache2) config dir
if [ -f /etc/httpd/mailman.conf.rpmsave ]; then
	cp -f /etc/webapps/mailman/httpd.conf{,.rpmnew}
	mv -f /etc/httpd/mailman.conf.rpmsave /etc/webapps/mailman/httpd.conf
fi

# migrate from httpd (apache2) config dir
if [ -f /etc/httpd/httpd.conf/90_mailman.conf.rpmsave ]; then
	cp -f /etc/webapps/mailman/httpd.conf{,.rpmnew}
	mv -f /etc/httpd/httpd.conf/90_mailman.conf.rpmsave /etc/webapps/mailman/httpd.conf
fi

rm -f /etc/httpd/httpd.conf/90_mailman.conf
/usr/sbin/webapp register httpd mailman
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };

apache-base

/bin/sh
 
if [ "$1" = "1" ] && [ "$2" = "1" ]; then
	/usr/sbin/webapp register apache mailman
fi
# reload webserver if the config symlink is there and skip reload if webserver is upgraded
if [ -L /etc/apache/webapps.d/mailman.conf ] && [ "$2" -lt "2" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/apache ]; then
/sbin/service apache reload 1>&2 || :;
fi
fi };
fi

mailman < 1:2.1.7-2.1

/bin/sh
 
# remove link if either of the packages are gone 
if [ -n "" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/apache/webapps.d/mailman.conf ]; then 
	/usr/sbin/webapp unregister apache mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/apache ]; then
/sbin/service apache reload 1>&2 || :;
fi
fi };
fi

apache1 < 1.3.37-3

/bin/sh
 
if [ "$1" = "1" ] && [ "$2" = "1" ]; then
	/usr/sbin/webapp register httpd mailman
fi
# reload webserver if the config symlink is there and skip reload if webserver is upgraded
if [ -L /etc/httpd/webapps.d/mailman.conf ] && [ "$2" -lt "2" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };
fi

apache1-base

/bin/sh
 
# remove link if either of the packages are gone 
if [ -n "" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/httpd/webapps.d/mailman.conf ]; then 
	/usr/sbin/webapp unregister httpd mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };
fi

apache1 < 1.3.37-3

/bin/sh
if [ -f /var/spool/cron/mailman ]; then
	crontab -u mailman -r
fi

if [ -f /var/lock/subsys/mailman ]; then
	ln -sf /etc/webapps/mailman/sitelist.cfg /var/spool/mailman/data/sitelist.cfg
	/sbin/service mailman stop 1>&2
	stopped=true
fi

# rescue app configs.
for i in mm_cfg.py sitelist.cfg; do
	if [ -f /etc/mailman/$i.rpmsave ]; then
		mv -f /etc/webapps/mailman/$i{,.rpmnew}
		mv -f /etc/mailman/$i.rpmsave /etc/webapps/mailman/$i
	fi
done

if [ "`getent passwd mailman | cut -d: -f6`" != "/var/lib/mailman" ]; then
	echo "Fixing passwd entry"
	/usr/sbin/usermod -d /var/lib/mailman mailman
fi
echo "Moving data from /var/spool/mailman to /var/lib/mailman"
mv -f /var/spool/mailman/archives/private/* /var/lib/mailman/archives/private/
mv -f /var/spool/mailman/archives/public/* /var/lib/mailman/archives/public/
mv -f /var/spool/mailman/data/* /var/lib/mailman/data/
mv -f /var/spool/mailman/lists/* /var/lib/mailman/lists/
mv -f /var/spool/mailman/spam/* /var/lib/mailman/spam/
mv -f /var/spool/mailman/logs/* /var/log/mailman/
mv -f /var/spool/mailman/locks/* /var/lock/mailman/
mv -f /var/spool/mailman/qfiles/* /var/spool/mailman/
# Fix symlinks for public archives
cd /var/lib/mailman/archives/public/
for i in * ; do
	link=$(readlink "$i")
	dn=$(dirname "$link")
	if [ "$dn" = "/var/spool/mailman/archives/private" ]; then
		ln -sf "/var/lib/mailman/archives/private/$i" "$i"
	fi
done
cd -
# Remove empty dirs (DON'T rm -rf here!)
rmdir --ignore-fail-on-non-empty /var/spool/mailman/{archives/{private,public},archives,data,lists,spam,logs,locks,qfiles}
if [ -f /var/lib/mailman/Mailman/mm_cfg.pyc ]; then
	rm -f /var/lib/mailman/Mailman/mm_cfg.pyc
fi
/usr/lib64/mailman/bin/update
if [ "$stopped" = "true" ]; then
	rm -f /var/spool/mailman/data/sitelist.cfg
	/sbin/service mailman start 1>&2
fi

# nuke very-old config location (this mostly for Ra)
if [ -f /etc/httpd/httpd.conf ]; then
	sed -i -e "/^Include.*mailman.conf/d" /etc/httpd/httpd.conf
fi

# migrate from httpd (apache2) config dir
if [ -f /etc/httpd/mailman.conf.rpmsave ]; then
	cp -f /etc/webapps/mailman/httpd.conf{,.rpmnew}
	mv -f /etc/httpd/mailman.conf.rpmsave /etc/webapps/mailman/httpd.conf
fi

# migrate from httpd (apache2) config dir
if [ -f /etc/httpd/httpd.conf/90_mailman.conf.rpmsave ]; then
	cp -f /etc/webapps/mailman/httpd.conf{,.rpmnew}
	mv -f /etc/httpd/httpd.conf/90_mailman.conf.rpmsave /etc/webapps/mailman/httpd.conf
fi

rm -f /etc/httpd/httpd.conf/90_mailman.conf
/usr/sbin/webapp register httpd mailman
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };

apache1-base

/bin/sh
 
if [ "$1" = "1" ] && [ "$2" = "1" ]; then
	/usr/sbin/webapp register apache mailman
fi
# reload webserver if the config symlink is there and skip reload if webserver is upgraded
if [ -L /etc/apache/webapps.d/mailman.conf ] && [ "$2" -lt "2" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/apache ]; then
/sbin/service apache reload 1>&2 || :;
fi
fi };
fi

apache < 2.2.0

/bin/sh
 
# remove link if either of the packages are gone 
if [ -n "" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/apache/webapps.d/mailman.conf ]; then 
	/usr/sbin/webapp unregister apache mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/apache ]; then
/sbin/service apache reload 1>&2 || :;
fi
fi };
fi

apache-base

/bin/sh
 
if [ "$1" = "1" ] && [ "$2" = "1" ]; then
	/usr/sbin/webapp register httpd mailman
fi
# reload webserver if the config symlink is there and skip reload if webserver is upgraded
if [ -L /etc/httpd/webapps.d/mailman.conf ] && [ "$2" -lt "2" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };
fi

apache < 2.2.0

/bin/sh
 
# remove link if either of the packages are gone 
if [ -n "" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/httpd/webapps.d/mailman.conf ]; then 
	/usr/sbin/webapp unregister httpd mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };
fi

apache-base

/bin/sh
if [ -f /var/spool/cron/mailman ]; then
	crontab -u mailman -r
fi

if [ -f /var/lock/subsys/mailman ]; then
	ln -sf /etc/webapps/mailman/sitelist.cfg /var/spool/mailman/data/sitelist.cfg
	/sbin/service mailman stop 1>&2
	stopped=true
fi

# rescue app configs.
for i in mm_cfg.py sitelist.cfg; do
	if [ -f /etc/mailman/$i.rpmsave ]; then
		mv -f /etc/webapps/mailman/$i{,.rpmnew}
		mv -f /etc/mailman/$i.rpmsave /etc/webapps/mailman/$i
	fi
done

if [ "`getent passwd mailman | cut -d: -f6`" != "/var/lib/mailman" ]; then
	echo "Fixing passwd entry"
	/usr/sbin/usermod -d /var/lib/mailman mailman
fi
echo "Moving data from /var/spool/mailman to /var/lib/mailman"
mv -f /var/spool/mailman/archives/private/* /var/lib/mailman/archives/private/
mv -f /var/spool/mailman/archives/public/* /var/lib/mailman/archives/public/
mv -f /var/spool/mailman/data/* /var/lib/mailman/data/
mv -f /var/spool/mailman/lists/* /var/lib/mailman/lists/
mv -f /var/spool/mailman/spam/* /var/lib/mailman/spam/
mv -f /var/spool/mailman/logs/* /var/log/mailman/
mv -f /var/spool/mailman/locks/* /var/lock/mailman/
mv -f /var/spool/mailman/qfiles/* /var/spool/mailman/
# Fix symlinks for public archives
cd /var/lib/mailman/archives/public/
for i in * ; do
	link=$(readlink "$i")
	dn=$(dirname "$link")
	if [ "$dn" = "/var/spool/mailman/archives/private" ]; then
		ln -sf "/var/lib/mailman/archives/private/$i" "$i"
	fi
done
cd -
# Remove empty dirs (DON'T rm -rf here!)
rmdir --ignore-fail-on-non-empty /var/spool/mailman/{archives/{private,public},archives,data,lists,spam,logs,locks,qfiles}
if [ -f /var/lib/mailman/Mailman/mm_cfg.pyc ]; then
	rm -f /var/lib/mailman/Mailman/mm_cfg.pyc
fi
/usr/lib64/mailman/bin/update
if [ "$stopped" = "true" ]; then
	rm -f /var/spool/mailman/data/sitelist.cfg
	/sbin/service mailman start 1>&2
fi

# nuke very-old config location (this mostly for Ra)
if [ -f /etc/httpd/httpd.conf ]; then
	sed -i -e "/^Include.*mailman.conf/d" /etc/httpd/httpd.conf
fi

# migrate from httpd (apache2) config dir
if [ -f /etc/httpd/mailman.conf.rpmsave ]; then
	cp -f /etc/webapps/mailman/httpd.conf{,.rpmnew}
	mv -f /etc/httpd/mailman.conf.rpmsave /etc/webapps/mailman/httpd.conf
fi

# migrate from httpd (apache2) config dir
if [ -f /etc/httpd/httpd.conf/90_mailman.conf.rpmsave ]; then
	cp -f /etc/webapps/mailman/httpd.conf{,.rpmnew}
	mv -f /etc/httpd/httpd.conf/90_mailman.conf.rpmsave /etc/webapps/mailman/httpd.conf
fi

rm -f /etc/httpd/httpd.conf/90_mailman.conf
/usr/sbin/webapp register httpd mailman
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };

mailman < 1:2.1.7-2.1

/bin/sh
 
if [ "$1" = "1" ] && [ "$2" = "1" ]; then
	/usr/sbin/webapp register apache mailman
fi
# reload webserver if the config symlink is there and skip reload if webserver is upgraded
if [ -L /etc/apache/webapps.d/mailman.conf ] && [ "$2" -lt "2" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/apache ]; then
/sbin/service apache reload 1>&2 || :;
fi
fi };
fi

apache1 < 1.3.37-3

/bin/sh
 
# remove link if either of the packages are gone 
if [ -n "" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/apache/webapps.d/mailman.conf ]; then 
	/usr/sbin/webapp unregister apache mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/apache ]; then
/sbin/service apache reload 1>&2 || :;
fi
fi };
fi

apache1-base

/bin/sh
 
if [ "$1" = "1" ] && [ "$2" = "1" ]; then
	/usr/sbin/webapp register httpd mailman
fi
# reload webserver if the config symlink is there and skip reload if webserver is upgraded
if [ -L /etc/httpd/webapps.d/mailman.conf ] && [ "$2" -lt "2" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };
fi

apache1 < 1.3.37-3

/bin/sh
 
# remove link if either of the packages are gone 
if [ -n "" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/httpd/webapps.d/mailman.conf ]; then 
	/usr/sbin/webapp unregister httpd mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };
fi

apache1-base

/bin/sh
if [ -f /var/spool/cron/mailman ]; then
	crontab -u mailman -r
fi

if [ -f /var/lock/subsys/mailman ]; then
	ln -sf /etc/webapps/mailman/sitelist.cfg /var/spool/mailman/data/sitelist.cfg
	/sbin/service mailman stop 1>&2
	stopped=true
fi

# rescue app configs.
for i in mm_cfg.py sitelist.cfg; do
	if [ -f /etc/mailman/$i.rpmsave ]; then
		mv -f /etc/webapps/mailman/$i{,.rpmnew}
		mv -f /etc/mailman/$i.rpmsave /etc/webapps/mailman/$i
	fi
done

if [ "`getent passwd mailman | cut -d: -f6`" != "/var/lib/mailman" ]; then
	echo "Fixing passwd entry"
	/usr/sbin/usermod -d /var/lib/mailman mailman
fi
echo "Moving data from /var/spool/mailman to /var/lib/mailman"
mv -f /var/spool/mailman/archives/private/* /var/lib/mailman/archives/private/
mv -f /var/spool/mailman/archives/public/* /var/lib/mailman/archives/public/
mv -f /var/spool/mailman/data/* /var/lib/mailman/data/
mv -f /var/spool/mailman/lists/* /var/lib/mailman/lists/
mv -f /var/spool/mailman/spam/* /var/lib/mailman/spam/
mv -f /var/spool/mailman/logs/* /var/log/mailman/
mv -f /var/spool/mailman/locks/* /var/lock/mailman/
mv -f /var/spool/mailman/qfiles/* /var/spool/mailman/
# Fix symlinks for public archives
cd /var/lib/mailman/archives/public/
for i in * ; do
	link=$(readlink "$i")
	dn=$(dirname "$link")
	if [ "$dn" = "/var/spool/mailman/archives/private" ]; then
		ln -sf "/var/lib/mailman/archives/private/$i" "$i"
	fi
done
cd -
# Remove empty dirs (DON'T rm -rf here!)
rmdir --ignore-fail-on-non-empty /var/spool/mailman/{archives/{private,public},archives,data,lists,spam,logs,locks,qfiles}
if [ -f /var/lib/mailman/Mailman/mm_cfg.pyc ]; then
	rm -f /var/lib/mailman/Mailman/mm_cfg.pyc
fi
/usr/lib64/mailman/bin/update
if [ "$stopped" = "true" ]; then
	rm -f /var/spool/mailman/data/sitelist.cfg
	/sbin/service mailman start 1>&2
fi

# nuke very-old config location (this mostly for Ra)
if [ -f /etc/httpd/httpd.conf ]; then
	sed -i -e "/^Include.*mailman.conf/d" /etc/httpd/httpd.conf
fi

# migrate from httpd (apache2) config dir
if [ -f /etc/httpd/mailman.conf.rpmsave ]; then
	cp -f /etc/webapps/mailman/httpd.conf{,.rpmnew}
	mv -f /etc/httpd/mailman.conf.rpmsave /etc/webapps/mailman/httpd.conf
fi

# migrate from httpd (apache2) config dir
if [ -f /etc/httpd/httpd.conf/90_mailman.conf.rpmsave ]; then
	cp -f /etc/webapps/mailman/httpd.conf{,.rpmnew}
	mv -f /etc/httpd/httpd.conf/90_mailman.conf.rpmsave /etc/webapps/mailman/httpd.conf
fi

rm -f /etc/httpd/httpd.conf/90_mailman.conf
/usr/sbin/webapp register httpd mailman
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };

apache < 2.2.0

/bin/sh
 
if [ "$1" = "1" ] && [ "$2" = "1" ]; then
	/usr/sbin/webapp register apache mailman
fi
# reload webserver if the config symlink is there and skip reload if webserver is upgraded
if [ -L /etc/apache/webapps.d/mailman.conf ] && [ "$2" -lt "2" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/apache ]; then
/sbin/service apache reload 1>&2 || :;
fi
fi };
fi

apache-base

/bin/sh
 
# remove link if either of the packages are gone 
if [ -n "" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/apache/webapps.d/mailman.conf ]; then 
	/usr/sbin/webapp unregister apache mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/apache ]; then
/sbin/service apache reload 1>&2 || :;
fi
fi };
fi

apache < 2.2.0

/bin/sh
 
if [ "$1" = "1" ] && [ "$2" = "1" ]; then
	/usr/sbin/webapp register httpd mailman
fi
# reload webserver if the config symlink is there and skip reload if webserver is upgraded
if [ -L /etc/httpd/webapps.d/mailman.conf ] && [ "$2" -lt "2" ]; then
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };
fi

apache-base

/bin/sh
 
# remove link if either of the packages are gone 
if [ -n "" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/httpd/webapps.d/mailman.conf ]; then 
	/usr/sbin/webapp unregister httpd mailman
	{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };
fi

mailman < 1:2.1.7-2.1

/bin/sh
if [ -f /var/spool/cron/mailman ]; then
	crontab -u mailman -r
fi

if [ -f /var/lock/subsys/mailman ]; then
	ln -sf /etc/webapps/mailman/sitelist.cfg /var/spool/mailman/data/sitelist.cfg
	/sbin/service mailman stop 1>&2
	stopped=true
fi

# rescue app configs.
for i in mm_cfg.py sitelist.cfg; do
	if [ -f /etc/mailman/$i.rpmsave ]; then
		mv -f /etc/webapps/mailman/$i{,.rpmnew}
		mv -f /etc/mailman/$i.rpmsave /etc/webapps/mailman/$i
	fi
done

if [ "`getent passwd mailman | cut -d: -f6`" != "/var/lib/mailman" ]; then
	echo "Fixing passwd entry"
	/usr/sbin/usermod -d /var/lib/mailman mailman
fi
echo "Moving data from /var/spool/mailman to /var/lib/mailman"
mv -f /var/spool/mailman/archives/private/* /var/lib/mailman/archives/private/
mv -f /var/spool/mailman/archives/public/* /var/lib/mailman/archives/public/
mv -f /var/spool/mailman/data/* /var/lib/mailman/data/
mv -f /var/spool/mailman/lists/* /var/lib/mailman/lists/
mv -f /var/spool/mailman/spam/* /var/lib/mailman/spam/
mv -f /var/spool/mailman/logs/* /var/log/mailman/
mv -f /var/spool/mailman/locks/* /var/lock/mailman/
mv -f /var/spool/mailman/qfiles/* /var/spool/mailman/
# Fix symlinks for public archives
cd /var/lib/mailman/archives/public/
for i in * ; do
	link=$(readlink "$i")
	dn=$(dirname "$link")
	if [ "$dn" = "/var/spool/mailman/archives/private" ]; then
		ln -sf "/var/lib/mailman/archives/private/$i" "$i"
	fi
done
cd -
# Remove empty dirs (DON'T rm -rf here!)
rmdir --ignore-fail-on-non-empty /var/spool/mailman/{archives/{private,public},archives,data,lists,spam,logs,locks,qfiles}
if [ -f /var/lib/mailman/Mailman/mm_cfg.pyc ]; then
	rm -f /var/lib/mailman/Mailman/mm_cfg.pyc
fi
/usr/lib64/mailman/bin/update
if [ "$stopped" = "true" ]; then
	rm -f /var/spool/mailman/data/sitelist.cfg
	/sbin/service mailman start 1>&2
fi

# nuke very-old config location (this mostly for Ra)
if [ -f /etc/httpd/httpd.conf ]; then
	sed -i -e "/^Include.*mailman.conf/d" /etc/httpd/httpd.conf
fi

# migrate from httpd (apache2) config dir
if [ -f /etc/httpd/mailman.conf.rpmsave ]; then
	cp -f /etc/webapps/mailman/httpd.conf{,.rpmnew}
	mv -f /etc/httpd/mailman.conf.rpmsave /etc/webapps/mailman/httpd.conf
fi

# migrate from httpd (apache2) config dir
if [ -f /etc/httpd/httpd.conf/90_mailman.conf.rpmsave ]; then
	cp -f /etc/webapps/mailman/httpd.conf{,.rpmnew}
	mv -f /etc/httpd/httpd.conf/90_mailman.conf.rpmsave /etc/webapps/mailman/httpd.conf
fi

rm -f /etc/httpd/httpd.conf/90_mailman.conf
/usr/sbin/webapp register httpd mailman
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/httpd ] && . /etc/sysconfig/httpd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/httpd ]; then
/sbin/service httpd reload 1>&2 || :;
fi
fi };