wok-next view lighttpd/receipt @ rev 20566

linld, screenfetch: create $install tree (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Apr 10 10:30:46 2018 +0200 (2018-04-10)
parents 8dbfcd66c5a7
children 5841522533ec
line source
1 # SliTaz package receipt v2.
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 TARBALL="$PACKAGE-$VERSION.tar.xz"
10 WEB_SITE="http://www.lighttpd.net/"
11 WGET_URL="http://download.lighttpd.net/lighttpd/releases-${VERSION%.*}.x/$TARBALL"
13 BUILD_DEPENDS="pcre-dev bzip2-dev zlib-dev"
14 SPLIT="lighttpd lighttpd-modules"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 sed -i '/addrs_left/d' src/mod_extforward.c
20 ./configure \
21 --enable-shared \
22 --disable-ipv6 \
23 --prefix=/usr \
24 --libdir=/usr/lib/lighttpd \
25 --mandir=/usr/share/man \
26 $CONFIGURE_ARGS &&
27 make &&
28 make DESTDIR=$DESTDIR install
29 }
31 # Rules to gen a SliTaz package suitable for Tazpkg.
32 # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
33 genpkg_rules()
34 {
35 case $PACKAGE in
36 lighttpd)
37 CONFIG_FILES="/etc/lighttpd/vhosts.conf /etc/lighttpd/lighttpd.conf"
38 SUGGESTED="lighttpd-modules php perl python"
39 DEPENDS="pcre"
40 # Modules include in this package. Other modules are splited in
41 # the lighttpd-modules packages.
42 BASE_MODULES="
43 access
44 accesslog
45 alias
46 cgi
47 dirlisting
48 indexfile
49 staticfile
50 rewrite
51 status
52 userdir"
53 mkdir -p $fs/usr
54 #cp -a $install/usr/bin $fs/usr
55 cp -a $install/usr/sbin $fs/usr
57 # Modules.
58 mkdir -p $fs/usr/lib/lighttpd
59 for module in $BASE_MODULES; do
60 cp $install/usr/lib/lighttpd/mod_${module}.so $fs/usr/lib/lighttpd
61 echo -n "Copying : mod_${module}.so" && status
62 done
64 # Config file.
65 cp -a $stuff/etc $fs
66 chown -R 0.0 $fs/etc
68 # Logs directory.
69 mkdir -p $fs/var/log/lighttpd
70 chown 80.80 $fs/var/log/lighttpd
71 ;;
72 lighttpd-modules)
73 CAT="network|Complementary modules for LightTPD Web server."
74 DEPENDS="lighttpd bzip2 zlib"
75 BASE_MODULES="
76 access
77 accesslog
78 alias
79 cgi
80 dirlisting
81 indexfile
82 staticfile
83 rewrite
84 status
85 userdir"
86 # Modules.
87 mkdir -p $fs/usr/
88 cp -a $install/usr/lib $fs/usr
89 for module in $BASE_MODULES
90 do
91 rm -f $fs/usr/lib/lighttpd/mod_${module}.so
92 done
93 rm -f $fs/usr/lib/lighttpd/*.la
94 ;;
95 esac
96 }
98 # Make sur it as cross compile properly
99 testsuite()
100 {
101 readelf -h $install/usr/sbin/$PACKAGE
102 }
104 # Pre and post install commands for Tazpkg.
105 # We stop the server by default in case of upgarde.
106 pre_install_lighttpd()
107 {
108 [ -z "$1" ] && for i in httpd ngnix apache cherokee $PACKAGE ; do
109 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
110 done
111 # Backup config file.
112 if [ -d "$1/etc/lighttpd" ]; then
113 cp -a "$1/etc/lighttpd" "$1/etc/lighttpd.bak"
114 fi
115 }
117 post_install_lighttpd()
118 {
119 # Restore original config.
120 if [ -d "$1/etc/lighttpd.bak" ]; then
121 rm -rf "$1/etc/lighttpd"
122 mv "$1/etc/lighttpd.bak" "$1/etc/lighttpd"
123 fi
125 # Just in case.
126 chown www.www "$1/var/log/$PACKAGE"
127 [ "$1" ] || netstat -ltn 2> /dev/null | grep -q :80 ||
128 /etc/init.d/$PACKAGE start
129 }