wok-current annotate php/receipt @ rev 204
Cat 'development' mostly completed (pelr, python, php, ...)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Wed Feb 13 14:06:08 2008 +0100 (2008-02-13) |
parents | 4959e5789caa |
children | 8b267a450470 |
rev | line source |
---|---|
pankso@18 | 1 # SliTaz package receipt. |
pankso@18 | 2 |
pankso@18 | 3 PACKAGE="php" |
pankso@18 | 4 VERSION="5.2.4" |
pankso@204 | 5 CATEGORY="development" |
pankso@18 | 6 SHORT_DESC="PHP web programming language." |
pankso@18 | 7 MAINTAINER="pankso@slitaz.org" |
pankso@18 | 8 DEPENDS="lighttpd" |
pankso@18 | 9 TARBALL="$PACKAGE-$VERSION.tar.bz2" |
pankso@18 | 10 WEB_SITE="http://www.php.net/" |
pankso@18 | 11 WGET_URL="http://us2.php.net/distributions/$TARBALL" |
pascal@153 | 12 JWM_MENU='System tools:<Program icon="php.png" label="PHP info">firefox http://localhost/phpinfo/</Program>' |
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@18 | 18 ./configure --prefix=/usr --sysconfdir=/etc \ |
pankso@18 | 19 --infodir=/usr/share/info --mandir=/usr/share/man \ |
pankso@18 | 20 $CONFIGURE_ARGS \ |
pankso@18 | 21 --enable-fastcgi \ |
pankso@18 | 22 --enable-discard-path \ |
pankso@18 | 23 --enable-force-cgi-redirect \ |
pankso@18 | 24 --enable-mbstring \ |
pankso@18 | 25 --with-config-file-path=/etc \ |
pankso@18 | 26 --with-zlib \ |
pankso@18 | 27 --disable-cli |
pankso@18 | 28 # to get a 2 Mb php-cgi binary. |
pankso@18 | 29 # |
pankso@18 | 30 #--disable-libxml \ |
pankso@18 | 31 #--disable-all |
pankso@18 | 32 make |
pankso@18 | 33 } |
pankso@18 | 34 |
pankso@18 | 35 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@18 | 36 genpkg_rules() |
pankso@18 | 37 { |
pankso@18 | 38 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share |
pankso@18 | 39 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin |
pankso@18 | 40 strip -s $fs/usr/bin/* |
pankso@18 | 41 # Recommended config file, phpinfo and pixmaps. |
pankso@18 | 42 cp $src/php.ini-recommended $fs/etc/php.ini |
pankso@18 | 43 cp -a stuff/phpinfo $fs/usr/share |
pankso@18 | 44 cp -a stuff/pixmaps $fs/usr/share |
pankso@18 | 45 } |
pankso@18 | 46 |
pankso@18 | 47 # Post and pre install commans to stop |
pankso@18 | 48 # and restart Web server if needed. |
pankso@18 | 49 pre_install() |
pankso@18 | 50 { |
pankso@18 | 51 local root |
pankso@18 | 52 root=$1 |
pankso@18 | 53 if [ -f "$1/var/run/lighttpd.pid" ]; then |
pankso@18 | 54 /etc/init.d/lighttpd stop |
pankso@18 | 55 fi |
pankso@18 | 56 # Backup existing php.ini |
pankso@18 | 57 if [ -f "$1/etc/php.ini" ]; then |
pankso@18 | 58 echo -n "Creating php.ini backup..." |
pankso@18 | 59 cp $1/etc/php.ini $1/etc/php.ini.bak |
pankso@18 | 60 status |
pankso@18 | 61 fi |
pankso@18 | 62 } |
pankso@18 | 63 post_install() |
pankso@18 | 64 { |
pankso@18 | 65 local root |
pankso@18 | 66 root=$1 |
pankso@18 | 67 # Restore original php.ini |
pankso@18 | 68 if [ -f "$1/etc/php.ini.bak" ]; then |
pankso@18 | 69 echo -n "Restoring php.ini backup..." |
pankso@18 | 70 mv -f $1/etc/php.ini.bak $1/etc/php.ini |
pankso@18 | 71 status |
pankso@18 | 72 fi |
pankso@18 | 73 # Start Web server. |
pankso@18 | 74 if [ ! -f "/var/run/lighttpd.pid" ]; then |
pankso@18 | 75 /etc/init.d/lighttpd start |
pankso@18 | 76 fi |
pankso@18 | 77 } |
pankso@18 | 78 |