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

Merge wok for both arch and few updates
author Stanislas Leduc <shann@slitaz.org>
date Thu Dec 05 08:39:45 2024 +0000 (9 months ago)
parents bfd1d974e88e
children
line source
1 # SliTaz package receipt.
3 PACKAGE="php-apache"
4 VERSION="7.4.33"
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 HOST_ARCH="i486 x86_64"
17 # Rules to gen a SliTaz package suitable for Tazpkg.
18 genpkg_rules()
19 {
20 mkdir -p $fs/usr/share
21 cp -a $install/usr/share/apache $fs/usr/share
22 }
24 # Post and pre install commans to stop
25 # and restart Web server if needed.
26 pre_install()
27 {
28 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]
29 then
30 /etc/init.d/apache stop
31 fi
32 }
34 post_install()
35 {
36 grep -q php5_module "$1/etc/apache/httpd.conf" ||
37 {
38 sed -e 's|mod_rewrite.so|mod_rewrite.so\nLoadModule php7_module share/apache/modules/libphp7.so|' \
39 -e 's|DirectoryIndex index.html|DirectoryIndex index.html index.php|' \
40 -e 's|mime.types|mime.types\n AddType application/x-httpd-php .php .php3 .php4 .php5 .php7\n AddType application/x-httpd-php-source .phps|' \
41 -i "$1/etc/apache/httpd.conf"
42 }
44 [ -f "$1/etc/apache/conf.d/phpinfo" ] ||
45 cat > "$1/etc/apache/conf.d/phpinfo" <<EOT
46 <IfModule mod_alias.c>
47 Alias /phpinfo /usr/share/phpinfo
48 </IfModule>
49 <DirectoryMatch /usr/share/phpinfo/>
50 DirectoryIndex index.php
51 Options +FollowSymLinks
52 AllowOverride None
53 Order allow,deny
54 Allow from all
55 Require all granted
56 </DirectoryMatch>
57 EOT
59 # Restart Web server.
60 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]
61 then
62 /etc/init.d/apache stop
63 sleep 2
64 fi
65 if [ -z "$1" ]
66 then
67 /etc/init.d/apache start
68 fi
69 }