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

Remove redundant messages in {pre|post}_{install|remove}() in random packages
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Dec 21 02:53:09 2015 +0200 (2015-12-21)
parents 9e01bc6321ea
children 3630f18392bd
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"
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 sed -i '/addrs_left/d' src/mod_extforward.c
37 ./configure \
38 --enable-shared \
39 --disable-ipv6 \
40 --with-openssl \
41 --prefix=/usr \
42 --libdir=/usr/lib/lighttpd \
43 --mandir=/usr/share/man \
44 $CONFIGURE_ARGS &&
45 make &&
46 make DESTDIR=$DESTDIR install
47 }
49 # Rules to gen a SliTaz package suitable for Tazpkg.
50 # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
51 genpkg_rules()
52 {
53 mkdir -p $fs/usr
54 #cp -a $install/usr/bin $fs/usr
55 cp -a $install/usr/sbin $fs/usr
57 # Modules.
58 mkdir -p $fs/usr/lib/lighttpd
59 for module in $BASE_MODULES; do
60 action 'Copying : mod_${module}.so'
61 cp $install/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd
62 status
63 done
65 # Server root and config file.
66 cp -a $WOK/$SOURCE/stuff/etc $fs
67 chown -R 0.0 $fs/etc
68 mkdir -p $fs/etc/ssl/lighttpd
69 cat >> $fs/etc/lighttpd/lighttpd.conf <<EOT
71 # Enable HTTPS support
72 #
73 \$SERVER["socket"] == ":443" {
74 protocol = "https://"
75 ssl.engine = "enable"
76 # Unsafe, see CVE-2014-3566 POODLE
77 ssl.use-sslv2 = "disable"
78 ssl.use-sslv3 = "disable"
79 ssl.pemfile = "/etc/ssl/lighttpd/lighttpd.pem"
80 }
81 EOT
83 # Logs directory.
84 mkdir -p $fs/var/log/lighttpd
85 chown 80.80 $fs/var/log/lighttpd
86 }
88 # Make sur it as cross compile properly
89 testsuite()
90 {
91 readelf -h $install/usr/sbin/lighttpd
92 }
94 # Pre and post install commands for Tazpkg.
95 # We stop the server by default in case of upgarde.
96 pre_install()
97 {
98 [ -f /etc/init.d/lighttpd ] && /etc/init.d/lighttpd stop
99 }
101 post_install()
102 {
103 if [ ! -f "$1/etc/ssl/lighttpd/lighttpd.pem" ]; then
104 openssl req -new -x509 \
105 -keyout "$1/etc/ssl/lighttpd/lighttpd.pem" \
106 -out "$1/etc/ssl/lighttpd/lighttpd.pem" \
107 -days 3650 -nodes <<EOT
108 $(. "$1/etc/locale.conf" ; echo ${LANG#*_})
109 $(cat "$1/etc/TZ")
111 $(cat "$1/etc/hostname")
115 EOT
116 fi
117 # Just in case.
118 chown www.www "$1/var/log/lighttpd"
119 if [ -z "$1" ]; then
120 for i in apache ; do
121 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
122 done
123 /etc/init.d/lighttpd start
124 fi
125 }