wok view lighttpd/receipt @ rev 24924

Add as & asxxxx
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Apr 13 10:27:34 2022 +0000 (2022-04-13)
parents ede1d184d5c5
children
line source
1 # SliTaz package receipt.
3 PACKAGE="lighttpd"
4 VERSION="1.4.64"
5 CATEGORY="network"
6 SHORT_DESC="Fast and light HTTP Web server."
7 MAINTAINER="pankso@slitaz.org"
8 LICENSE="BSD"
9 WEB_SITE="https://www.lighttpd.net/"
11 TARBALL="$PACKAGE-$VERSION.tar.xz"
12 WGET_URL="https://download.lighttpd.net/$PACKAGE/releases-${VERSION%.*}.x/$TARBALL"
14 SUGGESTED="lighttpd-modules perl php python"
15 DEPENDS="pcre2"
16 BUILD_DEPENDS="bzip2-dev pcre2-dev"
18 CONFIG_FILES="/etc/lighttpd/vhosts.conf /etc/lighttpd/lighttpd.conf"
20 HOST_ARCH="i486 arm"
22 # Modules to be included in this package. Other modules are split in
23 # the lighttpd-modules package.
24 BASE_MODULES="
25 access
26 accesslog
27 alias
28 cgi
29 dirlisting
30 indexfile
31 staticfile
32 rewrite
33 status
34 userdir"
36 # What is the latest version available today?
37 current_version()
38 {
39 wget -O - $WEB_SITE 2>/dev/null | \
40 sed "/latest/d;/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*|\\1|" | sort -Vr | sed q
41 }
43 # Rules to configure and make the package.
44 compile_rules()
45 {
46 sed -i '/addrs_left/d' src/mod_extforward.c
48 ./configure \
49 --prefix=/usr \
50 --libdir=/usr/lib/lighttpd \
51 --mandir=/usr/share/man \
52 --disable-ipv6 \
53 --enable-shared \
54 $CONFIGURE_ARGS &&
55 make &&
56 make install DESTDIR=$DESTDIR
57 }
59 # Rules to gen a SliTaz package suitable for Tazpkg.
60 # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
61 genpkg_rules()
62 {
63 mkdir -p $fs/usr
64 #cp -a $install/usr/bin $fs/usr
65 cp -a $install/usr/sbin $fs/usr
67 # Modules.
68 mkdir -p $fs/usr/lib/lighttpd
69 for module in $BASE_MODULES
70 do
71 cp $install/usr/lib/lighttpd/mod_${module}.so \
72 $fs/usr/lib/lighttpd
73 echo -n "Copying : mod_${module}.so" && status
74 done
76 # Configuration file.
77 cp -a $stuff/etc $fs
78 chown -R 0.0 $fs/etc
80 # Logs directory.
81 mkdir -p $fs/var/log/lighttpd
82 chown 80.80 $fs/var/log/lighttpd
83 }
85 # Make sure it is cross compiled properly
86 testsuite()
87 {
88 readelf -h $install/usr/sbin/$PACKAGE
89 }
91 # Pre and post install commands for Tazpkg.
92 # We stop the server by default in case of upgrade.
93 pre_install()
94 {
95 [ -z "$1" ] &&
96 for i in httpd ngnix apache cherokee $PACKAGE
97 do
98 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
99 done
101 # Backup configuration file.
102 if [ -d "$1/etc/lighttpd" ]
103 then
104 cp -a "$1/etc/lighttpd" "$1/etc/lighttpd.bak"
105 fi
106 }
108 post_install()
109 {
110 # Restore original configuration file.
111 if [ -d "$1/etc/lighttpd.bak" ]
112 then
113 rm -rf "$1/etc/lighttpd"
114 mv "$1/etc/lighttpd.bak" "$1/etc/lighttpd"
115 fi
117 # Just in case.
118 chown www.www "$1/var/log/$PACKAGE"
119 [ "$1" ] || netstat -ltn 2> /dev/null | grep -q :80 ||
120 /etc/init.d/$PACKAGE start
121 }