Sophie

Sophie

distrib > Mandriva > 9.0 > x86_64 > by-pkgid > faecf661c5edae074f14135c60e0acad > scriptlet

mod_ssl-2.8.10-5.2mdk.x86_64.rpm

POSTIN

/bin/sh
if [ $1 = "1" ]; then 
   #We're in Install mode, add module to the config files
   for config in /etc/httpd/conf/{httpd,httpd-perl}.conf; do
     if [ -x /usr/sbin/advxaddmod -a -e $config ]; then
       /usr/sbin/advxaddmod $config \
	extramodules/libssl.so mod_ssl.c ssl_module \
	define=HAVE_SSL addconf=conf/ssl/mod_ssl.conf
     fi
     echo "Include  conf/ssl/ssl.default-vhost.conf" >> $config
   done
   #Create a self-signed server key and certificate 
   #this will overwrite the dummy certificate
   echo "Generating self-signed certificate"
   pushd /etc/ssl/apache/ >/dev/null
   yes ""|/usr/lib64/ssl/mod_ssl/gentestcrt.sh >/dev/null 2>/dev/null
   popd > /dev/null
   if [ -x /usr/sbin/AESctl ]; then /usr/sbin/AESctl update;fi 
fi

if [ $1 -gt 1 ]; then 
   #We're in *upgrade mode*. Since we can't be sure the configuration files
   #are sane, remove module from the conf files to clean them, re-add again 
   #in a way that the older module we're replacing won't try to erase (the 
   #post scripts were broken on some packages), and finally clean the module
   #specific config file so it's compatible with the upgrade.
   for config in /etc/httpd/conf/{httpd,httpd-perl}.conf; do
     if [ -x /usr/sbin/advxdelmod -a -e $config ]; then
       /usr/sbin/advxdelmod $config \
	extramodules/libssl.so mod_ssl.c ssl_module \
	define=HAVE_SSL addconf=conf/ssl/mod_ssl.conf
       perl -pi -e "s|^#*Include\s+conf/ssl/ssl.default-vhost.conf\n||g;" \
	$config
     fi
     if [ -x /usr/sbin/advxaddmod -a -e $config ]; then
       /usr/sbin/advxaddmod $config \
	extramodules/libssl.so mod_ssl.c ssl_module \
	define=HAVE_SSL addconf=conf/ssl/mod_ssl.conf
       echo "Include  conf/ssl/ssl.default-vhost.conf" >> $config
     fi
   done
   if [ -x /usr/sbin/advxfixconf ]; then
     /usr/sbin/advxfixconf \
	/etc/httpd/conf/ssl/mod_ssl.conf \
	libssl.so mod_ssl.c ssl_module ifmodule
     /usr/sbin/advxfixconf \
	/etc/httpd/conf/ssl/ssl.default-vhost.conf \
	libssl.so mod_ssl.c ssl_module ifmodule
   fi
   perl -pi -e "s|file:logs/ssl_mutex|sem|g;" \
	/etc/httpd/conf/ssl/mod_ssl.conf
   #Create a self-signed server key and certificate 
   #this will overwrite the dummy certificate, but will
   #not overwrite a user-generated certificate, since we
   #use config noreplace and it checks the mdsum
   echo "Generating self-signed certificate"
   pushd /etc/ssl/apache/ > /dev/null
   yes ""|/usr/lib64/ssl/mod_ssl/gentestcrt.sh >/dev/null 2>/dev/null
   popd > /dev/null
   if [ -x /usr/sbin/AESctl -a ! -e /usr/lib64/apache/libssl.so ]; then 
	/usr/sbin/AESctl update
   fi 
fi

POSTUN

/bin/sh
if [ $1 = "0" ]; then 
   for config in /etc/httpd/conf/{httpd,httpd-perl}.conf; do
     if [ -x /usr/sbin/advxdelmod -a -e $config ]; then
       /usr/sbin/advxdelmod $config \
	extramodules/libssl.so mod_ssl.c ssl_module \
	define=HAVE_SSL addconf=conf/ssl/mod_ssl.conf
       perl -pi -e "s|^#*Include\s+conf/ssl/ssl.default-vhost.conf\n||g;" \
	$config
     fi
   done
   if [ -x /usr/sbin/AESctl ]; then /usr/sbin/AESctl update;fi 
fi