# HG changeset patch # User Pascal Bellard # Date 1219862922 0 # Node ID 41897da4a1dbcf6e938b40fcd83dcf198a1792c4 # Parent 32fa0b9984a6056b96a8600fe81eefcea27015b0 php*: add apache support diff -r 32fa0b9984a6 -r 41897da4a1db php-apache/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/php-apache/receipt Wed Aug 27 18:48:42 2008 +0000 @@ -0,0 +1,55 @@ +# SliTaz package receipt. + +PACKAGE="php-apache" +VERSION="5.2.5" +CATEGORY="development" +SHORT_DESC="PHP module for apache." +MAINTAINER="pascal.bellard@slitaz.org" +DEPENDS="php-common apache" +WEB_SITE="http://www.php.net/" +WANTED="php" +PROVIDE="php:apache" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/share + cp -a $_pkg/usr/share/apache $fs/usr/share +} + +# Post and pre install commans to stop +# and restart Web server if needed. +pre_install() +{ + if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]; then + /etc/init.d/apache stop + fi +} + +post_install() +{ + grep -q php5_module $1/etc/apache/httpd.conf || { + sed -e 's|mod_rewrite.so|mod_rewrite.so\nLoadModule php5_module share/apache/modules/libphp5.so|' \ + -e 's|DirectoryIndex index.html|DirectoryIndex index.html index.php|' \ + -e 's|mime.types|mime.types\n AddType application/x-httpd-php .php .php3 .php4 .php5\n AddType application/x-httpd-php-source .phps|' \ + -i $1/etc/apache/httpd.conf + } + [ -f $1/etc/apache/conf.d/phpinfo ] || \ + cat > $1/etc/apache/conf.d/phpinfo < + Alias /phpinfo /usr/share/phpinfo + + + DirectoryIndex index.php + Options +FollowSymLinks + AllowOverride None + Order allow,deny + Allow from all + +EOT + # Start Web server. + if [ -z "$1" -a ! -f "/var/run/apache/httpd.pid" ]; then + /etc/init.d/apache start + fi +} + diff -r 32fa0b9984a6 -r 41897da4a1db php-common/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/php-common/receipt Wed Aug 27 18:48:42 2008 +0000 @@ -0,0 +1,49 @@ +# SliTaz package receipt. + +PACKAGE="php-common" +VERSION="5.2.5" +CATEGORY="development" +SHORT_DESC="Common files for PHP modules." +MAINTAINER="pascal.bellard@slitaz.org" +WEB_SITE="http://www.php.net/" +WANTED="php" +CONFIG_FILES="/etc/php.ini" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/share $fs/etc + cp -a $_pkg/usr/share/phpinfo $fs/usr/share + cp -a $_pkg/usr/share/applications $fs/usr/share + cp -a $_pkg/usr/share/pixmap $fs/usr/share + cp $_pkg/etc/php.ini $fs/etc +} + +# Post and pre install commands +pre_install() +{ + # Backup existing php.ini + if [ -f "$1/etc/php.ini" ]; then + echo -n "Creating php.ini backup..." + cp $1/etc/php.ini $1/etc/php.ini.bak + status + fi +} +post_install() +{ + ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \ + $1/$INSTALLED/$PACKAGE/volatile.cpio.gz < \ - $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <