wok-6.x annotate php-gd/receipt @ rev 15042

clamav-dev: fix genpkg_rules
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Aug 12 16:23:09 2013 +0000 (2013-08-12)
parents 855f42b596c0
children 78cb1e930abd
rev   line source
pascal@1326 1 # SliTaz package receipt.
pascal@1326 2
pascal@1326 3 PACKAGE="php-gd"
slaxemulator@14614 4 VERSION="5.4.13"
pascal@1326 5 CATEGORY="development"
pascal@1326 6 SHORT_DESC="gd module for PHP web programming language."
pascal@1326 7 MAINTAINER="pascal.bellard@slitaz.org"
slaxemulator@14614 8 DEPENDS="libpng php jpeg libvpx"
pascal@1326 9 WEB_SITE="http://www.php.net/"
pascal@1326 10 WANTED="php"
pascal@1326 11
pascal@1326 12 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1326 13 genpkg_rules()
pascal@1326 14 {
pascal@1326 15 mkdir -p $fs/usr/share/php
slaxemulator@14614 16 cp $(find $install | grep gd.so) $fs/usr/share/php/
pascal@1326 17 }
pascal@1326 18
pascal@1326 19 # Post and pre install commans to stop
pascal@1326 20 # and restart Web server if needed.
pascal@1326 21 pre_install()
pascal@1326 22 {
pascal@1326 23 while read daemon file; do
pascal@1326 24 if [ -z "$1" -a -f "/var/run/$file" ]; then
pascal@1326 25 /etc/init.d/$daemon stop
pascal@1326 26 fi
pascal@1326 27 done <<EOT
pascal@1326 28 apache apache/httpd.pid
pascal@1326 29 lighttpd lighttpd.pid
pascal@1326 30 EOT
pascal@1326 31 }
pascal@1326 32
pascal@1326 33 post_install()
pascal@1326 34 {
pascal@1833 35 grep -q ^extension=gd.so $1/etc/php.ini || \
pascal@4923 36 sed -e 's|extension=msql.so|extension=msql.so\nextension=gd.so|' -i $1/etc/php.ini
pascal@1326 37 # Start Web server.
pascal@1326 38 while read daemon file; do
pascal@1805 39 [ -z "$1" ] || continue
pascal@1805 40 if [ -z "$1" -a -f "/var/run/$file" ]; then
pascal@1805 41 /etc/init.d/$daemon stop
pascal@1805 42 sleep 2
pascal@1805 43 fi
pascal@1805 44 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
pascal@1326 45 /etc/init.d/$daemon start
pascal@1326 46 fi
pascal@1326 47 done <<EOT
pascal@1326 48 apache apache/httpd.pid
pascal@1326 49 lighttpd lighttpd.pid
pascal@1326 50 EOT
pascal@1326 51 }
pascal@1326 52
pascal@1749 53 # Pre and post remove commands for Tazpkg.
pascal@1749 54 pre_remove()
pascal@1749 55 {
slaxemulator@14614 56 sed -i '/.*=gd.so.*/d' $1/etc/php.ini
pascal@1749 57
pascal@1749 58 # Start Web server.
pascal@1749 59 while read daemon file; do
pascal@1805 60 if [ -f /etc/init.d/$daemon -a -f "/var/run/$file" ]; then
slaxemulator@14614 61 [ -z "$1" ] || continue
slaxemulator@14614 62 if [ -z "$1" -a -f "/var/run/$file" ]; then
slaxemulator@14614 63 /etc/init.d/$daemon stop
slaxemulator@14614 64 sleep 2
slaxemulator@14614 65 fi
slaxemulator@14614 66 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
slaxemulator@14614 67 /etc/init.d/$daemon start
slaxemulator@14614 68 fi
pascal@1749 69 fi
pascal@1749 70 done <<EOT
pascal@1749 71 apache apache/httpd.pid
pascal@1749 72 lighttpd lighttpd.pid
pascal@1749 73 EOT
pascal@1749 74 }