wok-6.x view apache/receipt @ rev 1658

Apache: may update /etc/hosts
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Nov 08 13:47:59 2008 +0000 (2008-11-08)
parents 295bc93ddcc2
children d699aa373d79
line source
1 # SliTaz package receipt.
3 PACKAGE="apache"
4 VERSION="2.2.9"
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"
13 BUILD_DEPENDS="apr-util-dev apr-dev"
14 CONFIG_FILES="/etc/apache /var/www"
15 PROVIDE="lighttpd"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 ln -s $SOURCE-$VERSION $PACKAGE-$VERSION
21 cd $src
22 grep -q Slitaz config.layout || \
23 cat ../stuff/slitaz.layout >> config.layout
24 ./configure --mandir=/usr/share/man --enable-mods-shared=all \
25 --enable-layout=Slitaz $CONFIGURE_ARGS &&
26 make && make DESTDIR=$PWD/_pkg install
27 }
29 # Rules to gen a SliTaz package suitable for Tazpkg.
30 genpkg_rules()
31 {
32 mkdir -p $fs/usr/share/apache $fs/etc/init.d $fs/etc/apache/conf.d
33 cp -a $_pkg/usr/share/apache/icons $fs/usr/share/apache
34 cp -a $_pkg/usr/share/apache/error $fs/usr/share/apache
35 cp -a $_pkg/usr/share/apache/modules $fs/usr/share/apache
36 cp -a $_pkg/usr/bin $fs/usr
37 rm -r $fs/usr/bin/apxs
38 cp -a $_pkg/etc $fs
39 cp -a $_pkg/var $fs
40 ln -s /usr/bin/apachectl $fs/etc/init.d/apache
41 sed -i -e 's|User daemon|User www|' -e 's|Group daemon|Group www|' \
42 -e 's|ServerAdmin you@example.com|ServerAdmin root@localhost|' \
43 $fs/etc/apache/httpd.conf
44 echo "Include /etc/apache/conf.d" >> $fs/etc/apache/httpd.conf
45 # Cook all packages based on apache
46 for i in $(cd $WOK; ls -d apache-*)
47 do
48 tazwok genpkg $i
49 done
50 }
52 # Pre and post install commands for Tazpkg.
53 # We stop the server by default in case of upgarde.
54 pre_install()
55 {
56 echo "Processing pre-install commands..."
57 [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop
58 }
60 post_install()
61 {
62 echo "Processing post-install commands..."
63 # Just in case.
64 chown www.www $1/var/log/$PACKAGE
65 ping -c 2 $(hostname) > /dev/null 2>&1 ||
66 sed -i "s/localhost/$(hostname) localhost/" /etc/hosts
67 /etc/init.d/$PACKAGE start
68 }
70 # Rules to clean extras dirs or files
71 clean_wok()
72 {
73 rm -rf $WOK/$PACKAGE/${PACKAGE}.${VERSION}
74 }