wok-current view apache/receipt @ rev 14809
(Up: Apache (2.4.4)
author | Eric Joseph-Alexandre <erjo@slitaz.org> |
---|---|
date | Wed Jul 17 13:31:24 2013 +0200 (2013-07-17) |
parents | e9130cce9043 |
children | 191b99ca9dc2 |
line source
1 # SliTaz package receipt.
3 PACKAGE="apache"
4 VERSION="2.4.4"
5 CATEGORY="network"
6 SHORT_DESC="Secure, efficient and extensible HTTP server."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 SOURCE="httpd"
9 TARBALL="$SOURCE-$VERSION.tar.bz2"
10 WEB_SITE="http://www.apache.org/"
11 WGET_URL="${WEB_SITE}dist/$SOURCE/$TARBALL"
12 DEPENDS="apr-util apr openssl pcre util-linux-uuid expat zlib"
13 BUILD_DEPENDS="apr-util-dev apr-dev openssl-dev sed expat-dev zlib-dev \
14 util-linux-uuid-dev openldap-dev bash"
15 CONFIG_FILES="/etc/apache /var/www /etc/ssl/apache"
16 TAZPANEL_DAEMON="edit::/etc/apache/httpd.conf|web::$WEB_SITE"
17 PROVIDE="lighttpd"
18 TAGS="webserver http server"
20 # Rules to configure and make the package.
21 compile_rules()
22 {
23 cd $src
24 grep -q Slitaz config.layout || \
25 cat $stuff/slitaz.layout >> config.layout
26 ./configure --mandir=/usr/share/man \
27 --with-program-name=apache \
28 --enable-mods-shared=all \
29 --enable-proxy \
30 --enable-ssl \
31 --enable-layout=Slitaz $CONFIGURE_ARGS &&
32 make $MAKEFLAGS && make DESTDIR=$DESTDIR install
33 }
35 # Rules to gen a SliTaz package suitable for Tazpkg.
36 genpkg_rules()
37 {
38 mkdir -p $fs/usr/share/apache $fs/etc/init.d $fs/etc/apache/conf.d
39 mkdir -p $fs/etc/ssl/apache
40 cp -a $_pkg/usr/share/apache/icons $fs/usr/share/apache
41 cp -a $_pkg/usr/share/apache/error $fs/usr/share/apache
42 cp -a $_pkg/usr/share/apache/modules $fs/usr/share/apache
43 cp -a $_pkg/usr/bin $fs/usr
44 rm -r $fs/usr/bin/apxs
45 cp -a $_pkg/etc $fs
46 rm -rf $fs/etc/apache/original
47 cp -a $_pkg/var $fs
49 cp -a $stuff/apache $fs/etc/init.d
50 mkdir -p $fs/etc/apache/extra
51 cp -a $stuff/fix-range-CVE-2011-3192.conf $fs/etc/apache/extra
53 sed -i -e 's|User daemon|User www|' -e 's|Group daemon|Group www|' \
54 -e 's|ServerAdmin you@example.com|ServerAdmin root@localhost|' \
55 -e 's|#Include /etc/apache/extra/httpd-ssl.conf|Include /etc/apache/extra/httpd-ssl.conf|' \
56 -e 's|/etc/apache/server.crt|/etc/ssl/apache/apache.pem|' \
57 -e 's|/etc/apache/server.key|/etc/ssl/apache/apache.pem|' \
58 $fs/etc/apache/apache.conf $fs/etc/apache/extra/httpd-ssl.conf
59 echo "Include /etc/apache/conf.d" >> $fs/etc/apache/apache.conf
60 }
62 # Pre and post install commands for Tazpkg.
63 # We stop the server by default in case of upgarde.
64 pre_install()
65 {
66 echo "Processing pre-install commands..."
67 [ -z "$1" ] && [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop
68 }
70 post_install()
71 {
72 local lang=$(. /etc/locale.conf 2>/dev/null; echo ${LANG#*_})
73 local tz=$(cat /etc/TZ 2>/dev/null)
74 local hostname=$(cat /etc/hostname 2>/dev/null)
75 echo "Processing post-install commands..."
76 # Just in case.
77 chown www.www $1/var/log/$PACKAGE
78 ping -c 2 $(hostname) > /dev/null 2>&1 ||
79 sed -i "s/localhost/$(hostname) localhost/" /etc/hosts
80 [ -s $1/etc/ssl/apache/apache.pem ] ||
81 openssl req -new -x509 -keyout $1/etc/ssl/apache/apache.pem \
82 -out $1/etc/ssl/apache/apache.pem -days 3650 -nodes <<EOT
83 ${lang:-us}
84 ${tz:-UTC}
86 ${hostname:-slitaz}
90 EOT
91 ( cd $1/$INSTALLED/ ; grep -l /etc/apache/conf.d/ */receipt ) | \
92 while read file; do
93 pkg=$(dirname $file)
94 [ "$pkg" = "$PACKAGE" ] && continue
95 echo "Reconfiguring $pkg for $PACKAGE..."
96 tazpkg reconfigure $pkg
97 done
98 if [ -z "$1" ]; then
99 for i in lighttpd ; do
100 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
101 done
102 /etc/init.d/$PACKAGE start
103 fi
104 }
106 # Rules to clean extras dirs or files
107 clean_wok()
108 {
109 rm -rf $WOK/$PACKAGE/${PACKAGE}.${VERSION}
110 }