wok-current view apache/receipt @ rev 22888

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