wok view lighttpd-ssl/receipt @ rev 18444

Add stfl
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Sep 26 14:04:09 2015 +0200 (2015-09-26)
parents d3eb5f4b53ea
children 9e01bc6321ea
line source
1 # SliTaz package receipt.
3 PACKAGE="lighttpd-ssl"
4 VERSION="1.4.35"
5 CATEGORY="network"
6 SHORT_DESC="Fast and light HTTP Web server with SSL support."
7 MAINTAINER="pankso@slitaz.org"
8 LICENSE="BSD"
9 SUGGESTED="lighttpd-modules php perl python"
10 SOURCE="lighttpd"
11 TARBALL="$SOURCE-$VERSION.tar.xz"
12 WEB_SITE="http://www.lighttpd.net/"
13 WGET_URL="http://download.lighttpd.net/lighttpd/releases-${VERSION%.*}.x/$TARBALL"
14 CONFIG_FILES="/etc/lighttpd/vhosts.conf /etc/lighttpd/lighttpd.conf /etc/ssl/lighttpd"
15 PROVIDE="lighttpd"
16 HOST_ARCH="i486 arm"
18 DEPENDS="pcre openssl"
19 BUILD_DEPENDS="pcre-dev bzip2-dev openssl-dev"
21 BASE_MODULES="
22 access
23 accesslog
24 alias
25 cgi
26 dirlisting
27 indexfile
28 staticfile
29 rewrite
30 status
31 userdir"
33 # Rules to configure and make the package.
34 compile_rules()
35 {
36 sed -i '/addrs_left/d' src/mod_extforward.c
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=$DESTDIR 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 $install/usr/bin $fs/usr
55 cp -a $install/usr/sbin $fs/usr
57 # Modules.
58 mkdir -p $fs/usr/lib/lighttpd
59 for module in $BASE_MODULES
60 do
61 cp $install/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/etc $fs
67 chown -R 0.0 $fs/etc
68 mkdir -p $fs/etc/ssl/lighttpd
69 cat >> $fs/etc/lighttpd/lighttpd.conf <<EOT
71 # Enable HTTPS support
72 #
73 \$SERVER["socket"] == ":443" {
74 protocol = "https://"
75 ssl.engine = "enable"
76 # Unsafe, see CVE-2014-3566 POODLE
77 ssl.use-sslv2 = "disable"
78 ssl.use-sslv3 = "disable"
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 # Make sur it as cross compile properly
89 testsuite()
90 {
91 readelf -h $install/usr/sbin/lighttpd
92 }
94 # Pre and post install commands for Tazpkg.
95 # We stop the server by default in case of upgarde.
96 pre_install()
97 {
98 echo "Processing pre-install commands..."
99 [ -f /etc/init.d/lighttpd ] && /etc/init.d/lighttpd stop
100 }
102 post_install()
103 {
104 echo "Processing post-install commands..."
105 if [ ! -f $1/etc/ssl/lighttpd/lighttpd.pem ]; then
106 openssl req -new -x509 \
107 -keyout $1/etc/ssl/lighttpd/lighttpd.pem \
108 -out $1/etc/ssl/lighttpd/lighttpd.pem \
109 -days 3650 -nodes <<EOT
110 $(. /etc/locale.conf ; echo ${LANG#*_})
111 $(cat /etc/TZ)
113 $(cat /etc/hostname)
117 EOT
118 fi
119 # Just in case.
120 chown www.www $1/var/log/lighttpd
121 if [ -z "$1" ]; then
122 for i in apache ; do
123 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
124 done
125 /etc/init.d/lighttpd start
126 fi
127 }