wok-current view php-apache/receipt @ rev 5659

Up: libtheora (1.1.1)
author Alexander Medvedev <devl547@gmail.com>
date Sun May 30 02:47:06 2010 +0000 (2010-05-30)
parents cdb7f539e116
children 11b005eb0d03
line source
1 # SliTaz package receipt.
3 PACKAGE="php-apache"
4 VERSION="5.2.11"
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 }