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