wok view lighttpd/receipt @ rev 2411

Up: lighttpd (1.4.22) - Regressions fix
author Christophe Lincoln <pankso@slitaz.org>
date Tue Mar 10 11:36:32 2009 +0100 (2009-03-10)
parents 30f6e2ccf326
children ac3025c2f81a
line source
1 # SliTaz package receipt.
3 PACKAGE="lighttpd"
4 VERSION="1.4.22"
5 CATEGORY="network"
6 SHORT_DESC="Fast and light HTTP Web server."
7 MAINTAINER="pankso@slitaz.org"
8 DEPENDS="pcre"
9 BUILD_DEPENDS="pcre-dev bzip2-dev"
10 SUGGESTED="lighttpd-modules php perl python"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WEB_SITE="http://www.lighttpd.net/"
13 #WGET_URL="http://www.lighttpd.net/download/$TARBALL"
14 WGET_URL="http://mirror.slitaz.org/sources/packages/l/$TARBALL"
15 CONFIG_FILES="/etc/lighttpd"
16 BASE_MODULES="
17 access
18 accesslog
19 alias
20 cgi
21 dirlisting
22 indexfile
23 staticfile
24 rewrite
25 status
26 userdir"
28 # Rules to configure and make the package.
29 compile_rules()
30 {
31 cd $src
32 if [ ! done.fastcgi_detach.patch ]; then
33 patch -i ../stuff/fastcgi_detach.patch || exit 1
34 touch done.fastcgi_detach.patch
35 fi
36 ./configure \
37 --enable-shared \
38 --disable-ipv6 \
39 --prefix=/usr \
40 --libdir=/usr/lib/lighttpd \
41 --mandir=/usr/share/man \
42 $CONFIGURE_ARGS &&
43 make &&
44 make DESTDIR=$PWD/_pkg install
45 }
47 # Rules to gen a SliTaz package suitable for Tazpkg.
48 # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
49 genpkg_rules()
50 {
51 mkdir -p $fs/usr
52 cp -a $_pkg/usr/bin $fs/usr
53 cp -a $_pkg/usr/sbin $fs/usr
55 # Modules.
56 mkdir -p $fs/usr/lib/lighttpd
57 for module in $BASE_MODULES
58 do
59 cp $_pkg/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd
60 echo -n "Copying : mod_${module}.so" && status
61 done
63 # Server root and config file.
64 cp -a stuff/var $fs
65 cp -a stuff/etc $fs
66 chown -R 0.0 $fs/var/www
67 chown -R 0.0 $fs/etc
69 # Logs directory.
70 mkdir -p $fs/var/log/lighttpd
71 chown 80.80 $fs/var/log/lighttpd
72 }
74 # Pre and post install commands for Tazpkg.
75 # We stop the server by default in case of upgarde.
76 pre_install()
77 {
78 echo "Processing pre-install commands..."
79 [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop
80 # Backup config file.
81 if [ -d $1/$CONFIG_FILES ]; then
82 cp -a $1/$CONFIG_FILES $1/$CONFIG_FILES.bak
83 fi
84 }
85 post_install()
86 {
87 echo "Processing post-install commands..."
88 # Restore original config.
89 if [ -d $1/$CONFIG_FILES.bak ]; then
90 rm -rf $1/$CONFIG_FILES
91 mv $1/$CONFIG_FILES.bak $1/$CONFIG_FILES
92 fi
93 # Just in case.
94 chown www.www $1/var/log/$PACKAGE
95 if [ -z "$1" ]; then
96 for i in apache ; do
97 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
98 done
99 /etc/init.d/$PACKAGE start
100 fi
101 }