wok-next view lighttpd/receipt @ rev 19990

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