wok-current annotate php-apache/receipt @ rev 25725
Patch openssh CVE-2024-6387
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Mon Jul 01 15:09:44 2024 +0000 (7 weeks ago) |
parents | a23978bfa665 |
children |
rev | line source |
---|---|
pascal@1315 | 1 # SliTaz package receipt. |
pascal@1315 | 2 |
pascal@1315 | 3 PACKAGE="php-apache" |
shann@25629 | 4 VERSION="7.4.33" |
pascal@1315 | 5 CATEGORY="development" |
pascal@1315 | 6 SHORT_DESC="PHP module for apache." |
pascal@1315 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@15198 | 8 LICENSE="BSD" |
pascal@21278 | 9 WEB_SITE="https://www.php.net/" |
Hans-G?nter@23426 | 10 |
Hans-G?nter@23426 | 11 PROVIDE="php:apache" |
Hans-G?nter@23426 | 12 DEPENDS="apache libxml2 php-common zlib" |
pascal@1315 | 13 WANTED="php" |
pascal@15198 | 14 |
pascal@1315 | 15 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@1315 | 16 genpkg_rules() |
pascal@1315 | 17 { |
pascal@1315 | 18 mkdir -p $fs/usr/share |
Hans-G?nter@23426 | 19 cp -a $install/usr/share/apache $fs/usr/share |
pascal@1315 | 20 } |
pascal@1315 | 21 |
pascal@1315 | 22 # Post and pre install commans to stop |
pascal@1315 | 23 # and restart Web server if needed. |
pascal@1315 | 24 pre_install() |
pascal@1315 | 25 { |
Hans-G?nter@23426 | 26 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ] |
Hans-G?nter@23426 | 27 then |
pascal@1315 | 28 /etc/init.d/apache stop |
pascal@1315 | 29 fi |
pascal@1315 | 30 } |
pascal@1315 | 31 |
pascal@1315 | 32 post_install() |
pascal@1315 | 33 { |
Hans-G?nter@23426 | 34 grep -q php5_module "$1/etc/apache/httpd.conf" || |
Hans-G?nter@23426 | 35 { |
shann@25693 | 36 sed -e 's|mod_rewrite.so|mod_rewrite.so\nLoadModule php7_module share/apache/modules/libphp7.so|' \ |
pascal@1315 | 37 -e 's|DirectoryIndex index.html|DirectoryIndex index.html index.php|' \ |
shann@25606 | 38 -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|' \ |
pascal@18730 | 39 -i "$1/etc/apache/httpd.conf" |
pascal@1315 | 40 } |
Hans-G?nter@23426 | 41 |
Hans-G?nter@23426 | 42 [ -f "$1/etc/apache/conf.d/phpinfo" ] || |
pascal@18730 | 43 cat > "$1/etc/apache/conf.d/phpinfo" <<EOT |
pascal@1315 | 44 <IfModule mod_alias.c> |
pascal@1315 | 45 Alias /phpinfo /usr/share/phpinfo |
pascal@1315 | 46 </IfModule> |
pascal@1315 | 47 <DirectoryMatch /usr/share/phpinfo/> |
pascal@1315 | 48 DirectoryIndex index.php |
pascal@1315 | 49 Options +FollowSymLinks |
pascal@1315 | 50 AllowOverride None |
pascal@1315 | 51 Order allow,deny |
pascal@1315 | 52 Allow from all |
shann@25606 | 53 Require all granted |
pascal@1315 | 54 </DirectoryMatch> |
pascal@1315 | 55 EOT |
Hans-G?nter@23426 | 56 |
pascal@1805 | 57 # Restart Web server. |
Hans-G?nter@23426 | 58 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ] |
Hans-G?nter@23426 | 59 then |
pascal@1805 | 60 /etc/init.d/apache stop |
pascal@1805 | 61 sleep 2 |
pascal@1805 | 62 fi |
Hans-G?nter@23426 | 63 if [ -z "$1" ] |
Hans-G?nter@23426 | 64 then |
pascal@1315 | 65 /etc/init.d/apache start |
pascal@1315 | 66 fi |
pascal@1315 | 67 } |