wok-next annotate php-cups/receipt @ rev 7337

Up: gnome-doc-utils to 0.20.2.
author Christopher Rogers <slaxemulator@gmail.com>
date Fri Nov 19 23:43:02 2010 +0000 (2010-11-19)
parents c5f3445b2769
children 163b99add810
rev   line source
pascal@1408 1 # SliTaz package receipt."
pascal@1408 2
pascal@1408 3 PACKAGE="php-cups"
slaxemulator@7228 4 VERSION="1.4.5"
pascal@1408 5 CATEGORY="development"
pascal@1408 6 SHORT_DESC="Common UNIX Printing System bindings for php."
pascal@1408 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@5031 8 DEPENDS="cups libtasn1"
pascal@1408 9 WANTED="cups"
pascal@1408 10 WEB_SITE="http://www.cups.org/"
pascal@1408 11
pascal@1408 12 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1408 13 genpkg_rules()
pascal@1408 14 {
pascal@1408 15 mkdir -p $fs/usr/share/php
pascal@1408 16 cp $(find $_pkg | grep phpcups.so) $fs/usr/share/php/cups.so
pascal@1408 17 }
pascal@1408 18
pascal@1408 19 # Post and pre install commans to stop
pascal@1408 20 # and restart Web server if needed.
pascal@1408 21 pre_install()
pascal@1408 22 {
pascal@1408 23 while read daemon file; do
pascal@1408 24 if [ -z "$1" -a -f "/var/run/$file" ]; then
pascal@1408 25 /etc/init.d/$daemon stop
pascal@1408 26 fi
pascal@1408 27 done <<EOT
pascal@1408 28 apache apache/httpd.pid
pascal@1408 29 lighttpd lighttpd.pid
pascal@1408 30 EOT
pascal@1408 31 }
pascal@1408 32
pascal@1408 33 post_install()
pascal@1408 34 {
pascal@1833 35 grep -q ^extension=cups.so $1/etc/php.ini || \
pascal@4923 36 sed -e 's|extension=msql.so|extension=msql.so\nextension=cups.so|' -i $1/etc/php.ini
pascal@1408 37 # Start Web server.
pascal@1408 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@1408 45 /etc/init.d/$daemon start
pascal@1408 46 fi
pascal@1408 47 done <<EOT
pascal@1408 48 apache apache/httpd.pid
pascal@1408 49 lighttpd lighttpd.pid
pascal@1408 50 EOT
pascal@1408 51 }
pascal@1408 52
pascal@1749 53 # Pre and post remove commands for Tazpkg.
pascal@1749 54 pre_remove()
pascal@1749 55 {
pascal@1749 56 sed -i '/.*=cups.so.*/d' /etc/php.ini
pascal@1749 57
pascal@1749 58 # Start Web server.
pascal@1749 59 while read daemon file; do
pascal@1805 60 [ -f "/var/run/$file" ] || continue
pascal@1805 61 if [ -f /etc/init.d/$daemon ]; then
pascal@1805 62 /etc/init.d/$daemon stop
pascal@1805 63 sleep 2
pascal@1749 64 /etc/init.d/$daemon start
pascal@1749 65 fi
pascal@1749 66 done <<EOT
pascal@1749 67 apache apache/httpd.pid
pascal@1749 68 lighttpd lighttpd.pid
pascal@1749 69 EOT
pascal@1749 70 }