wok view php-apache/receipt @ rev 1479
madwifi: typo
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Oct 04 14:46:49 2008 +0000 (2008-10-04) |
parents | |
children | 1143af92f66a |
line source
1 # SliTaz package receipt.
3 PACKAGE="php-apache"
4 VERSION="5.2.5"
5 CATEGORY="development"
6 SHORT_DESC="PHP module for apache."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 DEPENDS="php-common apache"
9 WEB_SITE="http://www.php.net/"
10 WANTED="php"
11 PROVIDE="php:apache"
13 # Rules to gen a SliTaz package suitable for Tazpkg.
14 genpkg_rules()
15 {
16 mkdir -p $fs/usr/share
17 cp -a $_pkg/usr/share/apache $fs/usr/share
18 }
20 # Post and pre install commans to stop
21 # and restart Web server if needed.
22 pre_install()
23 {
24 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]; then
25 /etc/init.d/apache stop
26 fi
27 }
29 post_install()
30 {
31 grep -q php5_module $1/etc/apache/httpd.conf || {
32 sed -e 's|mod_rewrite.so|mod_rewrite.so\nLoadModule php5_module share/apache/modules/libphp5.so|' \
33 -e 's|DirectoryIndex index.html|DirectoryIndex index.html index.php|' \
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|' \
35 -i $1/etc/apache/httpd.conf
36 }
37 [ -f $1/etc/apache/conf.d/phpinfo ] || \
38 cat > $1/etc/apache/conf.d/phpinfo <<EOT
39 <IfModule mod_alias.c>
40 Alias /phpinfo /usr/share/phpinfo
41 </IfModule>
42 <DirectoryMatch /usr/share/phpinfo/>
43 DirectoryIndex index.php
44 Options +FollowSymLinks
45 AllowOverride None
46 Order allow,deny
47 Allow from all
48 </DirectoryMatch>
49 EOT
50 # Start Web server.
51 if [ -z "$1" -a ! -f "/var/run/apache/httpd.pid" ]; then
52 /etc/init.d/apache start
53 fi
54 }