wok-4.x view apache/receipt @ rev 12322

get-wfica: update (thanks Carl)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Aug 22 18:22:54 2012 +0200 (2012-08-22)
parents 00b28dc6dcdb
children 8c14102b0ebc
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-ng-uuid expat zlib"
13 BUILD_DEPENDS="apr-util-dev apr-dev openssl-dev sed expat-dev zlib-dev \
14 util-linux-ng-uuid-dev openldap-dev apr-dev bash"
15 CONFIG_FILES="/etc/apache /var/www /etc/ssl/apache"
16 PROVIDE="lighttpd"
17 TAGS="webserver http server"
19 # Rules to configure and make the package.
20 compile_rules()
21 {
22 cd $src
23 grep -q Slitaz config.layout || \
24 cat $stuff/slitaz.layout >> config.layout
25 ./configure --mandir=/usr/share/man --enable-mods-shared=all \
26 --enable-proxy --enable-ssl \
27 --enable-layout=Slitaz $CONFIGURE_ARGS &&
28 make $MAKEFLAGS && make DESTDIR=$PWD/_pkg install
29 }
31 # Rules to gen a SliTaz package suitable for Tazpkg.
32 genpkg_rules()
33 {
34 mkdir -p $fs/usr/share/apache $fs/etc/init.d $fs/etc/apache/conf.d
35 mkdir -p $fs/etc/ssl/apache
36 cp -a $_pkg/usr/share/apache/icons $fs/usr/share/apache
37 cp -a $_pkg/usr/share/apache/error $fs/usr/share/apache
38 cp -a $_pkg/usr/share/apache/modules $fs/usr/share/apache
39 cp -a $_pkg/usr/bin $fs/usr
40 rm -r $fs/usr/bin/apxs
41 cp -a $_pkg/etc $fs
42 rm -rf $fs/etc/apache/original
43 cp -a $_pkg/var $fs
45 cp -a $stuff/apache $fs/etc/init.d
46 mkdir -p $fs/etc/apache/extra
47 cp -a $stuff/fix-range-CVE-2011-3192.conf $fs/etc/apache/extra
49 sed -i -e 's|User daemon|User www|' -e 's|Group daemon|Group www|' \
50 -e 's|ServerAdmin you@example.com|ServerAdmin root@localhost|' \
51 -e 's|#Include /etc/apache/extra/httpd-ssl.conf|Include /etc/apache/extra/httpd-ssl.conf|' \
52 -e 's|/etc/apache/server.crt|/etc/ssl/apache/apache.pem|' \
53 -e 's|/etc/apache/server.key|/etc/ssl/apache/apache.pem|' \
54 $fs/etc/apache/httpd.conf $fs/etc/apache/extra/httpd-ssl.conf
55 echo "Include /etc/apache/conf.d" >> $fs/etc/apache/httpd.conf
56 }
58 # Pre and post install commands for Tazpkg.
59 # We stop the server by default in case of upgarde.
60 pre_install()
61 {
62 echo "Processing pre-install commands..."
63 [ -z "$1" ] && [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop
64 }
66 post_install()
67 {
68 local lang=$(. /etc/locale.conf 2>/dev/null; echo ${LANG#*_})
69 local tz=$(cat /etc/TZ 2>/dev/null)
70 local hostname=$(cat /etc/hostname 2>/dev/null)
71 echo "Processing post-install commands..."
72 # Just in case.
73 chown www.www $1/var/log/$PACKAGE
74 ping -c 2 $(hostname) > /dev/null 2>&1 ||
75 sed -i "s/localhost/$(hostname) localhost/" /etc/hosts
76 [ -s $1/etc/ssl/apache/apache.pem ] ||
77 openssl req -new -x509 -keyout $1/etc/ssl/apache/apache.pem \
78 -out $1/etc/ssl/apache/apache.pem -days 3650 -nodes <<EOT
79 ${lang:-us}
80 ${tz:-UTC}
82 ${hostname:-slitaz}
86 EOT
87 ( cd $1/$INSTALLED/ ; grep -l /etc/apache/conf.d/ */receipt ) | \
88 while read file; do
89 pkg=$(dirname $file)
90 [ "$pkg" = "$PACKAGE" ] && continue
91 echo "Reconfiguring $pkg for $PACKAGE..."
92 tazpkg reconfigure $pkg
93 done
94 if [ -z "$1" ]; then
95 for i in lighttpd ; do
96 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
97 done
98 /etc/init.d/$PACKAGE start
99 fi
100 }
102 # Rules to clean extras dirs or files
103 clean_wok()
104 {
105 rm -rf $WOK/$PACKAGE/${PACKAGE}.${VERSION}
106 }