wok-current view lighttpd/receipt @ rev 15575

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