wok-stable annotate lighttpd-ssl/receipt @ rev 2675

Up: ffmpeg and add compile options for small size
author Rohit Joshi <jozee@slitaz.org>
date Tue Apr 21 12:40:38 2009 +0000 (2009-04-21)
parents ac3025c2f81a
children 872f24fa4b75
rev   line source
pascal@1787 1 # SliTaz package receipt.
pascal@1787 2
pascal@1787 3 PACKAGE="lighttpd-ssl"
pankso@2411 4 VERSION="1.4.22"
pascal@1787 5 CATEGORY="network"
pascal@1787 6 SHORT_DESC="Fast and light HTTP Web server with SSL support."
pascal@1787 7 MAINTAINER="pankso@slitaz.org"
pascal@1787 8 DEPENDS="pcre openssl"
pascal@1787 9 BUILD_DEPENDS="pcre-dev bzip2-dev openssl-dev"
pascal@1787 10 SUGGESTED="lighttpd-modules php perl python"
pascal@1787 11 SOURCE="lighttpd"
pascal@1787 12 TARBALL="$SOURCE-$VERSION.tar.gz"
pascal@1787 13 WEB_SITE="http://www.lighttpd.net/"
pascal@2413 14 WGET_URL="http://www.lighttpd.net/download/$TARBALL"
pascal@1906 15 CONFIG_FILES="/etc/lighttpd /etc/ssl/lighttpd"
pascal@1787 16 PROVIDE="lighttpd"
pascal@1787 17 BASE_MODULES="
pascal@1787 18 access
pascal@1787 19 accesslog
pascal@1787 20 alias
pascal@1787 21 cgi
pascal@1787 22 dirlisting
pascal@1787 23 indexfile
pascal@1787 24 staticfile
pascal@1787 25 rewrite
pascal@1787 26 status
pascal@1787 27 userdir"
pascal@1787 28
pascal@1787 29 # Rules to configure and make the package.
pascal@1787 30 compile_rules()
pascal@1787 31 {
pascal@1787 32 cd $src
pascal@1787 33 if [ ! done.fastcgi_detach.patch ]; then
pascal@1787 34 patch -i ../stuff/fastcgi_detach.patch || exit 1
pascal@1787 35 touch done.fastcgi_detach.patch
pascal@1787 36 fi
pascal@1787 37 ./configure \
pascal@1787 38 --enable-shared \
pascal@1787 39 --disable-ipv6 \
pascal@1787 40 --with-openssl \
pascal@1787 41 --prefix=/usr \
pascal@1787 42 --libdir=/usr/lib/lighttpd \
pascal@1787 43 --mandir=/usr/share/man \
pascal@1787 44 $CONFIGURE_ARGS &&
pascal@1787 45 make &&
pascal@1787 46 make DESTDIR=$PWD/_pkg install
pascal@1787 47 }
pascal@1787 48
pascal@1787 49 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1787 50 # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
pascal@1787 51 genpkg_rules()
pascal@1787 52 {
pascal@1787 53 mkdir -p $fs/usr
pascal@1787 54 cp -a $_pkg/usr/bin $fs/usr
pascal@1787 55 cp -a $_pkg/usr/sbin $fs/usr
pascal@1787 56
pascal@1787 57 # Modules.
pascal@1787 58 mkdir -p $fs/usr/lib/lighttpd
pascal@1787 59 for module in $BASE_MODULES
pascal@1787 60 do
pascal@1787 61 cp $_pkg/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd
pascal@1787 62 echo -n "Copying : mod_${module}.so" && status
pascal@1787 63 done
pascal@1787 64 strip -s $fs/usr/bin/*
pascal@1787 65 strip -s $fs/usr/sbin/*
pascal@1787 66 strip -s $fs/usr/lib/lighttpd/*
pascal@1787 67
pascal@1787 68 # Server root and config file.
pascal@1787 69 cp -a stuff/var $fs
pascal@1787 70 cp -a stuff/etc $fs
pascal@1787 71 chown -R 0.0 $fs/var/www
pascal@1787 72 chown -R 0.0 $fs/etc
pascal@1790 73 mkdir -p $fs/etc/ssl/lighttpd
pascal@1790 74 cat >> $fs/etc/lighttpd/lighttpd.conf <<EOT
pascal@1789 75
pascal@1789 76 # Enable HTTPS support
pascal@1789 77 #
pascal@1791 78 \$SERVER["socket"] == ":443" {
pascal@1789 79 protocol = "https://"
pascal@1789 80 ssl.engine = "enable"
pascal@1789 81 ssl.pemfile = "/etc/ssl/lighttpd/lighttpd.pem"
pascal@1789 82 }
pascal@1789 83 EOT
pascal@1787 84
pascal@1787 85 # Logs directory.
pascal@1787 86 mkdir -p $fs/var/log/lighttpd
pascal@1787 87 chown 80.80 $fs/var/log/lighttpd
pascal@1787 88 }
pascal@1787 89
pascal@1787 90 # Pre and post install commands for Tazpkg.
pascal@1787 91 # We stop the server by default in case of upgarde.
pascal@1787 92 pre_install()
pascal@1787 93 {
pascal@1787 94 echo "Processing pre-install commands..."
pascal@1788 95 [ -f /etc/init.d/lighttpd ] && /etc/init.d/lighttpd stop
pascal@1787 96 }
pascal@1906 97
pascal@1787 98 post_install()
pascal@1787 99 {
pascal@1787 100 echo "Processing post-install commands..."
pascal@1789 101 if [ ! -f $1/etc/ssl/lighttpd/lighttpd.pem ]; then
pascal@1789 102 openssl req -new -x509 \
pascal@1789 103 -keyout $1/etc/ssl/lighttpd/lighttpd.pem \
pascal@1789 104 -out $1/etc/ssl/lighttpd/lighttpd.pem \
pascal@1906 105 -days 3650 -nodes <<EOT
pascal@1789 106 $(. /etc/locale.conf ; echo ${LANG#*_})
pascal@1789 107 $(cat /etc/TZ)
pascal@1789 108
pascal@1789 109 $(cat /etc/hostname)
pascal@1789 110
pascal@1789 111
pascal@1789 112
pascal@1789 113 EOT
pascal@1789 114 fi
pascal@1787 115 # Just in case.
pascal@1905 116 chown www.www $1/var/log/lighttpd
pascal@1905 117 if [ -z "$1" ]; then
pascal@1905 118 for i in apache ; do
pascal@1905 119 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
pascal@1905 120 done
erjo@2620 121 /etc/init.d/lighttpd start
pascal@1905 122 fi
pascal@1787 123 }