wok view lighttpd/receipt @ rev 11209

Move to wok: seed-dev
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Nov 03 11:23:40 2011 +0100 (2011-11-03)
parents d1768332cee0
children 6035b94b5dd0
line source
1 # SliTaz package receipt.
3 PACKAGE="lighttpd"
4 VERSION="1.4.28"
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://download.lighttpd.net/lighttpd/releases-1.4.x/$TARBALL"
14 CONFIG_FILES="/etc/lighttpd/vhosts.conf /etc/lighttpd/lighttpd.conf"
15 BASE_MODULES="
16 access
17 accesslog
18 alias
19 cgi
20 dirlisting
21 indexfile
22 staticfile
23 rewrite
24 status
25 userdir"
27 # Rules to configure and make the package.
28 compile_rules()
29 {
30 cd $src
31 if [ ! done.fastcgi_detach.patch ]; then
32 patch -i $stuff/fastcgi_detach.patch || return 1
33 touch done.fastcgi_detach.patch
34 fi
35 ./configure \
36 --enable-shared \
37 --disable-ipv6 \
38 --prefix=/usr \
39 --libdir=/usr/lib/lighttpd \
40 --mandir=/usr/share/man \
41 $CONFIGURE_ARGS &&
42 make &&
43 make DESTDIR=$PWD/_pkg install
44 }
46 # Rules to gen a SliTaz package suitable for Tazpkg.
47 # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
48 genpkg_rules()
49 {
50 mkdir -p $fs/usr
51 #cp -a $_pkg/usr/bin $fs/usr
52 cp -a $_pkg/usr/sbin $fs/usr
54 # Modules.
55 mkdir -p $fs/usr/lib/lighttpd
56 for module in $BASE_MODULES
57 do
58 cp $_pkg/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd
59 echo -n "Copying : mod_${module}.so" && status
60 done
62 # Server root and config file.
63 cp -a $stuff/var $fs
64 cp -a $stuff/etc $fs
65 chown -R 0.0 $fs/var/www
66 chown -R 0.0 $fs/etc
68 # Logs directory.
69 mkdir -p $fs/var/log/lighttpd
70 chown 80.80 $fs/var/log/lighttpd
71 }
73 # Pre and post install commands for Tazpkg.
74 # We stop the server by default in case of upgarde.
75 pre_install()
76 {
77 echo "Processing pre-install commands..."
78 [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop
79 # Backup config file.
80 if [ -d $1/$CONFIG_FILES ]; then
81 cp -a $1/$CONFIG_FILES $1/$CONFIG_FILES.bak
82 fi
83 }
84 post_install()
85 {
86 echo "Processing post-install commands..."
87 # Restore original config.
88 if [ -d $1/$CONFIG_FILES.bak ]; then
89 rm -rf $1/$CONFIG_FILES
90 mv $1/$CONFIG_FILES.bak $1/$CONFIG_FILES
91 fi
92 # Just in case.
93 chown www.www $1/var/log/$PACKAGE
94 if [ -z "$1" ]; then
95 for i in apache httpd; do
96 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
97 done
98 /etc/init.d/$PACKAGE start
99 fi
100 }