wok-6.x view lighttpd-ssl/receipt @ rev 2773

Up: mysql (5.0.77) [security update]
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Apr 27 09:13:11 2009 +0200 (2009-04-27)
parents ac3025c2f81a
children 872f24fa4b75
line source
1 # SliTaz package receipt.
3 PACKAGE="lighttpd-ssl"
4 VERSION="1.4.22"
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://www.lighttpd.net/download/$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"
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 || exit 1
35 touch done.fastcgi_detach.patch
36 fi
37 ./configure \
38 --enable-shared \
39 --disable-ipv6 \
40 --with-openssl \
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
64 strip -s $fs/usr/bin/*
65 strip -s $fs/usr/sbin/*
66 strip -s $fs/usr/lib/lighttpd/*
68 # Server root and config file.
69 cp -a stuff/var $fs
70 cp -a stuff/etc $fs
71 chown -R 0.0 $fs/var/www
72 chown -R 0.0 $fs/etc
73 mkdir -p $fs/etc/ssl/lighttpd
74 cat >> $fs/etc/lighttpd/lighttpd.conf <<EOT
76 # Enable HTTPS support
77 #
78 \$SERVER["socket"] == ":443" {
79 protocol = "https://"
80 ssl.engine = "enable"
81 ssl.pemfile = "/etc/ssl/lighttpd/lighttpd.pem"
82 }
83 EOT
85 # Logs directory.
86 mkdir -p $fs/var/log/lighttpd
87 chown 80.80 $fs/var/log/lighttpd
88 }
90 # Pre and post install commands for Tazpkg.
91 # We stop the server by default in case of upgarde.
92 pre_install()
93 {
94 echo "Processing pre-install commands..."
95 [ -f /etc/init.d/lighttpd ] && /etc/init.d/lighttpd stop
96 }
98 post_install()
99 {
100 echo "Processing post-install commands..."
101 if [ ! -f $1/etc/ssl/lighttpd/lighttpd.pem ]; then
102 openssl req -new -x509 \
103 -keyout $1/etc/ssl/lighttpd/lighttpd.pem \
104 -out $1/etc/ssl/lighttpd/lighttpd.pem \
105 -days 3650 -nodes <<EOT
106 $(. /etc/locale.conf ; echo ${LANG#*_})
107 $(cat /etc/TZ)
109 $(cat /etc/hostname)
113 EOT
114 fi
115 # Just in case.
116 chown www.www $1/var/log/lighttpd
117 if [ -z "$1" ]; then
118 for i in apache ; do
119 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
120 done
121 /etc/init.d/lighttpd start
122 fi
123 }