wok-current annotate apache/receipt @ rev 23490

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