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