wok-current annotate lighttpd/receipt @ rev 2306

lighttpd: backup config files
author Christophe Lincoln <pankso@slitaz.org>
date Tue Feb 24 23:20:43 2009 +0100 (2009-02-24)
parents 505ef4de4664
children ec72a3b325c3
rev   line source
pankso@24 1 # SliTaz package receipt.
pankso@24 2
pankso@24 3 PACKAGE="lighttpd"
pankso@2298 4 VERSION="1.4.21"
pankso@211 5 CATEGORY="network"
pankso@24 6 SHORT_DESC="Fast and light HTTP Web server."
pankso@24 7 MAINTAINER="pankso@slitaz.org"
pankso@639 8 DEPENDS="pcre"
pankso@667 9 BUILD_DEPENDS="pcre-dev bzip2-dev"
pankso@639 10 SUGGESTED="lighttpd-modules php perl python"
pankso@24 11 TARBALL="$PACKAGE-$VERSION.tar.gz"
pankso@24 12 WEB_SITE="http://www.lighttpd.net/"
pankso@1095 13 #WGET_URL="http://www.lighttpd.net/download/$TARBALL"
pankso@1095 14 WGET_URL="http://mirror.slitaz.org/sources/packages/l/$TARBALL"
pascal@1906 15 CONFIG_FILES="/etc/lighttpd"
pankso@24 16 BASE_MODULES="
pankso@24 17 access
pankso@24 18 accesslog
pankso@24 19 alias
pankso@24 20 cgi
pankso@24 21 dirlisting
pankso@24 22 indexfile
pankso@24 23 staticfile
pankso@24 24 rewrite
pankso@24 25 status
pankso@24 26 userdir"
pankso@24 27
pankso@24 28 # Rules to configure and make the package.
pankso@24 29 compile_rules()
pankso@24 30 {
pankso@24 31 cd $src
pascal@1516 32 if [ ! done.fastcgi_detach.patch ]; then
pascal@1516 33 patch -i ../stuff/fastcgi_detach.patch || exit 1
pascal@1516 34 touch done.fastcgi_detach.patch
pascal@1516 35 fi
pankso@639 36 ./configure \
pankso@639 37 --enable-shared \
pankso@639 38 --disable-ipv6 \
pankso@639 39 --prefix=/usr \
pankso@639 40 --libdir=/usr/lib/lighttpd \
pankso@639 41 --mandir=/usr/share/man \
pascal@1516 42 $CONFIGURE_ARGS &&
pascal@1516 43 make &&
pankso@24 44 make DESTDIR=$PWD/_pkg install
pankso@24 45 }
pankso@24 46
pankso@24 47 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@24 48 # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
pankso@24 49 genpkg_rules()
pankso@24 50 {
pankso@24 51 mkdir -p $fs/usr
pankso@24 52 cp -a $_pkg/usr/bin $fs/usr
pankso@24 53 cp -a $_pkg/usr/sbin $fs/usr
pankso@24 54
pankso@24 55 # Modules.
pankso@24 56 mkdir -p $fs/usr/lib/lighttpd
pankso@24 57 for module in $BASE_MODULES
pankso@24 58 do
pankso@24 59 cp $_pkg/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd
pankso@24 60 echo -n "Copying : mod_${module}.so" && status
pankso@24 61 done
pankso@24 62
pankso@24 63 # Server root and config file.
pankso@24 64 cp -a stuff/var $fs
pankso@24 65 cp -a stuff/etc $fs
pankso@119 66 chown -R 0.0 $fs/var/www
pankso@119 67 chown -R 0.0 $fs/etc
pankso@24 68
pankso@24 69 # Logs directory.
pankso@24 70 mkdir -p $fs/var/log/lighttpd
pankso@24 71 chown 80.80 $fs/var/log/lighttpd
pankso@24 72 }
pankso@24 73
pankso@24 74 # Pre and post install commands for Tazpkg.
pankso@24 75 # We stop the server by default in case of upgarde.
pankso@24 76 pre_install()
pankso@24 77 {
pankso@24 78 echo "Processing pre-install commands..."
pascal@1204 79 [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop
pankso@2306 80 # Backup config file.
pankso@2306 81 if [ -d $1/$CONFIG_FILES ]; then
pankso@2306 82 cp -a $1/$CONFIG_FILES $1/$CONFIG_FILES.bak
pankso@2306 83 fi
pankso@24 84 }
pankso@24 85 post_install()
pankso@24 86 {
pankso@24 87 echo "Processing post-install commands..."
pankso@2306 88 # Restore original config.
pankso@2306 89 if [ -d $1/$CONFIG_FILES.bak ]; then
pankso@2306 90 rm -rf $1/$CONFIG_FILES
pankso@2306 91 mv $1/$CONFIG_FILES.bak $1/$CONFIG_FILES
pankso@2306 92 fi
pankso@24 93 # Just in case.
pascal@1905 94 chown www.www $1/var/log/$PACKAGE
pascal@1905 95 if [ -z "$1" ]; then
pascal@1905 96 for i in apache ; do
pascal@1905 97 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
pascal@1905 98 done
pascal@1905 99 /etc/init.d/$PACKAGE start
pascal@1905 100 fi
pankso@24 101 }