wok-6.x annotate lighttpd/receipt @ rev 18715
apache, lighttpd: fix post_install
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Dec 16 23:00:12 2015 +0100 (2015-12-16) |
parents | fb5d18e72609 |
children | 9e01bc6321ea |
rev | line source |
---|---|
pankso@24 | 1 # SliTaz package receipt. |
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" |
pankso@639 | 9 SUGGESTED="lighttpd-modules php perl python" |
pascal@15576 | 10 TARBALL="$PACKAGE-$VERSION.tar.xz" |
pankso@24 | 11 WEB_SITE="http://www.lighttpd.net/" |
pascal@17869 | 12 WGET_URL="http://download.lighttpd.net/lighttpd/releases-${VERSION%.*}.x/$TARBALL" |
slaxemulator@8894 | 13 CONFIG_FILES="/etc/lighttpd/vhosts.conf /etc/lighttpd/lighttpd.conf" |
pankso@16000 | 14 HOST_ARCH="i486 arm" |
pankso@15992 | 15 |
pankso@15992 | 16 DEPENDS="pcre" |
pankso@15992 | 17 BUILD_DEPENDS="pcre-dev bzip2-dev" |
pankso@15992 | 18 |
pankso@15992 | 19 # Modules include in this package. Other modules are splited in |
pankso@15992 | 20 # the lighttpd-modules packages. |
pankso@24 | 21 BASE_MODULES=" |
pankso@24 | 22 access |
pankso@24 | 23 accesslog |
pankso@24 | 24 alias |
pankso@24 | 25 cgi |
pankso@24 | 26 dirlisting |
pankso@24 | 27 indexfile |
pankso@24 | 28 staticfile |
pankso@24 | 29 rewrite |
pankso@24 | 30 status |
pankso@24 | 31 userdir" |
pankso@24 | 32 |
pankso@24 | 33 # Rules to configure and make the package. |
pankso@24 | 34 compile_rules() |
pankso@24 | 35 { |
pascal@15576 | 36 sed -i '/addrs_left/d' src/mod_extforward.c |
pankso@639 | 37 ./configure \ |
pankso@639 | 38 --enable-shared \ |
pankso@639 | 39 --disable-ipv6 \ |
pankso@639 | 40 --prefix=/usr \ |
pascal@15577 | 41 --libdir=/usr/lib/lighttpd \ |
pascal@15577 | 42 --mandir=/usr/share/man \ |
pascal@15577 | 43 $CONFIGURE_ARGS && |
pascal@1516 | 44 make && |
pascal@15577 | 45 make DESTDIR=$DESTDIR install |
pankso@24 | 46 } |
pankso@24 | 47 |
pankso@24 | 48 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@24 | 49 # On SliTaz Lighttpd runs as user/group : www/www or 80/80. |
pankso@24 | 50 genpkg_rules() |
pankso@24 | 51 { |
pankso@24 | 52 mkdir -p $fs/usr |
pascal@15577 | 53 #cp -a $install/usr/bin $fs/usr |
pascal@15577 | 54 cp -a $install/usr/sbin $fs/usr |
pankso@4572 | 55 |
pankso@24 | 56 # Modules. |
pankso@24 | 57 mkdir -p $fs/usr/lib/lighttpd |
pankso@24 | 58 for module in $BASE_MODULES |
pankso@24 | 59 do |
pascal@15577 | 60 cp $install/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd |
pankso@24 | 61 echo -n "Copying : mod_${module}.so" && status |
pankso@24 | 62 done |
pankso@4572 | 63 |
pankso@16333 | 64 # Config file. |
pankso@9665 | 65 cp -a $stuff/etc $fs |
pankso@119 | 66 chown -R 0.0 $fs/etc |
pankso@4572 | 67 |
pankso@24 | 68 # Logs directory. |
pankso@24 | 69 mkdir -p $fs/var/log/lighttpd |
pankso@24 | 70 chown 80.80 $fs/var/log/lighttpd |
pankso@24 | 71 } |
pankso@24 | 72 |
pankso@15992 | 73 # Make sur it as cross compile properly |
pankso@15992 | 74 testsuite() |
pankso@15992 | 75 { |
pankso@15992 | 76 readelf -h $install/usr/sbin/$PACKAGE |
pankso@15992 | 77 } |
pankso@15992 | 78 |
pankso@24 | 79 # Pre and post install commands for Tazpkg. |
pankso@24 | 80 # We stop the server by default in case of upgarde. |
pankso@24 | 81 pre_install() |
pankso@24 | 82 { |
pankso@24 | 83 echo "Processing pre-install commands..." |
pascal@1204 | 84 [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop |
pankso@2306 | 85 # Backup config file. |
pascal@15575 | 86 if [ -d $1/etc/lighttpd ]; then |
pascal@15575 | 87 cp -a $1/etc/lighttpd $1/etc/lighttpd.bak |
pankso@2306 | 88 fi |
pankso@24 | 89 } |
pankso@24 | 90 post_install() |
pankso@24 | 91 { |
pankso@24 | 92 echo "Processing post-install commands..." |
pankso@2306 | 93 # Restore original config. |
pascal@15575 | 94 if [ -d $1/etc/lighttpd.bak ]; then |
pascal@15575 | 95 rm -rf $1/etc/lighttpd |
pascal@15575 | 96 mv $1/etc/lighttpd.bak $1/etc/lighttpd |
pankso@2306 | 97 fi |
pankso@24 | 98 # Just in case. |
pascal@1905 | 99 chown www.www $1/var/log/$PACKAGE |
pascal@18715 | 100 [ "$1" ] || netstat -ltn 2> /dev/null | grep -q :80 || |
pascal@18715 | 101 /etc/init.d/$PACKAGE start |
pankso@24 | 102 } |