wok view lighttpd-ssl/receipt @ rev 15379

Add some licenses
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Oct 20 22:08:25 2013 +0000 (2013-10-20)
parents 6035b94b5dd0
children eb8067417980
line source
1 # SliTaz package receipt.
3 PACKAGE="lighttpd-ssl"
4 VERSION="1.4.30"
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.gz"
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 if [ ! done.fastcgi_detach.patch ]; then
36 patch -i $WOK/$SOURCE/stuff/fastcgi_detach.patch || return 1
37 touch done.fastcgi_detach.patch
38 fi
39 ./configure \
40 --enable-shared \
41 --disable-ipv6 \
42 --with-openssl \
43 --prefix=/usr \
44 --libdir=/usr/lib/lighttpd \
45 --mandir=/usr/share/man \
46 $CONFIGURE_ARGS &&
47 make &&
48 make DESTDIR=$PWD/_pkg install
49 }
51 # Rules to gen a SliTaz package suitable for Tazpkg.
52 # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
53 genpkg_rules()
54 {
55 mkdir -p $fs/usr
56 #cp -a $_pkg/usr/bin $fs/usr
57 cp -a $_pkg/usr/sbin $fs/usr
59 # Modules.
60 mkdir -p $fs/usr/lib/lighttpd
61 for module in $BASE_MODULES
62 do
63 cp $_pkg/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd
64 echo -n "Copying : mod_${module}.so" && status
65 done
67 # Server root and config file.
68 cp -a $WOK/$SOURCE/stuff/var $fs
69 cp -a $WOK/$SOURCE/stuff/etc $fs
70 chown -R 0.0 $fs/var/www
71 chown -R 0.0 $fs/etc
72 mkdir -p $fs/etc/ssl/lighttpd
73 cat >> $fs/etc/lighttpd/lighttpd.conf <<EOT
75 # Enable HTTPS support
76 #
77 \$SERVER["socket"] == ":443" {
78 protocol = "https://"
79 ssl.engine = "enable"
80 ssl.pemfile = "/etc/ssl/lighttpd/lighttpd.pem"
81 }
82 EOT
84 # Logs directory.
85 mkdir -p $fs/var/log/lighttpd
86 chown 80.80 $fs/var/log/lighttpd
87 }
89 # Pre and post install commands for Tazpkg.
90 # We stop the server by default in case of upgarde.
91 pre_install()
92 {
93 echo "Processing pre-install commands..."
94 [ -f /etc/init.d/lighttpd ] && /etc/init.d/lighttpd stop
95 }
97 post_install()
98 {
99 echo "Processing post-install commands..."
100 if [ ! -f $1/etc/ssl/lighttpd/lighttpd.pem ]; then
101 openssl req -new -x509 \
102 -keyout $1/etc/ssl/lighttpd/lighttpd.pem \
103 -out $1/etc/ssl/lighttpd/lighttpd.pem \
104 -days 3650 -nodes <<EOT
105 $(. /etc/locale.conf ; echo ${LANG#*_})
106 $(cat /etc/TZ)
108 $(cat /etc/hostname)
112 EOT
113 fi
114 # Just in case.
115 chown www.www $1/var/log/lighttpd
116 if [ -z "$1" ]; then
117 for i in apache ; do
118 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
119 done
120 /etc/init.d/lighttpd start
121 fi
122 }