POSTIN
/bin/sh
echo -n "Generating Spyce parser tables..."
pushd /usr/share/spyce; /usr/bin/env python spyceParser.py; popd
#ln -sf /usr/share/spyce/run_spyceCmd.py /usr/bin/spyce
# FIXME : kept but to be replaced in install
ln -sf /usr/share/spyce/docs /usr/share/doc/spyce
echo -n "Adding Spyce config to httpd.conf..."
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.spyce-install.bak
sed -e "/### BEGIN SPYCE CONFIG MARKER/,/### END SPYCE CONFIG MARKER/d" \
< /etc/httpd/conf/httpd.conf.spyce-install.bak > /etc/httpd/conf/httpd.conf
echo "### BEGIN SPYCE CONFIG MARKER" >> /etc/httpd/conf/httpd.conf
cat /usr/share/spyce/spyceApache.conf | sed -e "s+XXX+/usr/share/spyce+g" >> /etc/httpd/conf/httpd.conf
echo "### END SPYCE CONFIG MARKER" >> /etc/httpd/conf/httpd.conf
echo " done."
/usr/sbin/apachectl graceful
POSTUN
/bin/sh
if [ $1 == 0 ]; then
# rm -f /usr/share/doc/spyce
rm -f /var/www/html/spyce
echo -n "Removing Spyce config from httpd.conf..."
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.spyce-uninstall.bak
sed -e "/### BEGIN SPYCE CONFIG MARKER/,/### END SPYCE CONFIG MARKER/d" \
< /etc/httpd/conf/httpd.conf.spyce-uninstall.bak > /etc/httpd/conf/httpd.conf
echo " done."
/usr/sbin/apachectl graceful
fi