wok view lighttpd-ssl/receipt @ rev 11999

openssh: Gen ecdsa key if not exist
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Sun Mar 04 23:00:55 2012 +0100 (2012-03-04)
parents cab40ed8020d
children 2a5cc8208d36
line source
1 # SliTaz package receipt.
3 PACKAGE="lighttpd-ssl"
4 VERSION="1.4.30"
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/vhosts.conf /etc/lighttpd/lighttpd.conf /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 $WOK/$SOURCE/stuff/fastcgi_detach.patch || return 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
65 # Server root and config file.
66 cp -a $WOK/$SOURCE/stuff/var $fs
67 cp -a $WOK/$SOURCE/stuff/etc $fs
68 chown -R 0.0 $fs/var/www
69 chown -R 0.0 $fs/etc
70 mkdir -p $fs/etc/ssl/lighttpd
71 cat >> $fs/etc/lighttpd/lighttpd.conf <<EOT
73 # Enable HTTPS support
74 #
75 \$SERVER["socket"] == ":443" {
76 protocol = "https://"
77 ssl.engine = "enable"
78 ssl.pemfile = "/etc/ssl/lighttpd/lighttpd.pem"
79 }
80 EOT
82 # Logs directory.
83 mkdir -p $fs/var/log/lighttpd
84 chown 80.80 $fs/var/log/lighttpd
85 }
87 # Pre and post install commands for Tazpkg.
88 # We stop the server by default in case of upgarde.
89 pre_install()
90 {
91 echo "Processing pre-install commands..."
92 [ -f /etc/init.d/lighttpd ] && /etc/init.d/lighttpd stop
93 }
95 post_install()
96 {
97 echo "Processing post-install commands..."
98 if [ ! -f $1/etc/ssl/lighttpd/lighttpd.pem ]; then
99 openssl req -new -x509 \
100 -keyout $1/etc/ssl/lighttpd/lighttpd.pem \
101 -out $1/etc/ssl/lighttpd/lighttpd.pem \
102 -days 3650 -nodes <<EOT
103 $(. /etc/locale.conf ; echo ${LANG#*_})
104 $(cat /etc/TZ)
106 $(cat /etc/hostname)
110 EOT
111 fi
112 # Just in case.
113 chown www.www $1/var/log/lighttpd
114 if [ -z "$1" ]; then
115 for i in apache ; do
116 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
117 done
118 /etc/init.d/lighttpd start
119 fi
120 }