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

ARM: some more Xorg packages needed to build xorg-server-light
author Christophe Lincoln <pankso@slitaz.org>
date Sun Mar 09 03:09:11 2014 +0100 (2014-03-09)
parents ade0043b3fac
children f2bdc266fba2
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 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 echo "Processing pre-install commands..."
99 [ -f /etc/init.d/lighttpd ] && /etc/init.d/lighttpd stop
100 }
102 post_install()
103 {
104 echo "Processing post-install commands..."
105 if [ ! -f $1/etc/ssl/lighttpd/lighttpd.pem ]; then
106 openssl req -new -x509 \
107 -keyout $1/etc/ssl/lighttpd/lighttpd.pem \
108 -out $1/etc/ssl/lighttpd/lighttpd.pem \
109 -days 3650 -nodes <<EOT
110 $(. /etc/locale.conf ; echo ${LANG#*_})
111 $(cat /etc/TZ)
113 $(cat /etc/hostname)
117 EOT
118 fi
119 # Just in case.
120 chown www.www $1/var/log/lighttpd
121 if [ -z "$1" ]; then
122 for i in apache ; do
123 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
124 done
125 /etc/init.d/lighttpd start
126 fi
127 }