wok-4.x annotate php-apache/receipt @ rev 1910

tazndis, update rcS.conf and load ndiswrapper module.
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Mon Dec 22 00:46:23 2008 +0100 (2008-12-22)
parents 41897da4a1db
children d1aba649375c
rev   line source
pascal@1315 1 # SliTaz package receipt.
pascal@1315 2
pascal@1315 3 PACKAGE="php-apache"
pascal@1315 4 VERSION="5.2.5"
pascal@1315 5 CATEGORY="development"
pascal@1315 6 SHORT_DESC="PHP module for apache."
pascal@1315 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@1315 8 DEPENDS="php-common apache"
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