wok annotate php/receipt @ rev 1524

Update BUILD_DEPENDS for abiword-plugins alsaplayer apr-util gnumeric libgnomeprintui qt-x11-opensource-src
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Oct 08 17:10:58 2008 +0000 (2008-10-08)
parents a65b8677018a
children dd7d91c4b11b
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@1324 9 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev mysql-dev \
pascal@1324 10 postgresql postgresql-dev gettext openssl-dev apache-dev apache \
pascal@1326 11 c-client mhash mhash-dev libpng libpng-dev"
pankso@18 12 TARBALL="$PACKAGE-$VERSION.tar.bz2"
pankso@18 13 WEB_SITE="http://www.php.net/"
pankso@18 14 WGET_URL="http://us2.php.net/distributions/$TARBALL"
pascal@1315 15 PROVIDE="php:lighttpd"
pankso@18 16
pankso@18 17 # Rules to configure and make the package.
pankso@18 18 compile_rules()
pankso@18 19 {
pankso@18 20 cd $src
pascal@1315 21 COMMON_ARGS="\
pascal@1315 22 --prefix=/usr \
pascal@1315 23 --sysconfdir=/etc \
pascal@1315 24 --infodir=/usr/share/info \
pascal@1315 25 --mandir=/usr/share/man \
pascal@1315 26 --enable-fastcgi \
pascal@1315 27 --enable-discard-path \
pascal@1315 28 --enable-force-cgi-redirect \
pascal@1315 29 --enable-mbstring \
pascal@1315 30 --with-config-file-path=/etc \
pascal@1315 31 --with-zlib \
pascal@1315 32 --with-gettext \
pascal@1324 33 --with-mysql=shared,/usr \
pascal@1324 34 --with-pgsql=shared,/usr \
pascal@1315 35 --with-ldap=shared \
pascal@1324 36 --with-imap=shared --with-imap-ssl \
pascal@1324 37 --with-mhash=shared \
pascal@1326 38 --with-gd=shared \
pascal@1315 39 --disable-cli"
pascal@1315 40 ./configure $COMMON_ARGS $CONFIGURE_ARGS && \
pascal@1315 41 make && make INSTALL_ROOT=$PWD/_pkg install
pascal@1315 42 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs $CONFIGURE_ARGS && \
pascal@1315 43 make && {
pascal@1315 44 mkdir -p _pkg/etc/apache
pascal@1315 45 cp /etc/apache/httpd.conf _pkg/etc/apache/httpd.conf
pascal@1315 46 make INSTALL_ROOT=$PWD/_pkg install
pascal@1315 47 }
pascal@1315 48 # Recommended config file and phpinfo.
pascal@1315 49 cp php.ini-recommended _pkg/etc/php.ini
pascal@1315 50 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
pascal@1315 51 -i _pkg/etc/php.ini
pascal@1315 52 cp -a ../stuff/phpinfo _pkg/usr/share
pascal@1315 53 mkdir _pkg/usr/share/applications _pkg/usr/share/pixmap
pascal@1315 54 cp ../stuff/php.desktop _pkg/usr/share/applications
mallory@1405 55 cp ../stuff/php.png _pkg/usr/share/pixmaps
pankso@18 56 }
pankso@18 57
pankso@18 58 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@18 59 genpkg_rules()
pankso@18 60 {
pankso@18 61 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share
pankso@18 62 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
pascal@1143 63 for i in $(cd $WOK; ls -d php-*)
pascal@1143 64 do
pascal@1143 65 tazwok cook $i
pascal@1143 66 done
pankso@18 67 }
pankso@18 68
pascal@1315 69 # Post and pre install commands to stop
pankso@18 70 # and restart Web server if needed.
pankso@18 71 pre_install()
pankso@18 72 {
pankso@18 73 if [ -f "$1/var/run/lighttpd.pid" ]; then
pankso@18 74 /etc/init.d/lighttpd stop
pankso@18 75 fi
pankso@18 76 }
pankso@18 77 post_install()
pankso@18 78 {
pascal@1143 79 # Enable php
pascal@1143 80 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
pascal@1143 81 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \
pascal@1143 82 tazpkg get-install lighttpd-modules --root=$1/
pascal@1143 83 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
pascal@1143 84 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
pascal@1143 85 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
pascal@1143 86 -i $1/etc/lighttpd/lighttpd.conf
pascal@1143 87 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \
pascal@1143 88 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
pascal@1143 89 -i $1/etc/lighttpd/lighttpd.conf
pascal@1349 90 grep -q php3 $1/etc/lighttpd/lighttpd.conf || \
pascal@1349 91 sed -e 's|for PHP|for PHP\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|'
pascal@1349 92
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 }