wok-current view php-apache/receipt @ rev 24056
Up zstd (1.5.0)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Jun 08 09:29:15 2021 +0000 (2021-06-08) |
parents | b10d41313e54 |
children | 8ce450c92191 |
line source
1 # SliTaz package receipt.
3 PACKAGE="php-apache"
4 VERSION="7.4.4"
5 CATEGORY="development"
6 SHORT_DESC="PHP module for apache."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="BSD"
9 WEB_SITE="https://www.php.net/"
11 PROVIDE="php:apache"
12 DEPENDS="apache libxml2 php-common zlib"
13 WANTED="php"
15 # Rules to gen a SliTaz package suitable for Tazpkg.
16 genpkg_rules()
17 {
18 mkdir -p $fs/usr/share
19 cp -a $install/usr/share/apache $fs/usr/share
20 }
22 # Post and pre install commans to stop
23 # and restart Web server if needed.
24 pre_install()
25 {
26 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]
27 then
28 /etc/init.d/apache stop
29 fi
30 }
32 post_install()
33 {
34 grep -q php5_module "$1/etc/apache/httpd.conf" ||
35 {
36 sed -e 's|mod_rewrite.so|mod_rewrite.so\nLoadModule php5_module share/apache/modules/libphp5.so|' \
37 -e 's|DirectoryIndex index.html|DirectoryIndex index.html index.php|' \
38 -e 's|mime.types|mime.types\n AddType application/x-httpd-php .php .php3 .php4 .php5\n AddType application/x-httpd-php-source .phps|' \
39 -i "$1/etc/apache/httpd.conf"
40 }
42 [ -f "$1/etc/apache/conf.d/phpinfo" ] ||
43 cat > "$1/etc/apache/conf.d/phpinfo" <<EOT
44 <IfModule mod_alias.c>
45 Alias /phpinfo /usr/share/phpinfo
46 </IfModule>
47 <DirectoryMatch /usr/share/phpinfo/>
48 DirectoryIndex index.php
49 Options +FollowSymLinks
50 AllowOverride None
51 Order allow,deny
52 Allow from all
53 </DirectoryMatch>
54 EOT
56 # Restart Web server.
57 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]
58 then
59 /etc/init.d/apache stop
60 sleep 2
61 fi
62 if [ -z "$1" ]
63 then
64 /etc/init.d/apache start
65 fi
66 }