wok-next view lighttpd-ssl/receipt @ rev 21432

updated rawstudio (1.2 -> 2.0)
author Hans-G?nter Theisgen
date Tue May 05 09:38:29 2020 +0100 (2020-05-05)
parents d5aab818505e
children
line source
1 # SliTaz package receipt v2.
3 PACKAGE="lighttpd-ssl"
4 VERSION="1.4.54"
5 CATEGORY="network"
6 SHORT_DESC="Fast and light HTTP Web server with SSL support"
7 MAINTAINER="maintainer@slitaz.org"
8 LICENSE="BSD"
9 WEB_SITE="https://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="bzip2-dev openssl-dev pcre-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 {
31 sed -i '/addrs_left/d' src/mod_extforward.c
33 ./configure \
34 --enable-shared \
35 --disable-ipv6 \
36 --with-openssl \
37 --libdir=/usr/lib/lighttpd \
38 $CONFIGURE_ARGS &&
39 fix libtool &&
40 make &&
41 make DESTDIR=$install install
42 }
44 # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
45 genpkg_rules()
46 {
47 mkdir -p $fs/usr
49 #cp -a $install/usr/bin $fs/usr
50 cp -a $install/usr/sbin $fs/usr
52 # Modules.
53 mkdir -p $fs/usr/lib/lighttpd
54 for module in $BASE_MODULES
55 do
56 action 'Copying : mod_$module.so'
57 cp $install/usr/lib/lighttpd/mod_$module.so $fs/usr/lib/lighttpd
58 status
59 done
61 # Server root and configuration file.
62 cp -a $WOK/lighttpd/stuff/etc $fs
63 chown -R 0.0 $fs/etc
64 mkdir -p $fs/etc/ssl/lighttpd
65 cat >> $fs/etc/lighttpd/lighttpd.conf <<EOT
67 # Enable HTTPS support
68 #
69 \$SERVER["socket"] == ":443" {
70 protocol = "https://"
71 ssl.engine = "enable"
72 # Unsafe, see CVE-2014-3566 POODLE
73 ssl.use-sslv2 = "disable"
74 ssl.use-sslv3 = "disable"
75 ssl.pemfile = "/etc/ssl/lighttpd/lighttpd.pem"
76 }
77 EOT
79 # Logs directory.
80 mkdir -p $fs/var/log/lighttpd
81 chown 80.80 $fs/var/log/lighttpd
82 DEPENDS="openssl pcre"
83 PROVIDE="lighttpd"
84 SUGGESTED="lighttpd-modules php perl python"
85 CONFIG_FILES="/etc/lighttpd/vhosts.conf /etc/lighttpd/lighttpd.conf /etc/ssl/lighttpd"
86 }
88 # Make sure it as cross compile properly
89 testsuite()
90 {
91 readelf -h $install/usr/sbin/lighttpd
92 }
94 # We stop the server by default in case of upgarde.
95 pre_install()
96 {
97 [ -z "$1" ] &&
98 for i in httpd lighttpd ngnix apache cherokee lighttpd-ssl
99 do
100 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
101 done
102 # Backup configuration file.
103 if [ -d "$1/etc/lighttpd" ]
104 then
105 cp -a "$1/etc/lighttpd" "$1/etc/lighttpd.bak"
106 fi
107 }
109 post_install()
110 {
111 if [ ! -f "$1/etc/ssl/lighttpd/lighttpd.pem" ]
112 then
113 openssl req -new -x509 \
114 -keyout "$1/etc/ssl/lighttpd/lighttpd.pem" \
115 -out "$1/etc/ssl/lighttpd/lighttpd.pem" \
116 -days 3650 -nodes <<EOT
117 $(. "$1/etc/locale.conf"; echo ${LANG#*_})
118 $(cat "$1/etc/TZ")
120 $(cat "$1/etc/hostname")
124 EOT
125 fi
127 # Just in case.
128 chown www.www "$1/var/log/lighttpd"
129 if [ -z "$1" ]
130 then
131 for i in apache
132 do
133 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
134 done
135 /etc/init.d/lighttpd start
136 fi
137 }