wok annotate lighttpd-ssl/receipt @ rev 20208
Down busybox (1.27.2)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Feb 23 11:16:33 2018 +0100 (2018-02-23) |
parents | d6ca18366f41 |
children | ea835222df2a |
rev | line source |
---|---|
pascal@1787 | 1 # SliTaz package receipt. |
pascal@1787 | 2 |
pascal@1787 | 3 PACKAGE="lighttpd-ssl" |
pascal@18101 | 4 VERSION="1.4.35" |
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@15379 | 8 LICENSE="BSD" |
pascal@1787 | 9 SUGGESTED="lighttpd-modules php perl python" |
pascal@1787 | 10 SOURCE="lighttpd" |
pascal@15579 | 11 TARBALL="$SOURCE-$VERSION.tar.xz" |
pascal@1787 | 12 WEB_SITE="http://www.lighttpd.net/" |
pascal@17869 | 13 WGET_URL="http://download.lighttpd.net/lighttpd/releases-${VERSION%.*}.x/$TARBALL" |
slaxemulator@8894 | 14 CONFIG_FILES="/etc/lighttpd/vhosts.conf /etc/lighttpd/lighttpd.conf /etc/ssl/lighttpd" |
pascal@1787 | 15 PROVIDE="lighttpd" |
pankso@16000 | 16 HOST_ARCH="i486 arm" |
pankso@15992 | 17 |
pankso@15992 | 18 DEPENDS="pcre openssl" |
pankso@15992 | 19 BUILD_DEPENDS="pcre-dev bzip2-dev openssl-dev" |
pankso@15992 | 20 |
pascal@1787 | 21 BASE_MODULES=" |
pascal@1787 | 22 access |
pascal@1787 | 23 accesslog |
pascal@1787 | 24 alias |
pascal@1787 | 25 cgi |
pascal@1787 | 26 dirlisting |
pascal@1787 | 27 indexfile |
pascal@1787 | 28 staticfile |
pascal@1787 | 29 rewrite |
pascal@1787 | 30 status |
pascal@1787 | 31 userdir" |
pascal@1787 | 32 |
pascal@1787 | 33 # Rules to configure and make the package. |
pascal@1787 | 34 compile_rules() |
pascal@1787 | 35 { |
pascal@15579 | 36 sed -i '/addrs_left/d' src/mod_extforward.c |
pascal@1787 | 37 ./configure \ |
pascal@1787 | 38 --enable-shared \ |
pascal@1787 | 39 --disable-ipv6 \ |
pascal@1787 | 40 --with-openssl \ |
pascal@1787 | 41 --prefix=/usr \ |
al@18734 | 42 --libdir=/usr/lib/lighttpd \ |
al@18734 | 43 --mandir=/usr/share/man \ |
al@18734 | 44 $CONFIGURE_ARGS && |
pascal@1787 | 45 make && |
pascal@15579 | 46 make DESTDIR=$DESTDIR 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@15579 | 54 #cp -a $install/usr/bin $fs/usr |
pascal@15579 | 55 cp -a $install/usr/sbin $fs/usr |
pankso@4572 | 56 |
pascal@1787 | 57 # Modules. |
pascal@1787 | 58 mkdir -p $fs/usr/lib/lighttpd |
al@18734 | 59 for module in $BASE_MODULES; do |
al@18734 | 60 action 'Copying : mod_${module}.so' |
pascal@15579 | 61 cp $install/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd |
al@18734 | 62 status |
pascal@1787 | 63 done |
pankso@4572 | 64 |
pascal@1787 | 65 # Server root and config file. |
slaxemulator@8652 | 66 cp -a $WOK/$SOURCE/stuff/etc $fs |
pascal@1787 | 67 chown -R 0.0 $fs/etc |
pascal@1790 | 68 mkdir -p $fs/etc/ssl/lighttpd |
pascal@1790 | 69 cat >> $fs/etc/lighttpd/lighttpd.conf <<EOT |
pascal@1789 | 70 |
pascal@1789 | 71 # Enable HTTPS support |
pascal@1789 | 72 # |
pascal@1791 | 73 \$SERVER["socket"] == ":443" { |
pascal@1789 | 74 protocol = "https://" |
pascal@1789 | 75 ssl.engine = "enable" |
pascal@17237 | 76 # Unsafe, see CVE-2014-3566 POODLE |
pascal@17237 | 77 ssl.use-sslv2 = "disable" |
pascal@17237 | 78 ssl.use-sslv3 = "disable" |
pascal@1789 | 79 ssl.pemfile = "/etc/ssl/lighttpd/lighttpd.pem" |
pascal@1789 | 80 } |
pascal@1789 | 81 EOT |
pankso@4572 | 82 |
pascal@1787 | 83 # Logs directory. |
pascal@1787 | 84 mkdir -p $fs/var/log/lighttpd |
pascal@1787 | 85 chown 80.80 $fs/var/log/lighttpd |
pascal@1787 | 86 } |
pascal@1787 | 87 |
pankso@15992 | 88 # Make sur it as cross compile properly |
pankso@15992 | 89 testsuite() |
pankso@15992 | 90 { |
pankso@15992 | 91 readelf -h $install/usr/sbin/lighttpd |
pankso@15992 | 92 } |
pankso@15992 | 93 |
pascal@1787 | 94 # Pre and post install commands for Tazpkg. |
pascal@1787 | 95 # We stop the server by default in case of upgarde. |
pascal@1787 | 96 pre_install() |
pascal@1787 | 97 { |
pascal@19147 | 98 [ -z "$1" ] && for i in httpd lighttpd ngnix apache cherokee $PACKAGE ; do |
pascal@19147 | 99 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop |
pascal@19147 | 100 done |
pascal@19147 | 101 # Backup config file. |
pascal@19147 | 102 if [ -d "$1/etc/lighttpd" ]; then |
pascal@19147 | 103 cp -a "$1/etc/lighttpd" "$1/etc/lighttpd.bak" |
pascal@19147 | 104 fi |
pascal@1787 | 105 } |
pascal@1906 | 106 |
pascal@1787 | 107 post_install() |
pascal@1787 | 108 { |
pascal@18730 | 109 if [ ! -f "$1/etc/ssl/lighttpd/lighttpd.pem" ]; then |
pascal@1789 | 110 openssl req -new -x509 \ |
pascal@18730 | 111 -keyout "$1/etc/ssl/lighttpd/lighttpd.pem" \ |
pascal@18730 | 112 -out "$1/etc/ssl/lighttpd/lighttpd.pem" \ |
pascal@1906 | 113 -days 3650 -nodes <<EOT |
pascal@18730 | 114 $(. "$1/etc/locale.conf" ; echo ${LANG#*_}) |
pascal@18730 | 115 $(cat "$1/etc/TZ") |
pascal@1789 | 116 |
pascal@18730 | 117 $(cat "$1/etc/hostname") |
pascal@1789 | 118 |
pascal@1789 | 119 |
pascal@1789 | 120 |
pascal@1789 | 121 EOT |
pascal@1789 | 122 fi |
pascal@1787 | 123 # Just in case. |
pascal@18730 | 124 chown www.www "$1/var/log/lighttpd" |
pascal@1905 | 125 if [ -z "$1" ]; then |
pascal@1905 | 126 for i in apache ; do |
pascal@1905 | 127 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop |
pascal@1905 | 128 done |
erjo@2620 | 129 /etc/init.d/lighttpd start |
pascal@1905 | 130 fi |
pascal@1787 | 131 } |