wok view apache/receipt @ rev 14806

Down tazdrop (4.4)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jul 17 09:36:02 2013 +0200 (2013-07-17)
parents 3341401b7597
children 390a5a938ba6
line source
1 # SliTaz package receipt.
3 PACKAGE="apache"
4 VERSION="2.2.22"
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 --enable-mods-shared=all \
27 --enable-proxy --enable-ssl \
28 --enable-layout=Slitaz $CONFIGURE_ARGS &&
29 make $MAKEFLAGS && make DESTDIR=$DESTDIR install
30 }
32 # Rules to gen a SliTaz package suitable for Tazpkg.
33 genpkg_rules()
34 {
35 mkdir -p $fs/usr/share/apache $fs/etc/init.d $fs/etc/apache/conf.d
36 mkdir -p $fs/etc/ssl/apache
37 cp -a $_pkg/usr/share/apache/icons $fs/usr/share/apache
38 cp -a $_pkg/usr/share/apache/error $fs/usr/share/apache
39 cp -a $_pkg/usr/share/apache/modules $fs/usr/share/apache
40 cp -a $_pkg/usr/bin $fs/usr
41 rm -r $fs/usr/bin/apxs
42 cp -a $_pkg/etc $fs
43 rm -rf $fs/etc/apache/original
44 cp -a $_pkg/var $fs
46 cp -a $stuff/apache $fs/etc/init.d
47 mkdir -p $fs/etc/apache/extra
48 cp -a $stuff/fix-range-CVE-2011-3192.conf $fs/etc/apache/extra
50 sed -i -e 's|User daemon|User www|' -e 's|Group daemon|Group www|' \
51 -e 's|ServerAdmin you@example.com|ServerAdmin root@localhost|' \
52 -e 's|#Include /etc/apache/extra/httpd-ssl.conf|Include /etc/apache/extra/httpd-ssl.conf|' \
53 -e 's|/etc/apache/server.crt|/etc/ssl/apache/apache.pem|' \
54 -e 's|/etc/apache/server.key|/etc/ssl/apache/apache.pem|' \
55 $fs/etc/apache/httpd.conf $fs/etc/apache/extra/httpd-ssl.conf
56 echo "Include /etc/apache/conf.d" >> $fs/etc/apache/httpd.conf
57 }
59 # Pre and post install commands for Tazpkg.
60 # We stop the server by default in case of upgarde.
61 pre_install()
62 {
63 echo "Processing pre-install commands..."
64 [ -z "$1" ] && [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop
65 }
67 post_install()
68 {
69 local lang=$(. /etc/locale.conf 2>/dev/null; echo ${LANG#*_})
70 local tz=$(cat /etc/TZ 2>/dev/null)
71 local hostname=$(cat /etc/hostname 2>/dev/null)
72 echo "Processing post-install commands..."
73 # Just in case.
74 chown www.www $1/var/log/$PACKAGE
75 ping -c 2 $(hostname) > /dev/null 2>&1 ||
76 sed -i "s/localhost/$(hostname) localhost/" /etc/hosts
77 [ -s $1/etc/ssl/apache/apache.pem ] ||
78 openssl req -new -x509 -keyout $1/etc/ssl/apache/apache.pem \
79 -out $1/etc/ssl/apache/apache.pem -days 3650 -nodes <<EOT
80 ${lang:-us}
81 ${tz:-UTC}
83 ${hostname:-slitaz}
87 EOT
88 ( cd $1/$INSTALLED/ ; grep -l /etc/apache/conf.d/ */receipt ) | \
89 while read file; do
90 pkg=$(dirname $file)
91 [ "$pkg" = "$PACKAGE" ] && continue
92 echo "Reconfiguring $pkg for $PACKAGE..."
93 tazpkg reconfigure $pkg
94 done
95 if [ -z "$1" ]; then
96 for i in lighttpd ; do
97 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
98 done
99 /etc/init.d/$PACKAGE start
100 fi
101 }
103 # Rules to clean extras dirs or files
104 clean_wok()
105 {
106 rm -rf $WOK/$PACKAGE/${PACKAGE}.${VERSION}
107 }