wok rev 22811

Add squidanalyzer (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jan 31 15:49:51 2020 +0100 (2020-01-31)
parents b1bc9dfa69a2
children df98a48adee2
files squidanalyser/receipt squidanalyzer/receipt
line diff
     1.1 --- a/squidanalyser/receipt	Fri Jan 31 12:24:59 2020 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,81 +0,0 @@
     1.4 -# SliTaz package receipt.
     1.5 -
     1.6 -PACKAGE="squidanalyser"
     1.7 -VERSION="6.6"
     1.8 -CATEGORY="network"
     1.9 -SHORT_DESC="Squid proxy native log analyser and reports generator"
    1.10 -MAINTAINER="pascal.bellard@slitaz.org"
    1.11 -LICENSE="GPL3"
    1.12 -TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.13 -WEB_SITE="http://squidanalyzer.darold.net/"
    1.14 -WGET_URL="https://github.com/darold/squidanalyzer/archive/v$VERSION.tar.gz"
    1.15 -CONFIG_FILES="/etc/squidanalyzer"
    1.16 -TAGS="logs"
    1.17 -
    1.18 -DEPENDS="perl squid"
    1.19 -BUILD_DEPENDS="perl"
    1.20 -SUGGESTED="logrotate"
    1.21 -
    1.22 -# Rules to configure and make the package.
    1.23 -compile_rules()
    1.24 -{
    1.25 -	perl Makefile.PL INSTALLDIRS=site
    1.26 -	make &&
    1.27 -	make DESTDIR=$DESTDIR install
    1.28 -}
    1.29 -
    1.30 -# Rules to gen a SliTaz package suitable for Tazpkg.
    1.31 -genpkg_rules()
    1.32 -{
    1.33 -	mkdir -p $fs/usr
    1.34 -	cp -a $install/usr/bin $fs/usr
    1.35 -	cp -a $install/usr/lib $fs/usr
    1.36 -	cp -a $install/var $fs
    1.37 -	chown -R 80.80 $fs/var/www/squidanalyser
    1.38 -	cp -a $install/etc $fs
    1.39 -	mkdir $fs/etc/initcron.d
    1.40 -	cat > $fs/etc/initcron.d/squidanalyser <<EOT
    1.41 -
    1.42 -# SquidAnalyzer log reporting daily
    1.43 -0 2 * * * /usr/bin/squid-analyzer > /dev/null 2>&1
    1.44 -EOT
    1.45 -	chmod +x $fs/etc/initcron.d/squidanalyser
    1.46 -}
    1.47 -
    1.48 -# Pre and post install commands for Tazpkg.
    1.49 -pre_remove()
    1.50 -{
    1.51 -	if [ -z "$1" ]; then
    1.52 -		crontab -l 2> /dev/null | grep -q squidanalyser || crontab - << EOT
    1.53 -$(crontab -l 2> /dev/null | sed '/SquidAnalyzer/d;/squid-analyzer/d')
    1.54 -EOT
    1.55 -	fi
    1.56 -}
    1.57 -
    1.58 -post_install()
    1.59 -{
    1.60 -	if [ -z "$1" ]; then
    1.61 -		crontab -l 2> /dev/null | grep -q squidanalyser || crontab - << EOT
    1.62 -$(crontab -l 2> /dev/null)
    1.63 -$(cat /etc/initcron.d/squidanalyser)
    1.64 -EOT
    1.65 -		chmod -x /etc/initcron.d/squidanalyser
    1.66 -	fi
    1.67 -	if [ -d $1/etc/logrotate.d -a 
    1.68 -	     -z "$(ls $1/etc/logrotate.d | grep squid)" ]; then
    1.69 -		cat > $1/etc/logrotate.d/squidanalyser <<EOT
    1.70 -/var/log/proxy/squid-access.log {
    1.71 -	daily
    1.72 -	compress
    1.73 -	rotate 730
    1.74 -	missingok
    1.75 -	nocreate
    1.76 -	sharedscripts
    1.77 -	postrotate
    1.78 -		test ! -e /var/run/squid.pid || /usr/sbin/squid -k rotate
    1.79 -		/usr/bin/squid-analyzer -d -l /var/log/proxy/squid-access.log.1
    1.80 -	endscript
    1.81 -}
    1.82 -EOT
    1.83 -	fi
    1.84 -}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/squidanalyzer/receipt	Fri Jan 31 15:49:51 2020 +0100
     2.3 @@ -0,0 +1,81 @@
     2.4 +# SliTaz package receipt.
     2.5 +
     2.6 +PACKAGE="squidanalyzer"
     2.7 +VERSION="6.6"
     2.8 +CATEGORY="network"
     2.9 +SHORT_DESC="Squid proxy native log analyser and reports generator"
    2.10 +MAINTAINER="pascal.bellard@slitaz.org"
    2.11 +LICENSE="GPL3"
    2.12 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    2.13 +WEB_SITE="http://squidanalyzer.darold.net/"
    2.14 +WGET_URL="https://github.com/darold/squidanalyzer/archive/v$VERSION.tar.gz"
    2.15 +CONFIG_FILES="/etc/squidanalyzer"
    2.16 +TAGS="logs"
    2.17 +
    2.18 +DEPENDS="perl squid"
    2.19 +BUILD_DEPENDS="perl"
    2.20 +SUGGESTED="logrotate"
    2.21 +
    2.22 +# Rules to configure and make the package.
    2.23 +compile_rules()
    2.24 +{
    2.25 +	perl Makefile.PL INSTALLDIRS=site
    2.26 +	make &&
    2.27 +	make DESTDIR=$DESTDIR install
    2.28 +}
    2.29 +
    2.30 +# Rules to gen a SliTaz package suitable for Tazpkg.
    2.31 +genpkg_rules()
    2.32 +{
    2.33 +	mkdir -p $fs/usr
    2.34 +	cp -a $install/usr/bin $fs/usr
    2.35 +	cp -a $install/usr/lib $fs/usr
    2.36 +	cp -a $install/var $fs
    2.37 +	chown -R 80.80 $fs/var/www/squidanalyzer
    2.38 +	cp -a $install/etc $fs
    2.39 +	mkdir $fs/etc/initcron.d
    2.40 +	cat > $fs/etc/initcron.d/squidanalyzer <<EOT
    2.41 +
    2.42 +# SquidAnalyzer log reporting daily
    2.43 +0 2 * * * /usr/bin/squid-analyzer > /dev/null 2>&1
    2.44 +EOT
    2.45 +	chmod +x $fs/etc/initcron.d/squidanalyzer
    2.46 +}
    2.47 +
    2.48 +# Pre and post install commands for Tazpkg.
    2.49 +pre_remove()
    2.50 +{
    2.51 +	if [ -z "$1" ]; then
    2.52 +		crontab -l 2> /dev/null | grep -q squidanalyzer || crontab - << EOT
    2.53 +$(crontab -l 2> /dev/null | sed '/SquidAnalyzer/d;/squid-analyzer/d')
    2.54 +EOT
    2.55 +	fi
    2.56 +}
    2.57 +
    2.58 +post_install()
    2.59 +{
    2.60 +	if [ -z "$1" ]; then
    2.61 +		crontab -l 2> /dev/null | grep -q squidanalyzer || crontab - << EOT
    2.62 +$(crontab -l 2> /dev/null)
    2.63 +$(cat /etc/initcron.d/squidanalyzer)
    2.64 +EOT
    2.65 +		chmod -x /etc/initcron.d/squidanalyzer
    2.66 +	fi
    2.67 +	if [ -d $1/etc/logrotate.d -a 
    2.68 +	     -z "$(ls $1/etc/logrotate.d | grep squid)" ]; then
    2.69 +		cat > $1/etc/logrotate.d/squidanalyzer <<EOT
    2.70 +/var/log/proxy/squid-access.log {
    2.71 +	daily
    2.72 +	compress
    2.73 +	rotate 730
    2.74 +	missingok
    2.75 +	nocreate
    2.76 +	sharedscripts
    2.77 +	postrotate
    2.78 +		test ! -e /var/run/squid.pid || /usr/sbin/squid -k rotate
    2.79 +		/usr/bin/squid-analyzer -d -l /var/log/proxy/squid-access.log.1
    2.80 +	endscript
    2.81 +}
    2.82 +EOT
    2.83 +	fi
    2.84 +}