wok-current view lighttpd/receipt @ rev 20235

busybox: add arch (uname -m alias)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Mar 05 15:52:59 2018 +0100 (2018-03-05)
parents 6fab3264ba87
children ea835222df2a
line source
1 # SliTaz package receipt.
3 PACKAGE="lighttpd"
4 VERSION="1.4.35"
5 CATEGORY="network"
6 SHORT_DESC="Fast and light HTTP Web server."
7 MAINTAINER="pankso@slitaz.org"
8 LICENSE="BSD"
9 SUGGESTED="lighttpd-modules php perl python"
10 TARBALL="$PACKAGE-$VERSION.tar.xz"
11 WEB_SITE="http://www.lighttpd.net/"
12 WGET_URL="http://download.lighttpd.net/lighttpd/releases-${VERSION%.*}.x/$TARBALL"
13 CONFIG_FILES="/etc/lighttpd/vhosts.conf /etc/lighttpd/lighttpd.conf"
14 HOST_ARCH="i486 arm"
16 DEPENDS="pcre"
17 BUILD_DEPENDS="pcre-dev bzip2-dev"
19 # Modules include in this package. Other modules are splited in
20 # the lighttpd-modules packages.
21 BASE_MODULES="
22 access
23 accesslog
24 alias
25 cgi
26 dirlisting
27 indexfile
28 staticfile
29 rewrite
30 status
31 userdir"
33 # Rules to configure and make the package.
34 compile_rules()
35 {
36 sed -i '/addrs_left/d' src/mod_extforward.c
37 ./configure \
38 --enable-shared \
39 --disable-ipv6 \
40 --prefix=/usr \
41 --libdir=/usr/lib/lighttpd \
42 --mandir=/usr/share/man \
43 $CONFIGURE_ARGS &&
44 make &&
45 make DESTDIR=$DESTDIR install
46 }
48 # Rules to gen a SliTaz package suitable for Tazpkg.
49 # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
50 genpkg_rules()
51 {
52 mkdir -p $fs/usr
53 #cp -a $install/usr/bin $fs/usr
54 cp -a $install/usr/sbin $fs/usr
56 # Modules.
57 mkdir -p $fs/usr/lib/lighttpd
58 for module in $BASE_MODULES; do
59 cp $install/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd
60 echo -n "Copying : mod_${module}.so" && status
61 done
63 # Config file.
64 cp -a $stuff/etc $fs
65 chown -R 0.0 $fs/etc
67 # Logs directory.
68 mkdir -p $fs/var/log/lighttpd
69 chown 80.80 $fs/var/log/lighttpd
70 }
72 # Make sur it as cross compile properly
73 testsuite()
74 {
75 readelf -h $install/usr/sbin/$PACKAGE
76 }
78 # Pre and post install commands for Tazpkg.
79 # We stop the server by default in case of upgarde.
80 pre_install()
81 {
82 [ -z "$1" ] && for i in httpd ngnix apache cherokee $PACKAGE ; do
83 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
84 done
85 # Backup config file.
86 if [ -d "$1/etc/lighttpd" ]; then
87 cp -a "$1/etc/lighttpd" "$1/etc/lighttpd.bak"
88 fi
89 }
91 post_install()
92 {
93 # Restore original config.
94 if [ -d "$1/etc/lighttpd.bak" ]; then
95 rm -rf "$1/etc/lighttpd"
96 mv "$1/etc/lighttpd.bak" "$1/etc/lighttpd"
97 fi
99 # Just in case.
100 chown www.www "$1/var/log/$PACKAGE"
101 [ "$1" ] || netstat -ltn 2> /dev/null | grep -q :80 ||
102 /etc/init.d/$PACKAGE start
103 }