wok-6.x annotate lighttpd/receipt @ rev 15576
lighttpd: fix compile_rules
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Nov 29 08:51:47 2013 +0000 (2013-11-29) |
parents | 8dc807868225 |
children | 8ebec64e4191 |
rev | line source |
---|---|
pankso@24 | 1 # SliTaz package receipt. |
pankso@24 | 2 |
pankso@24 | 3 PACKAGE="lighttpd" |
pascal@15575 | 4 VERSION="1.4.33" |
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@4575 | 12 WGET_URL="http://download.lighttpd.net/lighttpd/releases-1.4.x/$TARBALL" |
slaxemulator@8894 | 13 CONFIG_FILES="/etc/lighttpd/vhosts.conf /etc/lighttpd/lighttpd.conf" |
pankso@24 | 14 BASE_MODULES=" |
pankso@24 | 15 access |
pankso@24 | 16 accesslog |
pankso@24 | 17 alias |
pankso@24 | 18 cgi |
pankso@24 | 19 dirlisting |
pankso@24 | 20 indexfile |
pankso@24 | 21 staticfile |
pankso@24 | 22 rewrite |
pankso@24 | 23 status |
pankso@24 | 24 userdir" |
pankso@24 | 25 |
pascal@15379 | 26 DEPENDS="pcre" |
pascal@15379 | 27 BUILD_DEPENDS="pcre-dev bzip2-dev" |
pascal@15379 | 28 |
pankso@24 | 29 # Rules to configure and make the package. |
pankso@24 | 30 compile_rules() |
pankso@24 | 31 { |
pankso@24 | 32 cd $src |
pascal@15576 | 33 sed -i '/addrs_left/d' src/mod_extforward.c |
pascal@1516 | 34 if [ ! done.fastcgi_detach.patch ]; then |
slaxemulator@9700 | 35 patch -i $stuff/fastcgi_detach.patch || return 1 |
pascal@1516 | 36 touch done.fastcgi_detach.patch |
pascal@1516 | 37 fi |
pankso@639 | 38 ./configure \ |
pankso@639 | 39 --enable-shared \ |
pankso@639 | 40 --disable-ipv6 \ |
pankso@639 | 41 --prefix=/usr \ |
pankso@639 | 42 --libdir=/usr/lib/lighttpd \ |
pankso@639 | 43 --mandir=/usr/share/man \ |
pascal@1516 | 44 $CONFIGURE_ARGS && |
pascal@1516 | 45 make && |
pankso@24 | 46 make DESTDIR=$PWD/_pkg install |
pankso@24 | 47 } |
pankso@24 | 48 |
pankso@24 | 49 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@24 | 50 # On SliTaz Lighttpd runs as user/group : www/www or 80/80. |
pankso@24 | 51 genpkg_rules() |
pankso@24 | 52 { |
pankso@24 | 53 mkdir -p $fs/usr |
pankso@4572 | 54 #cp -a $_pkg/usr/bin $fs/usr |
pankso@24 | 55 cp -a $_pkg/usr/sbin $fs/usr |
pankso@4572 | 56 |
pankso@24 | 57 # Modules. |
pankso@24 | 58 mkdir -p $fs/usr/lib/lighttpd |
pankso@24 | 59 for module in $BASE_MODULES |
pankso@24 | 60 do |
pankso@24 | 61 cp $_pkg/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd |
pankso@24 | 62 echo -n "Copying : mod_${module}.so" && status |
pankso@24 | 63 done |
pankso@4572 | 64 |
pankso@24 | 65 # Server root and config file. |
pankso@9665 | 66 cp -a $stuff/var $fs |
pankso@9665 | 67 cp -a $stuff/etc $fs |
pankso@119 | 68 chown -R 0.0 $fs/var/www |
pankso@119 | 69 chown -R 0.0 $fs/etc |
pankso@4572 | 70 |
pankso@24 | 71 # Logs directory. |
pankso@24 | 72 mkdir -p $fs/var/log/lighttpd |
pankso@24 | 73 chown 80.80 $fs/var/log/lighttpd |
pankso@24 | 74 } |
pankso@24 | 75 |
pankso@24 | 76 # Pre and post install commands for Tazpkg. |
pankso@24 | 77 # We stop the server by default in case of upgarde. |
pankso@24 | 78 pre_install() |
pankso@24 | 79 { |
pankso@24 | 80 echo "Processing pre-install commands..." |
pascal@1204 | 81 [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop |
pankso@2306 | 82 # Backup config file. |
pascal@15575 | 83 if [ -d $1/etc/lighttpd ]; then |
pascal@15575 | 84 cp -a $1/etc/lighttpd $1/etc/lighttpd.bak |
pankso@2306 | 85 fi |
pankso@24 | 86 } |
pankso@24 | 87 post_install() |
pankso@24 | 88 { |
pankso@24 | 89 echo "Processing post-install commands..." |
pankso@2306 | 90 # Restore original config. |
pascal@15575 | 91 if [ -d $1/etc/lighttpd.bak ]; then |
pascal@15575 | 92 rm -rf $1/etc/lighttpd |
pascal@15575 | 93 mv $1/etc/lighttpd.bak $1/etc/lighttpd |
pankso@2306 | 94 fi |
pankso@24 | 95 # Just in case. |
pascal@1905 | 96 chown www.www $1/var/log/$PACKAGE |
pascal@1905 | 97 if [ -z "$1" ]; then |
pankso@10811 | 98 for i in apache httpd; do |
pascal@1905 | 99 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop |
pascal@1905 | 100 done |
pascal@1905 | 101 /etc/init.d/$PACKAGE start |
pascal@1905 | 102 fi |
pankso@24 | 103 } |