wok view lighttpd-ssl/receipt @ rev 17663
Fix: libcap
author | Alexander Medvedev <devl547@gmail.com> |
---|---|
date | Sun Feb 15 12:51:49 2015 +0000 (2015-02-15) |
parents | e6759743694c |
children | 4da6b4009226 |
line source
1 # SliTaz package receipt.
3 PACKAGE="lighttpd-ssl"
4 VERSION="1.4.33"
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-1.4.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 cd $src
37 sed -i '/addrs_left/d' src/mod_extforward.c
38 ./configure \
39 --enable-shared \
40 --disable-ipv6 \
41 --with-openssl \
42 --prefix=/usr \
43 --libdir=/usr/lib/lighttpd \
44 --mandir=/usr/share/man \
45 $CONFIGURE_ARGS &&
46 make &&
47 make DESTDIR=$DESTDIR install
48 }
50 # Rules to gen a SliTaz package suitable for Tazpkg.
51 # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
52 genpkg_rules()
53 {
54 mkdir -p $fs/usr
55 #cp -a $install/usr/bin $fs/usr
56 cp -a $install/usr/sbin $fs/usr
58 # Modules.
59 mkdir -p $fs/usr/lib/lighttpd
60 for module in $BASE_MODULES
61 do
62 cp $install/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd
63 echo -n "Copying : mod_${module}.so" && status
64 done
66 # Server root and config file.
67 cp -a $WOK/$SOURCE/stuff/var $fs
68 cp -a $WOK/$SOURCE/stuff/etc $fs
69 chown -R 0.0 $fs/var/www
70 chown -R 0.0 $fs/etc
71 mkdir -p $fs/etc/ssl/lighttpd
72 cat >> $fs/etc/lighttpd/lighttpd.conf <<EOT
74 # Enable HTTPS support
75 #
76 \$SERVER["socket"] == ":443" {
77 protocol = "https://"
78 ssl.engine = "enable"
79 # Unsafe, see CVE-2014-3566 POODLE
80 ssl.use-sslv2 = "disable"
81 ssl.use-sslv3 = "disable"
82 ssl.pemfile = "/etc/ssl/lighttpd/lighttpd.pem"
83 }
84 EOT
86 # Logs directory.
87 mkdir -p $fs/var/log/lighttpd
88 chown 80.80 $fs/var/log/lighttpd
89 }
91 # Make sur it as cross compile properly
92 testsuite()
93 {
94 readelf -h $install/usr/sbin/lighttpd
95 }
97 # Pre and post install commands for Tazpkg.
98 # We stop the server by default in case of upgarde.
99 pre_install()
100 {
101 echo "Processing pre-install commands..."
102 [ -f /etc/init.d/lighttpd ] && /etc/init.d/lighttpd stop
103 }
105 post_install()
106 {
107 echo "Processing post-install commands..."
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 $(. /etc/locale.conf ; echo ${LANG#*_})
114 $(cat /etc/TZ)
116 $(cat /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 }