wok-next annotate apache/receipt @ rev 21590

updated dialog (1.3-20181107 -> 1.3.20200327)
author Hans-G?nter Theisgen
date Wed Jun 24 07:00:06 2020 +0100 (2020-06-24)
parents e19ff076dc63
children
rev   line source
pascal@20185 1 # SliTaz package receipt v2.
pascal@1313 2
pascal@1313 3 PACKAGE="apache"
Hans-G?nter@21488 4 VERSION="2.4.43"
pascal@1313 5 CATEGORY="network"
Hans-G?nter@21488 6 TAGS="webserver http server"
al@20469 7 SHORT_DESC="Secure, efficient and extensible HTTP server"
pascal@1313 8 MAINTAINER="pascal.bellard@slitaz.org"
pascal@15361 9 LICENSE="Apache"
pascal@1313 10 WEB_SITE="http://www.apache.org/"
al@20469 11
al@20469 12 TARBALL="httpd-$VERSION.tar.bz2"
al@20469 13 WGET_URL="http://www.apache.org/dist/httpd/$TARBALL"
pascal@1313 14
Hans-G?nter@21488 15 BUILD_DEPENDS="apr-dev apr-util-dev bash expat-dev openldap-dev
Hans-G?nter@21488 16 openssl-dev pcre-dev sed util-linux-uuid-dev zlib-dev"
al@21020 17 SPLIT="$PACKAGE-dev $PACKAGE-doc $PACKAGE"
pascal@15361 18
al@21094 19 COOKOPTS="force-arch" # different configs in dev
al@21094 20
Hans-G?nter@21488 21 compile_rules()
Hans-G?nter@21488 22 {
pascal@1313 23 grep -q Slitaz config.layout || \
slaxemulator@9698 24 cat $stuff/slitaz.layout >> config.layout
Hans-G?nter@21488 25 sed -i 's|mkdir |mkdir -p |' \
Hans-G?nter@21488 26 build/mkdir.sh
al@20469 27
Hans-G?nter@21488 28 ./configure \
Hans-G?nter@21488 29 --mandir=/usr/share/man \
Hans-G?nter@21488 30 --enable-layout=Slitaz \
Hans-G?nter@21488 31 --enable-mods-shared=all \
Hans-G?nter@21488 32 --enable-proxy \
Hans-G?nter@21488 33 --enable-ssl \
al@20469 34 $CONFIGURE_ARGS &&
al@21020 35 make $MAKEFLAGS &&
al@21020 36 make DESTDIR=$install install || return 1
pascal@1313 37
Hans-G?nter@21488 38 install -Dm755 $stuff/apache $install/etc/init.d/apache
erjo@4647 39
al@20469 40 mkdir -p $install/etc/apache/extra/
al@20469 41 cp -a $stuff/fix-range-CVE-2011-3192.conf $install/etc/apache/extra/
al@20469 42
al@20469 43 sed -i \
al@20469 44 -e 's|User daemon|User www|' \
al@20469 45 -e 's|Group daemon|Group www|' \
al@20469 46 -e 's|ServerAdmin you@example.com|ServerAdmin root@localhost|' \
al@20469 47 -e 's|#Include /etc/apache/extra/httpd-ssl.conf|Include /etc/apache/extra/httpd-ssl.conf|' \
al@20469 48 -e 's|/etc/apache/server.crt|/etc/ssl/apache/apache.pem|' \
al@20469 49 -e 's|/etc/apache/server.key|/etc/ssl/apache/apache.pem|' \
al@20469 50 -e 's|#LoadModule ssl_module|LoadModule ssl_module|' \
al@20469 51 $install/etc/apache/httpd.conf \
al@20469 52 $install/etc/apache/extra/httpd-ssl.conf
al@20469 53
al@20469 54 echo "Include /etc/apache/conf.d" >> $install/etc/apache/httpd.conf
al@20469 55 sed -i 's/^SSLSessionCache /#&/' $install/etc/apache/extra/httpd-ssl.conf
al@20469 56 cat >> $install/etc/apache/extra/httpd-ssl.conf <<EOT
pascal@17237 57
pascal@17237 58 # Unsafe, see CVE-2014-3566 POODLE
pascal@17237 59 SSLProtocol All -SSLv2 -SSLv3
pascal@17237 60 EOT
al@20469 61
al@20469 62 chown -R root:root $install
al@20469 63 }
al@20469 64
Hans-G?nter@21488 65 genpkg_rules()
Hans-G?nter@21488 66 {
al@20469 67 case $PACKAGE in
al@20469 68 apache-dev)
al@20469 69 copy @dev apxs /usr/share/apache/build/
al@20469 70 rm -r $fs/usr/share/apache/error/ # here folder 'include'
al@20469 71 ;;
al@20469 72 apache-doc)
al@20469 73 copy /usr/share/doc/
al@20469 74 CAT="development|documentation"
al@20469 75 ;;
al@20469 76 apache)
al@20469 77 copy @std @rm /usr/share/apache/error/include/
al@20469 78 rm -rf $fs/etc/apache/original/
al@20469 79 CONFIG_FILES="/etc/apache/ /var/www/ /etc/ssl/apache/"
al@20469 80 TAZPANEL_DAEMON="edit::/etc/apache/httpd.conf|web::$WEB_SITE"
al@20469 81 PROVIDE="lighttpd"
al@20749 82 DEPENDS="apr apr-util libldap libpcre openssl zlib"
al@20469 83 ;;
pascal@20185 84 esac
pascal@1313 85 }
pascal@1313 86
pascal@1313 87 # We stop the server by default in case of upgarde.
Hans-G?nter@21488 88 pre_install_apache()
Hans-G?nter@21488 89 {
al@20469 90 [ -n "$1" ] ||
Hans-G?nter@21488 91 for i in httpd lighttpd ngnix cherokee $PACKAGE
Hans-G?nter@21488 92 do
pascal@19147 93 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
Hans-G?nter@21488 94 done
pascal@1313 95 }
pascal@1313 96
Hans-G?nter@21488 97 post_install_apache()
Hans-G?nter@21488 98 {
pascal@18893 99 local lang=$(. $1/etc/locale.conf 2>/dev/null; echo ${LANG#*_})
pascal@18893 100 local tz=$(cat $1/etc/TZ 2>/dev/null)
pascal@18893 101 local hostname=$(cat $1/etc/hostname 2>/dev/null)
al@18667 102
pascal@1313 103 # Just in case.
pascal@18730 104 chown www.www "$1/var/log/$PACKAGE"
al@21020 105
al@21020 106 ping -c 2 $(hostname) >/dev/null 2>&1 ||
pascal@18730 107 sed -i "s/localhost/$(hostname) localhost/" "$1/etc/hosts"
al@21020 108
Hans-G?nter@21488 109 sed -i -e "s/^#\(LoadModule.*slotmem_shm.*\)$/\1/" \
al@21020 110 -e "s/.*ServerName www.example.*/ServerName ${hostname:-slitaz}/" \
Hans-G?nter@21488 111 $1/etc/apache/httpd.conf \
Hans-G?nter@21488 112 $1/etc/apache/extra/httpd-ssl.conf
al@21020 113
pascal@18893 114 grep -qs Apache $1/var/www/index.html &&
pascal@18893 115 sed -i 's|^LighTTPD.*|&\nApache configs : /etc/apache|' \
pascal@18893 116 $1/var/www/index.html
al@21020 117
pascal@18730 118 [ -s "$1/etc/ssl/apache/apache.pem" ] ||
pascal@18730 119 openssl req -new -x509 -keyout "$1/etc/ssl/apache/apache.pem" \
pascal@18730 120 -out "$1/etc/ssl/apache/apache.pem" -days 3650 -nodes <<EOT
pascal@18893 121 ${lang:-US}
pascal@18893 122 ${tz:-Somewhere}
pascal@18893 123
pascal@18893 124
pascal@1794 125
pascal@12197 126 ${hostname:-slitaz}
pascal@1794 127
pascal@1794 128 EOT
al@21020 129
al@18667 130 [ -z "$quiet" ] && echo # Start new line
al@21020 131 ( cd "$1/$INSTALLED/"; grep -l /etc/apache/conf.d/ */receipt ) | \
Hans-G?nter@21488 132 while read file
Hans-G?nter@21488 133 do
pascal@1922 134 pkg=$(dirname $file)
pascal@1922 135 [ "$pkg" = "$PACKAGE" ] && continue
al@18667 136 [ -z "$quiet" ] && echo "Reconfiguring $pkg for $PACKAGE..."
pascal@1922 137 tazpkg reconfigure $pkg
Hans-G?nter@21488 138 done
pascal@18730 139 [ -f "$1/etc/php.ini" ] && tazpkg get-install php-apache --root="$1"
pascal@18715 140 [ "$1" ] || netstat -ltn 2> /dev/null | grep -q :80 ||
pascal@18715 141 /etc/init.d/$PACKAGE start
pascal@1313 142 }