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

gpgme: add gnupg, since build can not find gpgconf and gpg
author Erkan Yilmaz <erkan@slitaz.org>
date Sat Jun 09 07:02:52 2018 +0000 (2018-06-09)
parents c4e53a39395a
children df20b2110f7e
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="pankso@slitaz.org"
8 LICENSE="BSD"
9 WEB_SITE="http://www.lighttpd.net/"
11 TARBALL="lighttpd-$VERSION.tar.xz"
12 WGET_URL="http://download.lighttpd.net/lighttpd/releases-${VERSION%.*}.x/$TARBALL"
14 BUILD_DEPENDS="pcre-dev bzip2-dev openssl-dev zlib-dev"
16 BASE_MODULES="
17 access
18 accesslog
19 alias
20 cgi
21 dirlisting
22 indexfile
23 staticfile
24 rewrite
25 status
26 userdir"
28 compile_rules() {
29 sed -i '/addrs_left/d' src/mod_extforward.c
31 ./configure \
32 --enable-shared \
33 --disable-ipv6 \
34 --with-openssl \
35 --libdir=/usr/lib/lighttpd \
36 $CONFIGURE_ARGS &&
37 fix libtool &&
38 make &&
39 make DESTDIR=$DESTDIR install
40 }
42 # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
43 genpkg_rules() {
44 mkdir -p $fs/usr
45 #cp -a $install/usr/bin $fs/usr
46 cp -a $install/usr/sbin $fs/usr
48 # Modules.
49 mkdir -p $fs/usr/lib/lighttpd
50 for module in $BASE_MODULES; do
51 action 'Copying : mod_${module}.so'
52 cp $install/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd
53 status
54 done
56 # Server root and config file.
57 cp -a $WOK/lighttpd/stuff/etc $fs
58 chown -R 0.0 $fs/etc
59 mkdir -p $fs/etc/ssl/lighttpd
60 cat >> $fs/etc/lighttpd/lighttpd.conf <<EOT
62 # Enable HTTPS support
63 #
64 \$SERVER["socket"] == ":443" {
65 protocol = "https://"
66 ssl.engine = "enable"
67 # Unsafe, see CVE-2014-3566 POODLE
68 ssl.use-sslv2 = "disable"
69 ssl.use-sslv3 = "disable"
70 ssl.pemfile = "/etc/ssl/lighttpd/lighttpd.pem"
71 }
72 EOT
74 # Logs directory.
75 mkdir -p $fs/var/log/lighttpd
76 chown 80.80 $fs/var/log/lighttpd
77 DEPENDS="pcre openssl"
78 PROVIDE="lighttpd"
79 SUGGESTED="lighttpd-modules php perl python"
80 CONFIG_FILES="/etc/lighttpd/vhosts.conf /etc/lighttpd/lighttpd.conf /etc/ssl/lighttpd"
81 }
83 # Make sure it as cross compile properly
84 testsuite() {
85 readelf -h $install/usr/sbin/lighttpd
86 }
88 # We stop the server by default in case of upgarde.
89 pre_install() {
90 [ -z "$1" ] && for i in httpd lighttpd ngnix apache cherokee $PACKAGE ; do
91 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
92 done
93 # Backup config file.
94 if [ -d "$1/etc/lighttpd" ]; then
95 cp -a "$1/etc/lighttpd" "$1/etc/lighttpd.bak"
96 fi
97 }
99 post_install()
100 {
101 if [ ! -f "$1/etc/ssl/lighttpd/lighttpd.pem" ]; then
102 openssl req -new -x509 \
103 -keyout "$1/etc/ssl/lighttpd/lighttpd.pem" \
104 -out "$1/etc/ssl/lighttpd/lighttpd.pem" \
105 -days 3650 -nodes <<EOT
106 $(. "$1/etc/locale.conf" ; echo ${LANG#*_})
107 $(cat "$1/etc/TZ")
109 $(cat "$1/etc/hostname")
113 EOT
114 fi
115 # Just in case.
116 chown www.www "$1/var/log/lighttpd"
117 if [ -z "$1" ]; then
118 for i in apache ; do
119 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
120 done
121 /etc/init.d/lighttpd start
122 fi
123 }