wok-next view lighttpd-ssl/receipt @ rev 21031
Random updates
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sat Nov 03 15:42:26 2018 +0200 (2018-11-03) |
parents | df20b2110f7e |
children | 1840e5b15cc0 |
line source
1 # SliTaz package receipt v2.
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="devel@slitaz.org"
8 LICENSE="BSD"
9 WEB_SITE="http://www.lighttpd.net/"
10 REPOLOGY="lighttpd"
12 TARBALL="lighttpd-$VERSION.tar.xz"
13 WGET_URL="http://download.lighttpd.net/lighttpd/releases-${VERSION%.*}.x/$TARBALL"
15 BUILD_DEPENDS="pcre-dev bzip2-dev openssl-dev zlib-dev"
17 BASE_MODULES="
18 access
19 accesslog
20 alias
21 cgi
22 dirlisting
23 indexfile
24 staticfile
25 rewrite
26 status
27 userdir"
29 compile_rules() {
30 sed -i '/addrs_left/d' src/mod_extforward.c
32 ./configure \
33 --enable-shared \
34 --disable-ipv6 \
35 --with-openssl \
36 --libdir=/usr/lib/lighttpd \
37 $CONFIGURE_ARGS &&
38 fix libtool &&
39 make &&
40 make DESTDIR=$install install
41 }
43 # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
44 genpkg_rules() {
45 mkdir -p $fs/usr
46 #cp -a $install/usr/bin $fs/usr
47 cp -a $install/usr/sbin $fs/usr
49 # Modules.
50 mkdir -p $fs/usr/lib/lighttpd
51 for module in $BASE_MODULES; do
52 action 'Copying : mod_$module.so'
53 cp $install/usr/lib/lighttpd/mod_$module.so $fs/usr/lib/lighttpd
54 status
55 done
57 # Server root and config file.
58 cp -a $WOK/lighttpd/stuff/etc $fs
59 chown -R 0.0 $fs/etc
60 mkdir -p $fs/etc/ssl/lighttpd
61 cat >> $fs/etc/lighttpd/lighttpd.conf <<EOT
63 # Enable HTTPS support
64 #
65 \$SERVER["socket"] == ":443" {
66 protocol = "https://"
67 ssl.engine = "enable"
68 # Unsafe, see CVE-2014-3566 POODLE
69 ssl.use-sslv2 = "disable"
70 ssl.use-sslv3 = "disable"
71 ssl.pemfile = "/etc/ssl/lighttpd/lighttpd.pem"
72 }
73 EOT
75 # Logs directory.
76 mkdir -p $fs/var/log/lighttpd
77 chown 80.80 $fs/var/log/lighttpd
78 DEPENDS="pcre openssl"
79 PROVIDE="lighttpd"
80 SUGGESTED="lighttpd-modules php perl python"
81 CONFIG_FILES="/etc/lighttpd/vhosts.conf /etc/lighttpd/lighttpd.conf /etc/ssl/lighttpd"
82 }
84 # Make sure it as cross compile properly
85 testsuite() {
86 readelf -h $install/usr/sbin/lighttpd
87 }
89 # We stop the server by default in case of upgarde.
90 pre_install() {
91 [ -z "$1" ] &&
92 for i in httpd lighttpd ngnix apache cherokee lighttpd-ssl; do
93 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
94 done
95 # Backup config file.
96 if [ -d "$1/etc/lighttpd" ]; then
97 cp -a "$1/etc/lighttpd" "$1/etc/lighttpd.bak"
98 fi
99 }
101 post_install() {
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 $(. "$1/etc/locale.conf"; echo ${LANG#*_})
108 $(cat "$1/etc/TZ")
110 $(cat "$1/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/lighttpd start
123 fi
124 }