# SliTaz package receipt. PACKAGE="php" VERSION="5.2.17" CATEGORY="development" SHORT_DESC="PHP web programming language." MAINTAINER="pankso@slitaz.org" TARBALL="$PACKAGE-$VERSION.tar.bz2" WEB_SITE="http://www.php.net/" WGET_URL="http://us2.php.net/distributions/$TARBALL" PROVIDE="php:lighttpd" DEPENDS="php-common lighttpd zlib libxml2 sqlite libssl" BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev libmysqlclient mysql-dev \ net-snmp-dev postgresql-dev gettext openssl-dev apache-dev apr-util-dev \ c-client mhash-dev libpng-dev libunixODBC unixODBC-dev openldap-dev \ libldap apr-dev libmcrypt-dev curl-dev cyrus-sasl-dev perl pkg-config \ jpeg-dev net-snmp-dev apache" # Rules to configure and make the package. compile_rules() { cd $src COMMON_ARGS="\ --prefix=/usr \ --sysconfdir=/etc \ --infodir=/usr/share/info \ --mandir=/usr/share/man \ --enable-fastcgi \ --enable-discard-path \ --enable-force-cgi-redirect \ --enable-mbstring \ --enable-sockets \ --enable-ftp \ --enable-zip \ --enable-calendar \ --enable-exif \ --enable-dba=shared \ --enable-dbase=shared \ --with-config-file-path=/etc \ --with-zlib \ --with-gettext \ --with-mcrypt=shared,/usr \ --with-mysql=shared,/usr \ --with-mysqli=shared \ --with-pgsql=shared,/usr \ --with-snmp=shared,/usr \ --enable-soap=shared,/usr \ --with-ldap=shared \ --with-imap=shared --with-imap-ssl \ --with-mhash=shared \ --with-gd=shared \ --with-jpeg-dir=/usr \ --with-png-dir=/usr \ --with-openssl=shared \ --with-unixODBC=shared,/usr \ --with-pear=/usr/share/php \ --with-pdo-mysql=shared \ --with-pdo-pgsql=shared \ --with-curl=shared \ " sed -i 's/pam_start/pam_nostart/' configure ./configure $COMMON_ARGS && \ make $MAKEFLAGS && make INSTALL_ROOT=$DESTDIR install ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs && \ make $MAKEFLAGS && { mkdir -p $DESTDIR/etc/apache cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf make INSTALL_ROOT=$DESTDIR install } # Recommended config file. mkdir -p $DESTDIR/etc cp $src/php.ini-recommended $DESTDIR/etc/php.ini || exit 1 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \ -i $DESTDIR/etc/php.ini } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/usr/bin $fs/usr/share/php cp -a $src/sapi/cgi/php-cgi $fs/usr/bin } # Post and pre install commands to stop and restart Web server if needed. pre_install() { if [ -f "$1/var/run/lighttpd.pid" ]; then /etc/init.d/lighttpd stop fi } post_install() { # Enable php if [ -f $1/etc/lighttpd/lighttpd.conf ]; then [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \ tazpkg get-install lighttpd-modules --root=$1/ sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \ -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \ -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \ -i $1/etc/lighttpd/lighttpd.conf grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \ sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \ -i $1/etc/lighttpd/lighttpd.conf grep -q php3 $1/etc/lighttpd/lighttpd.conf || \ sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \ -i $1/etc/lighttpd/lighttpd.conf fi # Start Web server. if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then /etc/init.d/lighttpd start fi }