wok view lighttpd-ssl/receipt @ rev 8615

Fix: replace exit 1 by return 1 in receipts (exit broke cook-list function)
author Antoine Bodin <gokhlayeh@slitaz.org>
date Mon Feb 14 19:09:46 2011 +0100 (2011-02-14)
parents d9b4b980292d
children df3ccb15ee3c
line source
1 # SliTaz package receipt.
3 PACKAGE="lighttpd-ssl"
4 VERSION="1.4.28"
5 CATEGORY="network"
6 SHORT_DESC="Fast and light HTTP Web server with SSL support."
7 MAINTAINER="pankso@slitaz.org"
8 DEPENDS="pcre openssl"
9 BUILD_DEPENDS="pcre-dev bzip2-dev openssl-dev"
10 SUGGESTED="lighttpd-modules php perl python"
11 SOURCE="lighttpd"
12 TARBALL="$SOURCE-$VERSION.tar.gz"
13 WEB_SITE="http://www.lighttpd.net/"
14 WGET_URL="http://download.lighttpd.net/lighttpd/releases-1.4.x/$TARBALL"
15 CONFIG_FILES="/etc/lighttpd /etc/ssl/lighttpd"
16 PROVIDE="lighttpd"
17 BASE_MODULES="
18 access
19 accesslog
20 alias
21 cgi
22 dirlisting
23 indexfile
24 staticfile
25 rewrite
26 status
27 userdir"
28 SRC_WANTED="$SOURCE"
30 # Rules to configure and make the package.
31 compile_rules()
32 {
33 cd $src
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 --with-openssl \
42 --prefix=/usr \
43 --libdir=/usr/lib/lighttpd \
44 --mandir=/usr/share/man \
45 $CONFIGURE_ARGS &&
46 make &&
47 make DESTDIR=$PWD/_pkg install
48 }
50 # Rules to gen a SliTaz package suitable for Tazpkg.
51 # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
52 genpkg_rules()
53 {
54 mkdir -p $fs/usr
55 #cp -a $_pkg/usr/bin $fs/usr
56 cp -a $_pkg/usr/sbin $fs/usr
58 # Modules.
59 mkdir -p $fs/usr/lib/lighttpd
60 for module in $BASE_MODULES
61 do
62 cp $_pkg/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd
63 echo -n "Copying : mod_${module}.so" && status
64 done
66 # Server root and config file.
67 cp -a stuff/var $fs
68 cp -a stuff/etc $fs
69 chown -R 0.0 $fs/var/www
70 chown -R 0.0 $fs/etc
71 mkdir -p $fs/etc/ssl/lighttpd
72 cat >> $fs/etc/lighttpd/lighttpd.conf <<EOT
74 # Enable HTTPS support
75 #
76 \$SERVER["socket"] == ":443" {
77 protocol = "https://"
78 ssl.engine = "enable"
79 ssl.pemfile = "/etc/ssl/lighttpd/lighttpd.pem"
80 }
81 EOT
83 # Logs directory.
84 mkdir -p $fs/var/log/lighttpd
85 chown 80.80 $fs/var/log/lighttpd
86 }
88 # Pre and post install commands for Tazpkg.
89 # We stop the server by default in case of upgarde.
90 pre_install()
91 {
92 echo "Processing pre-install commands..."
93 [ -f /etc/init.d/lighttpd ] && /etc/init.d/lighttpd stop
94 }
96 post_install()
97 {
98 echo "Processing post-install commands..."
99 if [ ! -f $1/etc/ssl/lighttpd/lighttpd.pem ]; then
100 openssl req -new -x509 \
101 -keyout $1/etc/ssl/lighttpd/lighttpd.pem \
102 -out $1/etc/ssl/lighttpd/lighttpd.pem \
103 -days 3650 -nodes <<EOT
104 $(. /etc/locale.conf ; echo ${LANG#*_})
105 $(cat /etc/TZ)
107 $(cat /etc/hostname)
111 EOT
112 fi
113 # Just in case.
114 chown www.www $1/var/log/lighttpd
115 if [ -z "$1" ]; then
116 for i in apache ; do
117 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
118 done
119 /etc/init.d/lighttpd start
120 fi
121 }