wok-6.x annotate php/receipt @ rev 1315
php*: add apache support
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Aug 27 18:48:42 2008 +0000 (2008-08-27) |
parents | c932ccf0e453 |
children | 0db2ef809433 |
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" |
pascal@1315 | 8 DEPENDS="php-common lighttpd zlib libxml2 sqlite" |
pascal@1315 | 9 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev mysql-dev postgresql postgresql-dev gettext openssl-dev apache-dev apache" |
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@1315 | 13 PROVIDE="php:lighttpd" |
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 |
pascal@1315 | 19 COMMON_ARGS="\ |
pascal@1315 | 20 --prefix=/usr \ |
pascal@1315 | 21 --sysconfdir=/etc \ |
pascal@1315 | 22 --infodir=/usr/share/info \ |
pascal@1315 | 23 --mandir=/usr/share/man \ |
pascal@1315 | 24 --enable-fastcgi \ |
pascal@1315 | 25 --enable-discard-path \ |
pascal@1315 | 26 --enable-force-cgi-redirect \ |
pascal@1315 | 27 --enable-mbstring \ |
pascal@1315 | 28 --with-config-file-path=/etc \ |
pascal@1315 | 29 --with-zlib \ |
pascal@1315 | 30 --with-gettext \ |
pascal@1315 | 31 --with-mysql=shared,usr \ |
pascal@1315 | 32 --with-pgsql=shared,usr \ |
pascal@1315 | 33 --with-ldap=shared \ |
pascal@1315 | 34 --disable-cli" |
pascal@1315 | 35 ./configure $COMMON_ARGS $CONFIGURE_ARGS && \ |
pascal@1315 | 36 make && make INSTALL_ROOT=$PWD/_pkg install |
pascal@1315 | 37 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs $CONFIGURE_ARGS && \ |
pascal@1315 | 38 make && { |
pascal@1315 | 39 mkdir -p _pkg/etc/apache |
pascal@1315 | 40 cp /etc/apache/httpd.conf _pkg/etc/apache/httpd.conf |
pascal@1315 | 41 make INSTALL_ROOT=$PWD/_pkg install |
pascal@1315 | 42 } |
pascal@1315 | 43 # Recommended config file and phpinfo. |
pascal@1315 | 44 cp php.ini-recommended _pkg/etc/php.ini |
pascal@1315 | 45 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \ |
pascal@1315 | 46 -i _pkg/etc/php.ini |
pascal@1315 | 47 cp -a ../stuff/phpinfo _pkg/usr/share |
pascal@1315 | 48 mkdir _pkg/usr/share/applications _pkg/usr/share/pixmap |
pascal@1315 | 49 cp ../stuff/php.desktop _pkg/usr/share/applications |
pascal@1315 | 50 cp ../stuff/php.png _pkg/usr/share/pixmap |
pankso@18 | 51 } |
pankso@18 | 52 |
pankso@18 | 53 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@18 | 54 genpkg_rules() |
pankso@18 | 55 { |
pankso@18 | 56 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share |
pankso@18 | 57 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin |
pascal@1143 | 58 for i in $(cd $WOK; ls -d php-*) |
pascal@1143 | 59 do |
pascal@1143 | 60 tazwok cook $i |
pascal@1143 | 61 done |
pankso@18 | 62 } |
pankso@18 | 63 |
pascal@1315 | 64 # Post and pre install commands to stop |
pankso@18 | 65 # and restart Web server if needed. |
pankso@18 | 66 pre_install() |
pankso@18 | 67 { |
pankso@18 | 68 if [ -f "$1/var/run/lighttpd.pid" ]; then |
pankso@18 | 69 /etc/init.d/lighttpd stop |
pankso@18 | 70 fi |
pankso@18 | 71 } |
pankso@18 | 72 post_install() |
pankso@18 | 73 { |
pascal@1143 | 74 # Enable php |
pascal@1143 | 75 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then |
pascal@1143 | 76 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \ |
pascal@1143 | 77 tazpkg get-install lighttpd-modules --root=$1/ |
pascal@1143 | 78 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \ |
pascal@1143 | 79 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \ |
pascal@1143 | 80 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \ |
pascal@1143 | 81 -i $1/etc/lighttpd/lighttpd.conf |
pascal@1143 | 82 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \ |
pascal@1143 | 83 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \ |
pascal@1143 | 84 -i $1/etc/lighttpd/lighttpd.conf |
pascal@1143 | 85 fi |
pankso@18 | 86 # Start Web server. |
pascal@1137 | 87 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then |
pankso@18 | 88 /etc/init.d/lighttpd start |
pankso@18 | 89 fi |
pankso@18 | 90 } |