wok-6.x view lighttpd-ssl/receipt @ rev 2023
Up: edje (0.9.9.050) - Snapshot 2008-09-25
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Thu Jan 08 22:34:22 2009 +0100 (2009-01-08) |
parents | 9009ad93df56 |
children | 505ef4de4664 |
line source
1 # SliTaz package receipt.
3 PACKAGE="lighttpd-ssl"
4 VERSION="1.4.20"
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 WGET_URL="http://mirror.slitaz.org/sources/packages/l/$TARBALL"
16 CONFIG_FILES="/etc/lighttpd /etc/ssl/lighttpd"
17 PROVIDE="lighttpd"
18 BASE_MODULES="
19 access
20 accesslog
21 alias
22 cgi
23 dirlisting
24 indexfile
25 staticfile
26 rewrite
27 status
28 userdir"
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 || exit 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
65 strip -s $fs/usr/bin/*
66 strip -s $fs/usr/sbin/*
67 strip -s $fs/usr/lib/lighttpd/*
69 # Server root and config file.
70 cp -a stuff/var $fs
71 cp -a stuff/etc $fs
72 chown -R 0.0 $fs/var/www
73 chown -R 0.0 $fs/etc
74 mkdir -p $fs/etc/ssl/lighttpd
75 cat >> $fs/etc/lighttpd/lighttpd.conf <<EOT
77 # Enable HTTPS support
78 #
79 \$SERVER["socket"] == ":443" {
80 protocol = "https://"
81 ssl.engine = "enable"
82 ssl.pemfile = "/etc/ssl/lighttpd/lighttpd.pem"
83 }
84 EOT
86 # Logs directory.
87 mkdir -p $fs/var/log/lighttpd
88 chown 80.80 $fs/var/log/lighttpd
89 }
91 # Pre and post install commands for Tazpkg.
92 # We stop the server by default in case of upgarde.
93 pre_install()
94 {
95 echo "Processing pre-install commands..."
96 [ -f /etc/init.d/lighttpd ] && /etc/init.d/lighttpd stop
97 }
99 post_install()
100 {
101 echo "Processing post-install commands..."
102 if [ ! -f $1/etc/ssl/lighttpd/lighttpd.pem ]; then
103 openssl req -new -x509 \
104 -keyout $1/etc/ssl/lighttpd/lighttpd.pem \
105 -out $1/etc/ssl/lighttpd/lighttpd.pem \
106 -days 3650 -nodes <<EOT
107 $(. /etc/locale.conf ; echo ${LANG#*_})
108 $(cat /etc/TZ)
110 $(cat /etc/hostname)
114 EOT
115 fi
116 # Just in case.
117 chown www.www $1/var/log/lighttpd
118 if [ -z "$1" ]; then
119 for i in apache ; do
120 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
121 done
122 /etc/init.d/$PACKAGE start
123 fi
124 }