wok-next annotate lighttpd/receipt @ rev 20309

Up foo2xqx (20170320)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Nov 10 16:07:36 2017 +0100 (2017-11-10)
parents 8d3183aefad5
children c4e53a39395a
rev   line source
pascal@19986 1 # SliTaz package receipt v2.
pankso@24 2
pankso@24 3 PACKAGE="lighttpd"
pascal@18101 4 VERSION="1.4.35"
pankso@211 5 CATEGORY="network"
pankso@24 6 SHORT_DESC="Fast and light HTTP Web server."
pankso@24 7 MAINTAINER="pankso@slitaz.org"
pascal@15379 8 LICENSE="BSD"
pascal@15576 9 TARBALL="$PACKAGE-$VERSION.tar.xz"
pankso@24 10 WEB_SITE="http://www.lighttpd.net/"
pascal@17869 11 WGET_URL="http://download.lighttpd.net/lighttpd/releases-${VERSION%.*}.x/$TARBALL"
pankso@16000 12 HOST_ARCH="i486 arm"
pankso@15992 13
pascal@19986 14 BUILD_DEPENDS="pcre-dev bzip2-dev zlib-dev"
pascal@19990 15 SPLIT="lighttpd lighttpd-modules"
pankso@24 16
pankso@24 17 # Rules to configure and make the package.
pankso@24 18 compile_rules()
pankso@24 19 {
pascal@15576 20 sed -i '/addrs_left/d' src/mod_extforward.c
pankso@639 21 ./configure \
pankso@639 22 --enable-shared \
pankso@639 23 --disable-ipv6 \
pankso@639 24 --prefix=/usr \
pascal@15577 25 --libdir=/usr/lib/lighttpd \
pascal@15577 26 --mandir=/usr/share/man \
pascal@15577 27 $CONFIGURE_ARGS &&
pascal@1516 28 make &&
pascal@15577 29 make DESTDIR=$DESTDIR install
pankso@24 30 }
pankso@24 31
pankso@24 32 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@24 33 # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
pankso@24 34 genpkg_rules()
pankso@24 35 {
pascal@19986 36 case $PACKAGE in
pascal@19986 37 lighttpd)
pascal@19986 38 CONFIG_FILES="/etc/lighttpd/vhosts.conf /etc/lighttpd/lighttpd.conf"
pascal@19986 39 SUGGESTED="lighttpd-modules php perl python"
pascal@19986 40 DEPENDS="pcre"
pascal@19986 41 # Modules include in this package. Other modules are splited in
pascal@19986 42 # the lighttpd-modules packages.
pascal@19986 43 BASE_MODULES="
pascal@19986 44 access
pascal@19986 45 accesslog
pascal@19986 46 alias
pascal@19986 47 cgi
pascal@19986 48 dirlisting
pascal@19986 49 indexfile
pascal@19986 50 staticfile
pascal@19986 51 rewrite
pascal@19986 52 status
pascal@19986 53 userdir"
pascal@19986 54 mkdir -p $fs/usr
pascal@19986 55 #cp -a $install/usr/bin $fs/usr
pascal@19986 56 cp -a $install/usr/sbin $fs/usr
pankso@4572 57
pascal@19986 58 # Modules.
pascal@19986 59 mkdir -p $fs/usr/lib/lighttpd
pascal@19986 60 for module in $BASE_MODULES; do
pascal@19986 61 cp $install/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd
pascal@19986 62 echo -n "Copying : mod_${module}.so" && status
pascal@19986 63 done
pankso@4572 64
pascal@19986 65 # Config file.
pascal@19986 66 cp -a $stuff/etc $fs
pascal@19986 67 chown -R 0.0 $fs/etc
pankso@4572 68
pascal@19986 69 # Logs directory.
pascal@19986 70 mkdir -p $fs/var/log/lighttpd
pascal@19986 71 chown 80.80 $fs/var/log/lighttpd
pascal@19986 72 ;;
pascal@19986 73 lighttpd-modules)
pascal@19986 74 CAT="network|Complementary modules for LightTPD Web server."
pascal@19986 75 DEPENDS="lighttpd bzip2 zlib"
pascal@19986 76 BASE_MODULES="
pascal@19986 77 access
pascal@19986 78 accesslog
pascal@19986 79 alias
pascal@19986 80 cgi
pascal@19986 81 dirlisting
pascal@19986 82 indexfile
pascal@19986 83 staticfile
pascal@19986 84 rewrite
pascal@19986 85 status
pascal@19986 86 userdir"
pascal@19986 87 # Modules.
pascal@19986 88 mkdir -p $fs/usr/
pascal@19986 89 cp -a $install/usr/lib $fs/usr
pascal@19986 90 for module in $BASE_MODULES
pascal@19986 91 do
pascal@19986 92 rm -f $fs/usr/lib/lighttpd/mod_${module}.so
pascal@19986 93 done
pascal@19986 94 rm -f $fs/usr/lib/lighttpd/*.la
pascal@19986 95 ;;
pascal@19986 96 esac
pankso@24 97 }
pankso@24 98
pankso@15992 99 # Make sur it as cross compile properly
pankso@15992 100 testsuite()
pankso@15992 101 {
pankso@15992 102 readelf -h $install/usr/sbin/$PACKAGE
pankso@15992 103 }
pankso@15992 104
pankso@24 105 # Pre and post install commands for Tazpkg.
pankso@24 106 # We stop the server by default in case of upgarde.
pascal@19986 107 pre_install_lighttpd()
pankso@24 108 {
pascal@19147 109 [ -z "$1" ] && for i in httpd ngnix apache cherokee $PACKAGE ; do
pascal@19147 110 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
pascal@19147 111 done
pankso@2306 112 # Backup config file.
pascal@18730 113 if [ -d "$1/etc/lighttpd" ]; then
pascal@18730 114 cp -a "$1/etc/lighttpd" "$1/etc/lighttpd.bak"
pankso@2306 115 fi
pankso@24 116 }
al@18741 117
pascal@19986 118 post_install_lighttpd()
pankso@24 119 {
pankso@2306 120 # Restore original config.
pascal@18730 121 if [ -d "$1/etc/lighttpd.bak" ]; then
pascal@18730 122 rm -rf "$1/etc/lighttpd"
pascal@18730 123 mv "$1/etc/lighttpd.bak" "$1/etc/lighttpd"
pankso@2306 124 fi
al@18741 125
pankso@24 126 # Just in case.
pascal@18730 127 chown www.www "$1/var/log/$PACKAGE"
pascal@18715 128 [ "$1" ] || netstat -ltn 2> /dev/null | grep -q :80 ||
pascal@18715 129 /etc/init.d/$PACKAGE start
pankso@24 130 }