wok-next view lighttpd/receipt @ rev 15576

lighttpd: fix compile_rules
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Nov 29 08:51:47 2013 +0000 (2013-11-29)
parents 8dc807868225
children 8ebec64e4191
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.xz"
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 sed -i '/addrs_left/d' src/mod_extforward.c
34 if [ ! done.fastcgi_detach.patch ]; then
35 patch -i $stuff/fastcgi_detach.patch || return 1
36 touch done.fastcgi_detach.patch
37 fi
38 ./configure \
39 --enable-shared \
40 --disable-ipv6 \
41 --prefix=/usr \
42 --libdir=/usr/lib/lighttpd \
43 --mandir=/usr/share/man \
44 $CONFIGURE_ARGS &&
45 make &&
46 make DESTDIR=$PWD/_pkg install
47 }
49 # Rules to gen a SliTaz package suitable for Tazpkg.
50 # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
51 genpkg_rules()
52 {
53 mkdir -p $fs/usr
54 #cp -a $_pkg/usr/bin $fs/usr
55 cp -a $_pkg/usr/sbin $fs/usr
57 # Modules.
58 mkdir -p $fs/usr/lib/lighttpd
59 for module in $BASE_MODULES
60 do
61 cp $_pkg/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd
62 echo -n "Copying : mod_${module}.so" && status
63 done
65 # Server root and config file.
66 cp -a $stuff/var $fs
67 cp -a $stuff/etc $fs
68 chown -R 0.0 $fs/var/www
69 chown -R 0.0 $fs/etc
71 # Logs directory.
72 mkdir -p $fs/var/log/lighttpd
73 chown 80.80 $fs/var/log/lighttpd
74 }
76 # Pre and post install commands for Tazpkg.
77 # We stop the server by default in case of upgarde.
78 pre_install()
79 {
80 echo "Processing pre-install commands..."
81 [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop
82 # Backup config file.
83 if [ -d $1/etc/lighttpd ]; then
84 cp -a $1/etc/lighttpd $1/etc/lighttpd.bak
85 fi
86 }
87 post_install()
88 {
89 echo "Processing post-install commands..."
90 # Restore original config.
91 if [ -d $1/etc/lighttpd.bak ]; then
92 rm -rf $1/etc/lighttpd
93 mv $1/etc/lighttpd.bak $1/etc/lighttpd
94 fi
95 # Just in case.
96 chown www.www $1/var/log/$PACKAGE
97 if [ -z "$1" ]; then
98 for i in apache httpd; do
99 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
100 done
101 /etc/init.d/$PACKAGE start
102 fi
103 }