wok-current annotate php/receipt @ rev 1175

Add Python bindings for cairo, GTK, GObject.
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Sat Aug 02 14:05:35 2008 +0200 (2008-08-02)
parents 443dbfefc6bf
children e679fb64c9d0
rev   line source
pankso@18 1 # SliTaz package receipt.
pankso@18 2
pankso@18 3 PACKAGE="php"
pankso@238 4 VERSION="5.2.5"
pankso@204 5 CATEGORY="development"
pankso@18 6 SHORT_DESC="PHP web programming language."
pankso@18 7 MAINTAINER="pankso@slitaz.org"
pankso@238 8 DEPENDS="lighttpd zlib libxml2 sqlite"
pascal@1155 9 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev mysql-dev postgresql postgresql-dev gettext openssl-dev"
pankso@18 10 TARBALL="$PACKAGE-$VERSION.tar.bz2"
pankso@18 11 WEB_SITE="http://www.php.net/"
pankso@18 12 WGET_URL="http://us2.php.net/distributions/$TARBALL"
pankso@18 13
pankso@18 14 # Rules to configure and make the package.
pankso@18 15 compile_rules()
pankso@18 16 {
pankso@18 17 cd $src
pankso@238 18 ./configure \
pankso@238 19 --prefix=/usr \
pankso@238 20 --sysconfdir=/etc \
pankso@238 21 --infodir=/usr/share/info \
pankso@238 22 --mandir=/usr/share/man \
pankso@238 23 --enable-fastcgi \
pankso@238 24 --enable-discard-path \
pankso@238 25 --enable-force-cgi-redirect \
pankso@238 26 --enable-mbstring \
pankso@238 27 --with-config-file-path=/etc \
pankso@238 28 --with-zlib \
pascal@1155 29 --with-gettext \
pascal@1143 30 --with-mysql=shared,usr \
pascal@1149 31 --with-pgsql=shared,usr \
pascal@1155 32 --with-ldap=shared
pankso@238 33 --disable-cli \
pankso@238 34 $CONFIGURE_ARGS
pankso@18 35 make
pascal@1143 36 make INSTALL_ROOT=$PWD/_pkg install
pankso@18 37 }
pankso@18 38
pankso@18 39 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@18 40 genpkg_rules()
pankso@18 41 {
pankso@18 42 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share
pankso@18 43 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
pankso@238 44 # Recommended config file and phpinfo.
pankso@18 45 cp $src/php.ini-recommended $fs/etc/php.ini
pascal@1143 46 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
pascal@1143 47 -i $fs/etc/php.ini
pankso@18 48 cp -a stuff/phpinfo $fs/usr/share
pascal@1143 49 for i in $(cd $WOK; ls -d php-*)
pascal@1143 50 do
pascal@1143 51 tazwok cook $i
pascal@1143 52 done
pankso@18 53 }
pankso@18 54
pankso@18 55 # Post and pre install commans to stop
pankso@18 56 # and restart Web server if needed.
pankso@18 57 pre_install()
pankso@18 58 {
pankso@18 59 if [ -f "$1/var/run/lighttpd.pid" ]; then
pankso@18 60 /etc/init.d/lighttpd stop
pankso@18 61 fi
pankso@18 62 # Backup existing php.ini
pankso@18 63 if [ -f "$1/etc/php.ini" ]; then
pankso@18 64 echo -n "Creating php.ini backup..."
pankso@18 65 cp $1/etc/php.ini $1/etc/php.ini.bak
pankso@18 66 status
pankso@18 67 fi
pankso@18 68 }
pankso@18 69 post_install()
pankso@18 70 {
pankso@18 71 # Restore original php.ini
pankso@18 72 if [ -f "$1/etc/php.ini.bak" ]; then
pankso@18 73 echo -n "Restoring php.ini backup..."
pankso@18 74 mv -f $1/etc/php.ini.bak $1/etc/php.ini
pankso@18 75 status
pankso@18 76 fi
pascal@1143 77 # Enable php
pascal@1143 78 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
pascal@1143 79 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \
pascal@1143 80 tazpkg get-install lighttpd-modules --root=$1/
pascal@1143 81 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
pascal@1143 82 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
pascal@1143 83 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
pascal@1143 84 -i $1/etc/lighttpd/lighttpd.conf
pascal@1143 85 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \
pascal@1143 86 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
pascal@1143 87 -i $1/etc/lighttpd/lighttpd.conf
pascal@1143 88 fi
pankso@18 89 # Start Web server.
pascal@1137 90 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
pankso@18 91 /etc/init.d/lighttpd start
pankso@18 92 fi
pankso@18 93 }
pankso@18 94