wok annotate php-mcrypt/receipt @ rev 4887

Add: xfmedia
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Sat Feb 06 00:49:18 2010 +0100 (2010-02-06)
parents 24e7f29f022d
children 574b7ff5dfab
rev   line source
erjo@4408 1 # SliTaz package receipt.
erjo@4408 2
erjo@4408 3 PACKED_SIZE="24.0k"
erjo@4408 4 UNPACKED_SIZE="60.0k"
erjo@4408 5 PACKAGE="php-mcrypt"
pankso@4427 6 VERSION="5.2.11"
erjo@4408 7 CATEGORY="development"
erjo@4408 8 SHORT_DESC="mcrypt module for PHP web programming language."
erjo@4408 9 MAINTAINER="erjo@slitaz.org"
erjo@4408 10 DEPENDS="libmcrypt php"
erjo@4408 11 WEB_SITE="http://www.php.net/"
erjo@4408 12 WANTED="php"
erjo@4408 13
erjo@4408 14 # Rules to gen a SliTaz package suitable for Tazpkg.
erjo@4408 15 genpkg_rules()
erjo@4408 16 {
erjo@4408 17 mkdir -p $fs/usr/share/php
erjo@4408 18 cp $(find $_pkg | grep mcrypt.so) $fs/usr/share/php/
erjo@4408 19 }
erjo@4408 20
erjo@4408 21 # Post and pre install commans to stop
erjo@4408 22 # and restart Web server if needed.
erjo@4408 23 pre_install()
erjo@4408 24 {
erjo@4408 25 while read daemon file; do
erjo@4408 26 if [ -z "$1" -a -f "/var/run/$file" ]; then
erjo@4408 27 /etc/init.d/$daemon stop
erjo@4408 28 fi
erjo@4408 29 done <<EOT
erjo@4408 30 apache apache/httpd.pid
erjo@4408 31 lighttpd lighttpd.pid
erjo@4408 32 EOT
erjo@4408 33 }
erjo@4408 34
erjo@4408 35 post_install()
erjo@4408 36 {
erjo@4408 37 grep -q ^extension=mysql.so $1/etc/php.ini || \
erjo@4408 38 sed -e 's|;.*extension=mcrypt.so|; extension=mcrypt.so\nextension=mcrypt.so|' -i $1/etc/php.ini
erjo@4408 39 # Start Web server.
erjo@4408 40 while read daemon file; do
erjo@4408 41 [ -z "$1" ] || continue
erjo@4408 42 if [ -f "/var/run/$file" ]; then
erjo@4408 43 /etc/init.d/$daemon stop
erjo@4408 44 sleep 2
erjo@4408 45 fi
erjo@4408 46 if [ -f /etc/init.d/$daemon ]; then
erjo@4408 47 /etc/init.d/$daemon start
erjo@4408 48 fi
erjo@4408 49 done <<EOT
erjo@4408 50 apache apache/httpd.pid
erjo@4408 51 lighttpd lighttpd.pid
erjo@4408 52 EOT
erjo@4408 53 }
erjo@4408 54
erjo@4408 55 # Pre and post remove commands for Tazpkg.
erjo@4408 56 pre_remove()
erjo@4408 57 {
erjo@4408 58 sed -i '/.*=mcrypt.so.*/d' /etc/php.ini
erjo@4408 59
erjo@4408 60 # Start Web server.
erjo@4408 61 while read daemon file; do
erjo@4408 62 if [ -f /etc/init.d/$daemon -a -f "/var/run/$file" ]; then
erjo@4408 63 /etc/init.d/$daemon stop
erjo@4408 64 sleep 2
erjo@4408 65 /etc/init.d/$daemon start
erjo@4408 66 fi
erjo@4408 67 done <<EOT
erjo@4408 68 apache apache/httpd.pid
erjo@4408 69 lighttpd lighttpd.pid
erjo@4408 70 EOT
erjo@4408 71 }