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