wok-next view apache/receipt @ rev 21031
Random updates
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sat Nov 03 15:42:26 2018 +0200 (2018-11-03) |
parents | 342b30daff76 |
children | e19ff076dc63 |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="apache"
4 VERSION="2.4.28"
5 CATEGORY="network"
6 SHORT_DESC="Secure, efficient and extensible HTTP server"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="Apache"
9 WEB_SITE="http://www.apache.org/"
11 TARBALL="httpd-$VERSION.tar.bz2"
12 WGET_URL="http://www.apache.org/dist/httpd/$TARBALL"
14 BUILD_DEPENDS="apr-util-dev apr-dev openssl-dev sed expat-dev zlib-dev \
15 util-linux-uuid-dev openldap-dev bash pcre-dev"
16 SPLIT="$PACKAGE-dev $PACKAGE-doc $PACKAGE"
18 compile_rules() {
19 grep -q Slitaz config.layout || \
20 cat $stuff/slitaz.layout >> config.layout
21 sed -i 's|mkdir |mkdir -p |' build/mkdir.sh
23 ./configure \
24 --mandir=/usr/share/man \
25 --enable-mods-shared=all \
26 --enable-proxy \
27 --enable-ssl \
28 --enable-layout=Slitaz \
29 $CONFIGURE_ARGS &&
30 make $MAKEFLAGS &&
31 make DESTDIR=$install install || return 1
33 install -Dm755 $stuff/apache $install/etc/init.d/apache
35 mkdir -p $install/etc/apache/extra/
36 cp -a $stuff/fix-range-CVE-2011-3192.conf $install/etc/apache/extra/
38 sed -i \
39 -e 's|User daemon|User www|' \
40 -e 's|Group daemon|Group www|' \
41 -e 's|ServerAdmin you@example.com|ServerAdmin root@localhost|' \
42 -e 's|#Include /etc/apache/extra/httpd-ssl.conf|Include /etc/apache/extra/httpd-ssl.conf|' \
43 -e 's|/etc/apache/server.crt|/etc/ssl/apache/apache.pem|' \
44 -e 's|/etc/apache/server.key|/etc/ssl/apache/apache.pem|' \
45 -e 's|#LoadModule ssl_module|LoadModule ssl_module|' \
46 $install/etc/apache/httpd.conf \
47 $install/etc/apache/extra/httpd-ssl.conf
49 echo "Include /etc/apache/conf.d" >> $install/etc/apache/httpd.conf
50 sed -i 's/^SSLSessionCache /#&/' $install/etc/apache/extra/httpd-ssl.conf
51 cat >> $install/etc/apache/extra/httpd-ssl.conf <<EOT
53 # Unsafe, see CVE-2014-3566 POODLE
54 SSLProtocol All -SSLv2 -SSLv3
55 EOT
57 chown -R root:root $install
58 }
60 genpkg_rules() {
61 case $PACKAGE in
62 apache-dev)
63 copy @dev apxs /usr/share/apache/build/
64 rm -r $fs/usr/share/apache/error/ # here folder 'include'
65 ;;
66 apache-doc)
67 copy /usr/share/doc/
68 CAT="development|documentation"
69 ;;
70 apache)
71 copy @std @rm /usr/share/apache/error/include/
72 rm -rf $fs/etc/apache/original/
73 CONFIG_FILES="/etc/apache/ /var/www/ /etc/ssl/apache/"
74 TAZPANEL_DAEMON="edit::/etc/apache/httpd.conf|web::$WEB_SITE"
75 PROVIDE="lighttpd"
76 TAGS="webserver http server"
77 DEPENDS="apr apr-util libldap libpcre openssl zlib"
78 ;;
79 esac
80 }
82 # We stop the server by default in case of upgarde.
83 pre_install_apache() {
84 [ -n "$1" ] ||
85 for i in httpd lighttpd ngnix cherokee $PACKAGE; do
86 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
87 done
88 }
90 post_install_apache() {
91 local lang=$(. $1/etc/locale.conf 2>/dev/null; echo ${LANG#*_})
92 local tz=$(cat $1/etc/TZ 2>/dev/null)
93 local hostname=$(cat $1/etc/hostname 2>/dev/null)
95 # Just in case.
96 chown www.www "$1/var/log/$PACKAGE"
98 ping -c 2 $(hostname) >/dev/null 2>&1 ||
99 sed -i "s/localhost/$(hostname) localhost/" "$1/etc/hosts"
101 sed -i -e "s/^#\(LoadModule.*slotmem_shm.*\)$/\1/" \
102 -e "s/.*ServerName www.example.*/ServerName ${hostname:-slitaz}/" \
103 $1/etc/apache/httpd.conf $1/etc/apache/extra/httpd-ssl.conf
105 grep -qs Apache $1/var/www/index.html &&
106 sed -i 's|^LighTTPD.*|&\nApache configs : /etc/apache|' \
107 $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
121 [ -z "$quiet" ] && echo # Start new line
122 ( cd "$1/$INSTALLED/"; grep -l /etc/apache/conf.d/ */receipt ) | \
123 while read file; 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 }