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

Fix libtool where applicable (a*-f* packages yet); combine collectd* receipts
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Apr 13 07:14:16 2018 +0300 (2018-04-13)
parents 8d3183aefad5
children 5841522533ec
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"
17 DEPENDS="pcre openssl"
18 BUILD_DEPENDS="pcre-dev bzip2-dev openssl-dev zlib-dev"
20 BASE_MODULES="
21 access
22 accesslog
23 alias
24 cgi
25 dirlisting
26 indexfile
27 staticfile
28 rewrite
29 status
30 userdir"
32 # Rules to configure and make the package.
33 compile_rules()
34 {
35 sed -i '/addrs_left/d' src/mod_extforward.c
36 ./configure \
37 --enable-shared \
38 --disable-ipv6 \
39 --with-openssl \
40 --prefix=/usr \
41 --libdir=/usr/lib/lighttpd \
42 --mandir=/usr/share/man \
43 $CONFIGURE_ARGS &&
44 make &&
45 make DESTDIR=$DESTDIR install
46 }
48 # Rules to gen a SliTaz package suitable for Tazpkg.
49 # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
50 genpkg_rules()
51 {
52 mkdir -p $fs/usr
53 #cp -a $install/usr/bin $fs/usr
54 cp -a $install/usr/sbin $fs/usr
56 # Modules.
57 mkdir -p $fs/usr/lib/lighttpd
58 for module in $BASE_MODULES; do
59 action 'Copying : mod_${module}.so'
60 cp $install/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd
61 status
62 done
64 # Server root and config file.
65 cp -a $WOK/$SOURCE/stuff/etc $fs
66 chown -R 0.0 $fs/etc
67 mkdir -p $fs/etc/ssl/lighttpd
68 cat >> $fs/etc/lighttpd/lighttpd.conf <<EOT
70 # Enable HTTPS support
71 #
72 \$SERVER["socket"] == ":443" {
73 protocol = "https://"
74 ssl.engine = "enable"
75 # Unsafe, see CVE-2014-3566 POODLE
76 ssl.use-sslv2 = "disable"
77 ssl.use-sslv3 = "disable"
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 # Make sur it as cross compile properly
88 testsuite()
89 {
90 readelf -h $install/usr/sbin/lighttpd
91 }
93 # Pre and post install commands for Tazpkg.
94 # We stop the server by default in case of upgarde.
95 pre_install()
96 {
97 [ -z "$1" ] && for i in httpd lighttpd ngnix apache cherokee $PACKAGE ; do
98 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
99 done
100 # Backup config file.
101 if [ -d "$1/etc/lighttpd" ]; then
102 cp -a "$1/etc/lighttpd" "$1/etc/lighttpd.bak"
103 fi
104 }
106 post_install()
107 {
108 if [ ! -f "$1/etc/ssl/lighttpd/lighttpd.pem" ]; then
109 openssl req -new -x509 \
110 -keyout "$1/etc/ssl/lighttpd/lighttpd.pem" \
111 -out "$1/etc/ssl/lighttpd/lighttpd.pem" \
112 -days 3650 -nodes <<EOT
113 $(. "$1/etc/locale.conf" ; echo ${LANG#*_})
114 $(cat "$1/etc/TZ")
116 $(cat "$1/etc/hostname")
120 EOT
121 fi
122 # Just in case.
123 chown www.www "$1/var/log/lighttpd"
124 if [ -z "$1" ]; then
125 for i in apache ; do
126 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
127 done
128 /etc/init.d/lighttpd start
129 fi
130 }