wok view php-apache/receipt @ rev 11019

get-virtualbox: using https now...
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Oct 14 16:57:10 2011 +0200 (2011-10-14)
parents ed560df8d2fc
children 855f42b596c0
line source
1 # SliTaz package receipt.
3 PACKAGE="php-apache"
4 VERSION="5.2.17"
5 CATEGORY="development"
6 SHORT_DESC="PHP module for apache."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 DEPENDS="php-common apache libxml2 zlib"
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 # Restart Web server.
51 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]; then
52 /etc/init.d/apache stop
53 sleep 2
54 fi
55 if [ -z "$1" ]; then
56 /etc/init.d/apache start
57 fi
58 }