wok-current view lighttpd-ssl/receipt @ rev 25731
Merge wok for both arch and few updates
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Thu Dec 05 08:28:03 2024 +0000 (2 months ago) |
parents | cdc648e5f1be |
children |
line source
1 # SliTaz package receipt.
3 PACKAGE="lighttpd-ssl"
4 VERSION="1.4.64"
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="https://www.lighttpd.net/"
11 SOURCE="lighttpd"
12 TARBALL="$SOURCE-$VERSION.tar.xz"
13 WGET_URL="https://download.lighttpd.net/$SOURCE/releases-${VERSION%.*}.x/$TARBALL"
15 PROVIDE="lighttpd"
16 SUGGESTED="lighttpd-modules perl php python"
17 DEPENDS="openssl pcre2"
18 BUILD_DEPENDS="bzip2-dev openssl-dev pcre2-dev"
20 CONFIG_FILES="/etc/lighttpd/vhosts.conf /etc/lighttpd/lighttpd.conf /etc/ssl/lighttpd"
22 HOST_ARCH="i486 arm x86_64"
24 BASE_MODULES="
25 access
26 accesslog
27 alias
28 cgi
29 dirlisting
30 indexfile
31 staticfile
32 rewrite
33 status
34 userdir
35 openssl"
37 # What is the latest version available today?
38 current_version()
39 {
40 wget -O - $WEB_SITE 2>/dev/null | \
41 sed "/latest/d;/$SOURCE-[0-9]/!d;/tar/!d;s|.*$SOURCE-\\(.*\\).tar.*|\\1|" | sort -Vr | sed q
42 }
44 # Rules to configure and make the package.
45 compile_rules()
46 {
47 sed -i '/addrs_left/d' src/mod_extforward.c
49 ./configure \
50 --prefix=/usr \
51 --libdir=/usr/lib/lighttpd \
52 --mandir=/usr/share/man \
53 --disable-ipv6 \
54 --with-openssl \
55 --enable-shared \
56 $CONFIGURE_ARGS &&
57 make &&
58 make DESTDIR=$DESTDIR install
59 }
61 # Rules to gen a SliTaz package suitable for Tazpkg.
62 # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
63 genpkg_rules()
64 {
65 mkdir -p $fs/usr
66 #cp -a $install/usr/bin $fs/usr
67 cp -a $install/usr/sbin $fs/usr
69 # Modules.
70 mkdir -p $fs/usr/lib/lighttpd
71 for module in $BASE_MODULES
72 do
73 action "Copying : mod_${module}.so"
74 cp $install/usr/lib/lighttpd/mod_${module}.so \
75 $fs/usr/lib/lighttpd
76 status
77 done
79 # Server root and configuration file.
80 cp -a $WOK/$SOURCE/stuff/etc $fs
81 chown -R 0.0 $fs/etc
82 mkdir -p $fs/etc/ssl/lighttpd
83 cat >> $fs/etc/lighttpd/lighttpd.conf <<EOT
85 # Enable HTTPS support
86 #
87 \$SERVER["socket"] == ":443" {
88 protocol = "https://"
89 ssl.engine = "enable"
90 # Unsafe, see CVE-2014-3566 POODLE
91 ssl.use-sslv2 = "disable"
92 ssl.use-sslv3 = "disable"
93 ssl.pemfile = "/etc/ssl/lighttpd/lighttpd.pem"
94 }
95 EOT
97 # Logs directory.
98 mkdir -p $fs/var/log/lighttpd
99 chown 80.80 $fs/var/log/lighttpd
100 }
102 # Make sure it is cross compiled properly
103 testsuite()
104 {
105 readelf -h $install/usr/sbin/lighttpd
106 }
108 # Pre and post install commands for Tazpkg.
109 # We stop the server by default in case of upgrade.
110 pre_install()
111 {
112 [ -z "$1" ] &&
113 for i in httpd lighttpd ngnix apache cherokee $PACKAGE
114 do
115 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
116 done
118 # Backup configuration file.
119 if [ -d "$1/etc/lighttpd" ]
120 then
121 cp -a "$1/etc/lighttpd" "$1/etc/lighttpd.bak"
122 fi
123 }
125 post_install()
126 {
127 if [ ! -f "$1/etc/ssl/lighttpd/lighttpd.pem" ]
128 then
129 local lang=$(. $1/etc/locale.conf 2>/dev/null; echo ${LANG#*_} | sed 's/.UTF-8//')
130 local tz=$(cat $1/etc/TZ 2>/dev/null)
131 local hostname=$(cat $1/etc/hostname 2>/dev/null)
133 openssl req -new -x509 \
134 -keyout "$1/etc/ssl/lighttpd/lighttpd.pem" \
135 -out "$1/etc/ssl/lighttpd/lighttpd.pem" \
136 -days 3650 -nodes <<EOT
137 ${lang:-US}
138 ${tz:-Somewhere}
142 ${hostname:-slitaz}
144 EOT
145 fi
147 # Just in case.
148 chown www.www "$1/var/log/lighttpd"
149 if [ -z "$1" ]
150 then
151 for i in apache
152 do
153 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
154 done
155 /etc/init.d/lighttpd start
156 fi
157 }