wok view webalizer/receipt @ rev 25005

updated ntl (11.4.3 -> 11.5.1)
author Hans-G?nter Theisgen
date Mon May 16 16:29:07 2022 +0100 (2022-05-16)
parents 78bc4b109dd6
children df63c4ce07f8
line source
1 # SliTaz package receipt.
3 PACKAGE="webalizer"
4 VERSION="2.23.08"
5 CATEGORY="network"
6 TAGS="logs"
7 SHORT_DESC="Web server log file analysis program."
8 MAINTAINER="pascal.bellard@slitaz.org"
9 LICENSE="GPL2"
10 WEB_SITE="https://www.patrickfrei.ch/webalizer/"
12 TARBALL="$PACKAGE-${VERSION%.*}-${VERSION##*.}-src.tar.bz2"
13 WGET_URL="ftp://ftp.mrunix.net/pub/$PACKAGE/$TARBALL"
15 DEPENDS="apache db libgd zlib"
16 BUILD_DEPENDS="db-dev libgd-dev zlib-dev"
18 # What is the latest version available today?
19 current_version()
20 {
21 wget -O - $WEB_SITE 2>/dev/null | \
22 sed "/latest/d;/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-||;s|-src.*||;s|-|.|;q"
23 }
25 # Rules to configure and make the package.
26 compile_rules()
27 {
28 export LDFLAGS="$LDFLAGS -lpthread"
29 sed -i 's/define _LARGEFILE64_SOURCE = 1/define _LARGEFILE64_SOURCE/' \
30 webalizer.c
32 ./configure \
33 --sysconfdir=/etc &&
34 make &&
35 make DESTDIR=$DESTDIR install
36 }
38 # Rules to gen a SliTaz package suitable for Tazpkg.
39 genpkg_rules()
40 {
41 mkdir -p $fs/usr
42 mkdir -p $fs/etc
43 mkdir -p $fs/var/www/webalizer
44 chown 80 $fs/var/www/webalizer
45 mkdir -p $fs/etc/initcron.d
47 cp -a $install/etc/webalizer.conf.sample $fs/etc/webalizer.conf
48 cp -a $install/usr/bin $fs/usr
50 cat > $fs/etc/initcron.d/webalizer << EOT
52 30 0 * * * /usr/bin/webalizer -o /var/www/webalizer /var/log/apache/access_log
53 EOT
55 chmod +x $fs/etc/initcron.d/webalizer
56 }
58 # Pre and post install commands for Tazpkg.
59 pre_remove()
60 {
61 sed -i '/webalizer/d' "$1/etc/init.d/local.sh"
62 if [ -z "$1" ]
63 then
64 crontab -l 2> /dev/null | grep -q webalizer || crontab - << EOT
65 $(crontab -l 2> /dev/null | grep -v webalizer)
66 EOT
67 fi
68 }
70 post_install()
71 {
72 grep -q webalizer "$1/etc/init.d/local.sh" || \
73 cat >> "$1/etc/init.d/local.sh" <<EOT
74 [ -f /var/www/webalizer/index.html ] || /usr/bin/webalizer -o /var/www/webalizer /var/log/apache/access_log
75 EOT
77 if [ -z "$1" ]
78 then
79 webalizer -o /var/www/webalizer /var/log/apache/access_log
80 crontab -l 2> /dev/null | grep -q webalizer || crontab - << EOT
81 $(crontab -l 2> /dev/null)
82 $(cat /etc/initcron.d/webalizer)
83 EOT
84 chmod -x /etc/initcron.d/webalizer
85 fi
86 }