wok-4.x view lighttpd/receipt @ rev 12449

lighttpd, mutt: update CONFIG_FILES (thanks emgi)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 08 13:07:27 2015 +0100 (2015-02-08)
parents fd0d0addaaf9
children
line source
1 # SliTaz package receipt.
3 PACKAGE="lighttpd"
4 VERSION="1.4.30"
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 /var/www/index.html /var/www/style.css"
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 || return 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/etc/lighttpd ]; then
82 cp -a $1/etc/lighttpd $1/etc/lighttpd.bak
83 fi
84 }
85 post_install()
86 {
87 echo "Processing post-install commands..."
88 # Restore original config.
89 if [ -d $1/etc/lighttpd.bak ]; then
90 rm -rf $1/etc/lighttpd
91 mv $1/etc/lighttpd.bak $1/etc/lighttpd
92 fi
93 # Just in case.
94 chown www.www $1/var/log/$PACKAGE
95 if [ -z "$1" ]; then
96 for i in apache httpd; do
97 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
98 done
99 /etc/init.d/$PACKAGE start
100 fi
101 }