wok-next view lighttpd-ssl/receipt @ rev 15714
Add util-linux-eject
author | Richard Dunbar <mojo@slitaz.org> |
---|---|
date | Tue Dec 24 22:10:59 2013 +0000 (2013-12-24) |
parents | 2a5cc8208d36 |
children | ade0043b3fac |
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 BASE_MODULES="
17 access
18 accesslog
19 alias
20 cgi
21 dirlisting
22 indexfile
23 staticfile
24 rewrite
25 status
26 userdir"
28 DEPENDS="pcre openssl"
29 BUILD_DEPENDS="pcre-dev bzip2-dev openssl-dev"
31 # Rules to configure and make the package.
32 compile_rules()
33 {
34 cd $src
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
59 do
60 cp $install/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd
61 echo -n "Copying : mod_${module}.so" && status
62 done
64 # Server root and config file.
65 cp -a $WOK/$SOURCE/stuff/var $fs
66 cp -a $WOK/$SOURCE/stuff/etc $fs
67 chown -R 0.0 $fs/var/www
68 chown -R 0.0 $fs/etc
69 mkdir -p $fs/etc/ssl/lighttpd
70 cat >> $fs/etc/lighttpd/lighttpd.conf <<EOT
72 # Enable HTTPS support
73 #
74 \$SERVER["socket"] == ":443" {
75 protocol = "https://"
76 ssl.engine = "enable"
77 ssl.pemfile = "/etc/ssl/lighttpd/lighttpd.pem"
78 }
79 EOT
81 # Logs directory.
82 mkdir -p $fs/var/log/lighttpd
83 chown 80.80 $fs/var/log/lighttpd
84 }
86 # Pre and post install commands for Tazpkg.
87 # We stop the server by default in case of upgarde.
88 pre_install()
89 {
90 echo "Processing pre-install commands..."
91 [ -f /etc/init.d/lighttpd ] && /etc/init.d/lighttpd stop
92 }
94 post_install()
95 {
96 echo "Processing post-install commands..."
97 if [ ! -f $1/etc/ssl/lighttpd/lighttpd.pem ]; then
98 openssl req -new -x509 \
99 -keyout $1/etc/ssl/lighttpd/lighttpd.pem \
100 -out $1/etc/ssl/lighttpd/lighttpd.pem \
101 -days 3650 -nodes <<EOT
102 $(. /etc/locale.conf ; echo ${LANG#*_})
103 $(cat /etc/TZ)
105 $(cat /etc/hostname)
109 EOT
110 fi
111 # Just in case.
112 chown www.www $1/var/log/lighttpd
113 if [ -z "$1" ]; then
114 for i in apache ; do
115 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
116 done
117 /etc/init.d/lighttpd start
118 fi
119 }