wok-next annotate php-apache/receipt @ rev 8243
Up: slitaz-base-files 4.1.2, tazpkg 4.2.3
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Fri Jan 28 23:10:49 2011 +0100 (2011-01-28) |
parents | ed560df8d2fc |
children | 855f42b596c0 |
rev | line source |
---|---|
pascal@1315 | 1 # SliTaz package receipt. |
pascal@1315 | 2 |
pascal@1315 | 3 PACKAGE="php-apache" |
slaxemulator@7925 | 4 VERSION="5.2.17" |
pascal@1315 | 5 CATEGORY="development" |
pascal@1315 | 6 SHORT_DESC="PHP module for apache." |
pascal@1315 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@2456 | 8 DEPENDS="php-common apache libxml2 zlib" |
pascal@1315 | 9 WEB_SITE="http://www.php.net/" |
pascal@1315 | 10 WANTED="php" |
pascal@1315 | 11 PROVIDE="php:apache" |
pascal@1315 | 12 |
pascal@1315 | 13 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@1315 | 14 genpkg_rules() |
pascal@1315 | 15 { |
pascal@1315 | 16 mkdir -p $fs/usr/share |
pascal@1315 | 17 cp -a $_pkg/usr/share/apache $fs/usr/share |
pascal@1315 | 18 } |
pascal@1315 | 19 |
pascal@1315 | 20 # Post and pre install commans to stop |
pascal@1315 | 21 # and restart Web server if needed. |
pascal@1315 | 22 pre_install() |
pascal@1315 | 23 { |
pascal@1315 | 24 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]; then |
pascal@1315 | 25 /etc/init.d/apache stop |
pascal@1315 | 26 fi |
pascal@1315 | 27 } |
pascal@1315 | 28 |
pascal@1315 | 29 post_install() |
pascal@1315 | 30 { |
pascal@1315 | 31 grep -q php5_module $1/etc/apache/httpd.conf || { |
pascal@1315 | 32 sed -e 's|mod_rewrite.so|mod_rewrite.so\nLoadModule php5_module share/apache/modules/libphp5.so|' \ |
pascal@1315 | 33 -e 's|DirectoryIndex index.html|DirectoryIndex index.html index.php|' \ |
pascal@1315 | 34 -e 's|mime.types|mime.types\n AddType application/x-httpd-php .php .php3 .php4 .php5\n AddType application/x-httpd-php-source .phps|' \ |
pascal@1315 | 35 -i $1/etc/apache/httpd.conf |
pascal@1315 | 36 } |
pascal@1315 | 37 [ -f $1/etc/apache/conf.d/phpinfo ] || \ |
pascal@1315 | 38 cat > $1/etc/apache/conf.d/phpinfo <<EOT |
pascal@1315 | 39 <IfModule mod_alias.c> |
pascal@1315 | 40 Alias /phpinfo /usr/share/phpinfo |
pascal@1315 | 41 </IfModule> |
pascal@1315 | 42 <DirectoryMatch /usr/share/phpinfo/> |
pascal@1315 | 43 DirectoryIndex index.php |
pascal@1315 | 44 Options +FollowSymLinks |
pascal@1315 | 45 AllowOverride None |
pascal@1315 | 46 Order allow,deny |
pascal@1315 | 47 Allow from all |
pascal@1315 | 48 </DirectoryMatch> |
pascal@1315 | 49 EOT |
pascal@1805 | 50 # Restart Web server. |
pascal@1805 | 51 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]; then |
pascal@1805 | 52 /etc/init.d/apache stop |
pascal@1805 | 53 sleep 2 |
pascal@1805 | 54 fi |
pascal@1805 | 55 if [ -z "$1" ]; then |
pascal@1315 | 56 /etc/init.d/apache start |
pascal@1315 | 57 fi |
pascal@1315 | 58 } |
pascal@1315 | 59 |