wok-current annotate squidanalyzer/receipt @ rev 23269

updated oxygen-gtk (1.4.5 -> 1.4.6)
author Hans-G?nter Theisgen
date Sat Mar 28 12:49:07 2020 +0100 (2020-03-28)
parents
children 5ea0ce1cecc0
rev   line source
pascal@22811 1 # SliTaz package receipt.
pascal@22811 2
pascal@22811 3 PACKAGE="squidanalyzer"
pascal@22811 4 VERSION="6.6"
pascal@22811 5 CATEGORY="network"
pascal@22811 6 SHORT_DESC="Squid proxy native log analyser and reports generator"
pascal@22811 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@22811 8 LICENSE="GPL3"
pascal@22811 9 TARBALL="$PACKAGE-$VERSION.tar.gz"
pascal@22811 10 WEB_SITE="http://squidanalyzer.darold.net/"
pascal@22811 11 WGET_URL="https://github.com/darold/squidanalyzer/archive/v$VERSION.tar.gz"
pascal@22811 12 CONFIG_FILES="/etc/squidanalyzer"
pascal@22811 13 TAGS="logs"
pascal@22811 14
pascal@22811 15 DEPENDS="perl squid"
pascal@22811 16 BUILD_DEPENDS="perl"
pascal@22811 17 SUGGESTED="logrotate"
pascal@22811 18
pascal@22811 19 # Rules to configure and make the package.
pascal@22811 20 compile_rules()
pascal@22811 21 {
pascal@22811 22 perl Makefile.PL INSTALLDIRS=site
pascal@22811 23 make &&
pascal@22811 24 make DESTDIR=$DESTDIR install
pascal@22811 25 }
pascal@22811 26
pascal@22811 27 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@22811 28 genpkg_rules()
pascal@22811 29 {
pascal@22811 30 mkdir -p $fs/usr
pascal@22811 31 cp -a $install/usr/bin $fs/usr
pascal@22811 32 cp -a $install/usr/lib $fs/usr
pascal@22811 33 cp -a $install/var $fs
pascal@22811 34 chown -R 80.80 $fs/var/www/squidanalyzer
pascal@22811 35 cp -a $install/etc $fs
pascal@22811 36 mkdir $fs/etc/initcron.d
pascal@22811 37 cat > $fs/etc/initcron.d/squidanalyzer <<EOT
pascal@22811 38
pascal@22811 39 # SquidAnalyzer log reporting daily
pascal@22811 40 0 2 * * * /usr/bin/squid-analyzer > /dev/null 2>&1
pascal@22811 41 EOT
pascal@22811 42 chmod +x $fs/etc/initcron.d/squidanalyzer
pascal@22811 43 }
pascal@22811 44
pascal@22811 45 # Pre and post install commands for Tazpkg.
pascal@22811 46 pre_remove()
pascal@22811 47 {
pascal@22811 48 if [ -z "$1" ]; then
pascal@22811 49 crontab -l 2> /dev/null | grep -q squidanalyzer || crontab - << EOT
pascal@22811 50 $(crontab -l 2> /dev/null | sed '/SquidAnalyzer/d;/squid-analyzer/d')
pascal@22811 51 EOT
pascal@22811 52 fi
pascal@22811 53 }
pascal@22811 54
pascal@22811 55 post_install()
pascal@22811 56 {
pascal@22811 57 if [ -z "$1" ]; then
pascal@22811 58 crontab -l 2> /dev/null | grep -q squidanalyzer || crontab - << EOT
pascal@22811 59 $(crontab -l 2> /dev/null)
pascal@22811 60 $(cat /etc/initcron.d/squidanalyzer)
pascal@22811 61 EOT
pascal@22811 62 chmod -x /etc/initcron.d/squidanalyzer
pascal@22811 63 fi
pascal@22811 64 if [ -d $1/etc/logrotate.d -a
pascal@22811 65 -z "$(ls $1/etc/logrotate.d | grep squid)" ]; then
pascal@22811 66 cat > $1/etc/logrotate.d/squidanalyzer <<EOT
pascal@22811 67 /var/log/proxy/squid-access.log {
pascal@22811 68 daily
pascal@22811 69 compress
pascal@22811 70 rotate 730
pascal@22811 71 missingok
pascal@22811 72 nocreate
pascal@22811 73 sharedscripts
pascal@22811 74 postrotate
pascal@22811 75 test ! -e /var/run/squid.pid || /usr/sbin/squid -k rotate
pascal@22811 76 /usr/bin/squid-analyzer -d -l /var/log/proxy/squid-access.log.1
pascal@22811 77 endscript
pascal@22811 78 }
pascal@22811 79 EOT
pascal@22811 80 fi
pascal@22811 81 }