wok-6.x annotate php/receipt @ rev 1299
Up busybox (1.12.0) with built in module-init-tools
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Aug 21 20:11:27 2008 +0000 (2008-08-21) |
parents | e679fb64c9d0 |
children | 41897da4a1db |
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" |
pascal@1223 | 13 CONFIG_FILES="/etc/php.ini" |
pankso@18 | 14 |
pankso@18 | 15 # Rules to configure and make the package. |
pankso@18 | 16 compile_rules() |
pankso@18 | 17 { |
pankso@18 | 18 cd $src |
pankso@238 | 19 ./configure \ |
pankso@238 | 20 --prefix=/usr \ |
pankso@238 | 21 --sysconfdir=/etc \ |
pankso@238 | 22 --infodir=/usr/share/info \ |
pankso@238 | 23 --mandir=/usr/share/man \ |
pankso@238 | 24 --enable-fastcgi \ |
pankso@238 | 25 --enable-discard-path \ |
pankso@238 | 26 --enable-force-cgi-redirect \ |
pankso@238 | 27 --enable-mbstring \ |
pankso@238 | 28 --with-config-file-path=/etc \ |
pankso@238 | 29 --with-zlib \ |
pascal@1155 | 30 --with-gettext \ |
pascal@1143 | 31 --with-mysql=shared,usr \ |
pascal@1149 | 32 --with-pgsql=shared,usr \ |
erjo@1197 | 33 --with-ldap=shared \ |
pankso@238 | 34 --disable-cli \ |
pankso@238 | 35 $CONFIGURE_ARGS |
pankso@18 | 36 make |
pascal@1143 | 37 make INSTALL_ROOT=$PWD/_pkg install |
pankso@18 | 38 } |
pankso@18 | 39 |
pankso@18 | 40 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@18 | 41 genpkg_rules() |
pankso@18 | 42 { |
pankso@18 | 43 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share |
pankso@18 | 44 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin |
pankso@238 | 45 # Recommended config file and phpinfo. |
pankso@18 | 46 cp $src/php.ini-recommended $fs/etc/php.ini |
pascal@1143 | 47 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \ |
pascal@1143 | 48 -i $fs/etc/php.ini |
pankso@18 | 49 cp -a stuff/phpinfo $fs/usr/share |
pascal@1143 | 50 for i in $(cd $WOK; ls -d php-*) |
pascal@1143 | 51 do |
pascal@1143 | 52 tazwok cook $i |
pascal@1143 | 53 done |
pankso@18 | 54 } |
pankso@18 | 55 |
pankso@18 | 56 # Post and pre install commans to stop |
pankso@18 | 57 # and restart Web server if needed. |
pankso@18 | 58 pre_install() |
pankso@18 | 59 { |
pankso@18 | 60 if [ -f "$1/var/run/lighttpd.pid" ]; then |
pankso@18 | 61 /etc/init.d/lighttpd stop |
pankso@18 | 62 fi |
pankso@18 | 63 # Backup existing php.ini |
pankso@18 | 64 if [ -f "$1/etc/php.ini" ]; then |
pankso@18 | 65 echo -n "Creating php.ini backup..." |
pankso@18 | 66 cp $1/etc/php.ini $1/etc/php.ini.bak |
pankso@18 | 67 status |
pankso@18 | 68 fi |
pankso@18 | 69 } |
pankso@18 | 70 post_install() |
pankso@18 | 71 { |
pascal@1223 | 72 ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \ |
pascal@1223 | 73 $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT |
pascal@1223 | 74 etc/php.ini |
pascal@1223 | 75 EOT |
pankso@18 | 76 # Restore original php.ini |
pankso@18 | 77 if [ -f "$1/etc/php.ini.bak" ]; then |
pankso@18 | 78 echo -n "Restoring php.ini backup..." |
pankso@18 | 79 mv -f $1/etc/php.ini.bak $1/etc/php.ini |
pankso@18 | 80 status |
pankso@18 | 81 fi |
pascal@1143 | 82 # Enable php |
pascal@1143 | 83 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then |
pascal@1143 | 84 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \ |
pascal@1143 | 85 tazpkg get-install lighttpd-modules --root=$1/ |
pascal@1143 | 86 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \ |
pascal@1143 | 87 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \ |
pascal@1143 | 88 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \ |
pascal@1143 | 89 -i $1/etc/lighttpd/lighttpd.conf |
pascal@1143 | 90 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \ |
pascal@1143 | 91 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \ |
pascal@1143 | 92 -i $1/etc/lighttpd/lighttpd.conf |
pascal@1143 | 93 fi |
pankso@18 | 94 # Start Web server. |
pascal@1137 | 95 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then |
pankso@18 | 96 /etc/init.d/lighttpd start |
pankso@18 | 97 fi |
pankso@18 | 98 } |
pankso@18 | 99 |
pascal@1223 | 100 repack_cleanup() |
pascal@1223 | 101 { |
pascal@1223 | 102 zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id ) |
pascal@1223 | 103 } |