wok-next rev 4408

Add: php-mcrypt
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Tue Oct 20 19:50:43 2009 +0000 (2009-10-20)
parents 5043ba1d9bd1
children dea695a85b16
files php-mcrypt/receipt
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/php-mcrypt/receipt	Tue Oct 20 19:50:43 2009 +0000
     1.3 @@ -0,0 +1,71 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKED_SIZE="24.0k"
     1.7 +UNPACKED_SIZE="60.0k"
     1.8 +PACKAGE="php-mcrypt"
     1.9 +VERSION="5.2.9"
    1.10 +CATEGORY="development"
    1.11 +SHORT_DESC="mcrypt module for PHP web programming language."
    1.12 +MAINTAINER="erjo@slitaz.org"
    1.13 +DEPENDS="libmcrypt php"
    1.14 +WEB_SITE="http://www.php.net/"
    1.15 +WANTED="php"
    1.16 +
    1.17 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.18 +genpkg_rules()
    1.19 +{
    1.20 +	mkdir -p $fs/usr/share/php
    1.21 +	cp $(find $_pkg | grep mcrypt.so) $fs/usr/share/php/
    1.22 +}
    1.23 +
    1.24 +# Post and pre install commans to stop
    1.25 +# and restart Web server if needed.
    1.26 +pre_install()
    1.27 +{
    1.28 +	while read daemon file; do
    1.29 +		if [ -z "$1" -a -f "/var/run/$file" ]; then
    1.30 +			/etc/init.d/$daemon stop
    1.31 +		fi
    1.32 +	done <<EOT
    1.33 +apache apache/httpd.pid
    1.34 +lighttpd lighttpd.pid
    1.35 +EOT
    1.36 +}
    1.37 +
    1.38 +post_install()
    1.39 +{
    1.40 +	grep -q ^extension=mysql.so $1/etc/php.ini || \
    1.41 +	    sed -e 's|;.*extension=mcrypt.so|;   extension=mcrypt.so\nextension=mcrypt.so|' -i $1/etc/php.ini
    1.42 +	# Start Web server.
    1.43 +	while read daemon file; do
    1.44 +		[ -z "$1" ] || continue
    1.45 +		if [ -f "/var/run/$file" ]; then
    1.46 +			/etc/init.d/$daemon stop
    1.47 +			sleep 2
    1.48 +		fi
    1.49 +		if [ -f /etc/init.d/$daemon ]; then
    1.50 +			/etc/init.d/$daemon start
    1.51 +		fi
    1.52 +	done <<EOT
    1.53 +apache apache/httpd.pid
    1.54 +lighttpd lighttpd.pid
    1.55 +EOT
    1.56 +}
    1.57 +
    1.58 +# Pre and post remove commands for Tazpkg.
    1.59 +pre_remove()
    1.60 +{
    1.61 +	sed -i '/.*=mcrypt.so.*/d' /etc/php.ini
    1.62 +
    1.63 +	# Start Web server.
    1.64 +	while read daemon file; do
    1.65 +		if [ -f /etc/init.d/$daemon -a -f "/var/run/$file" ]; then
    1.66 +			/etc/init.d/$daemon stop
    1.67 +			sleep 2
    1.68 +			/etc/init.d/$daemon start
    1.69 +		fi
    1.70 +	done <<EOT
    1.71 +apache apache/httpd.pid
    1.72 +lighttpd lighttpd.pid
    1.73 +EOT
    1.74 +}