Группа :: Сети/WWW
Пакет: lightsquid
Главная Изменения Спек Патчи Загрузить Bugs and FR
Name: lightsquid
Version: 1.7
Release: alt0.M24.2
Packager: Slava Dubrovskiy <dubrsl at altlinux.ru>
Summary: Lite, small size and fast log analizer for squid proxy
Summary(ru_RU.KOI8-R): Легкий, маленький и быстрый анализатор лога для прокси сервера squid
License: GPL
Group: Networking/WWW
Url: http://lightsquid.sourceforge.net/
Source: %name-%version.tar.bz2
Source1: %name-init-db
Source2: %name.apache
Source3: %name.crond
Patch1: lightsquid-cgi.patch
Patch2: lightsquid-configs.patch
Patch3: lightsquid-ip2name.patch
Patch4: lightsquid.cfg.patch
BuildRequires: perl-CGI perl-GD2
Requires: webserver
BuildArch: noarch
%define apache_home %_var/www/html
%define apache_confdir %_sysconfdir/httpd/conf
%define apache_addonconfdir %apache_confdir/addon-modules.d
%define lightsquid_confdir %_sysconfdir/lightsquid
%define lightdir %apache_home/lightsquid
%set_strip_method none
%description
%name -- light squid report parser and visualyzer, generate sort of report
light
fast
no database required
no additional perl modules
small disk usage
template html - you can create you own look;
%description -l ru_RU.KOI8-R
%name -- легкий, быстрый анализатор лога прокси сервера squid.
Не требует базы данных
Не требует дополнительных модулей perl
Использует шаблоны html
%package apache
Summary: Config %name for apache
Summary(ru_RU.KOI8-R): Конфигурационный файл %name для вебсервера apache
License: GPL
Group: System/Servers
Requires: %name = %version-%release
Requires: apache-common
%description apache
Config %name for apache
%prep
%setup -q -n %name-%version
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
#%__subst "s|/var/www/html/lightsquid/lang|%_datadir/%name/lang|g" lightsquid.cfg
#%__subst "s|/var/www/html/lightsquid/tpl|%_datadir/%name/tpl|g" lightsquid.cfg
#%__subst "s|/var/www/html/lightsquid/ip2name|%_datadir/%name/ip2name|g" lightsquid.cfg
#%__subst "s|/var/www/html/lightsquid/report|%_localstatedir/%name|g" lightsquid.cfg
#%__subst "s|\$cfgpath =\"/var/www/html/lightsquid|\$cfgpath =\"%lightsquid_confdir|g" lightsquid.cfg
#%__subst "s|\$lockpath =\$reportpath|\$lockpath =\"%_lockdir/%name\"|g" lightsquid.cfg
#%__subst 's|require "ip2name|require "$ip2namepath|g' lightparser.pl
#%__subst "s|lightsquid.cfg|%lightsquid_confdir/lightsquid.cfg|g" *.cgi *.pl
#%__subst "s|common.pl|%_datadir/%name/common.pl|g" *.cgi *.pl
#%__subst "s|/etc/squid/users.txt|/etc/lightsquid/users.txt|g" ip2name/ip2name.*
%install
%__mkdir_p %buildroot%_sbindir
%__mkdir_p %buildroot%lightsquid_confdir
%__mkdir_p %buildroot%_sysconfdir/cron.d
%__mkdir_p %buildroot%_datadir/%name/{lang,ip2name,tpl}
%__mkdir_p %buildroot%apache_addonconfdir
%__mkdir_p %buildroot%_localstatedir/%name
%__mkdir_p %buildroot%lightdir
%__mkdir_p %buildroot%_lockdir/%name
# install bin
%__install -p -m 755 lightparser.pl %buildroot%_sbindir/
# install configs
%__install -p -m 644 lightsquid.cfg %buildroot%lightsquid_confdir/lightsquid.cfg
%__install -p -m 644 group.cfg.src %buildroot%lightsquid_confdir/group.cfg
%__install -p -m 644 realname.cfg %buildroot%lightsquid_confdir/realname.cfg
%__install -p -m 644 skipuser.cfg %buildroot%lightsquid_confdir/skipuser.cfg
%__install -m 750 %SOURCE1 %buildroot%_sbindir/%name-init-db
%__install -m 644 %SOURCE2 %buildroot%apache_addonconfdir/lightsquid.conf
%__install -m 644 %SOURCE3 %buildroot%_sysconfdir/cron.d/lightsquid
# install lib
%__install -p -m 644 common.pl %buildroot%_datadir/%name/
%__install -p -m 755 check-setup.pl %buildroot%_datadir/%name/
%__install -p -m 644 lang/[^A-Z]*.lng %buildroot%_datadir/%name/lang/
%__install -p -m 644 ip2name/[^A-Z]* %buildroot%_datadir/%name/ip2name/
%__cp -aRf tpl/[^A-Z]* %buildroot%_datadir/%name/tpl/
##%__install -p -m 644 tpl/[^A-Z]* %buildroot%_datadir/%name/tpl/
# install web
#%__install -p -m 644 .htaccess %buildroot%apache_home/%name/
%__install -p -m 755 [^A-Z]*.cgi %buildroot%apache_home/%name/
%pre
/usr/sbin/groupadd -r -f %name &> /dev/null ||:
/usr/sbin/useradd -r -g %name -G squid -d %_localstatedir/%name -c 'Log parser lightsquid' -s /bin/false -n %name &> /dev/null ||:
%post
if [[ -d %lightdir/report ]]; then
mv %lightdir/report/* %_localstatedir/%name
## rm -f %lightdir/report
echo "Reports move from %lightdir/report to %_localstatedir/%name"
fi
find %_localstatedir/%name -print0 | xargs -r0 chown %name:%name
%post apache
%post_service httpd
%files
%doc doc/*
%_sbindir/*
%_datadir/%name
%dir %lightsquid_confdir
%config(noreplace) %lightsquid_confdir/lightsquid.cfg
%config(noreplace) %lightsquid_confdir/group.cfg
%config(noreplace) %lightsquid_confdir/realname.cfg
%config(noreplace) %lightsquid_confdir/skipuser.cfg
%config %_sysconfdir/cron.d/lightsquid
%dir %attr(1775,root,%name) %_localstatedir/%name
%lightdir
%dir %attr(1775,root,%name) %_lockdir/%name
%files apache
%config(noreplace) %apache_addonconfdir/lightsquid.conf
%changelog
…
Полный changelog можно просмотреть здесь
Version: 1.7
Release: alt0.M24.2
Packager: Slava Dubrovskiy <dubrsl at altlinux.ru>
Summary: Lite, small size and fast log analizer for squid proxy
Summary(ru_RU.KOI8-R): Легкий, маленький и быстрый анализатор лога для прокси сервера squid
License: GPL
Group: Networking/WWW
Url: http://lightsquid.sourceforge.net/
Source: %name-%version.tar.bz2
Source1: %name-init-db
Source2: %name.apache
Source3: %name.crond
Patch1: lightsquid-cgi.patch
Patch2: lightsquid-configs.patch
Patch3: lightsquid-ip2name.patch
Patch4: lightsquid.cfg.patch
BuildRequires: perl-CGI perl-GD2
Requires: webserver
BuildArch: noarch
%define apache_home %_var/www/html
%define apache_confdir %_sysconfdir/httpd/conf
%define apache_addonconfdir %apache_confdir/addon-modules.d
%define lightsquid_confdir %_sysconfdir/lightsquid
%define lightdir %apache_home/lightsquid
%set_strip_method none
%description
%name -- light squid report parser and visualyzer, generate sort of report
light
fast
no database required
no additional perl modules
small disk usage
template html - you can create you own look;
%description -l ru_RU.KOI8-R
%name -- легкий, быстрый анализатор лога прокси сервера squid.
Не требует базы данных
Не требует дополнительных модулей perl
Использует шаблоны html
%package apache
Summary: Config %name for apache
Summary(ru_RU.KOI8-R): Конфигурационный файл %name для вебсервера apache
License: GPL
Group: System/Servers
Requires: %name = %version-%release
Requires: apache-common
%description apache
Config %name for apache
%prep
%setup -q -n %name-%version
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
#%__subst "s|/var/www/html/lightsquid/lang|%_datadir/%name/lang|g" lightsquid.cfg
#%__subst "s|/var/www/html/lightsquid/tpl|%_datadir/%name/tpl|g" lightsquid.cfg
#%__subst "s|/var/www/html/lightsquid/ip2name|%_datadir/%name/ip2name|g" lightsquid.cfg
#%__subst "s|/var/www/html/lightsquid/report|%_localstatedir/%name|g" lightsquid.cfg
#%__subst "s|\$cfgpath =\"/var/www/html/lightsquid|\$cfgpath =\"%lightsquid_confdir|g" lightsquid.cfg
#%__subst "s|\$lockpath =\$reportpath|\$lockpath =\"%_lockdir/%name\"|g" lightsquid.cfg
#%__subst 's|require "ip2name|require "$ip2namepath|g' lightparser.pl
#%__subst "s|lightsquid.cfg|%lightsquid_confdir/lightsquid.cfg|g" *.cgi *.pl
#%__subst "s|common.pl|%_datadir/%name/common.pl|g" *.cgi *.pl
#%__subst "s|/etc/squid/users.txt|/etc/lightsquid/users.txt|g" ip2name/ip2name.*
%install
%__mkdir_p %buildroot%_sbindir
%__mkdir_p %buildroot%lightsquid_confdir
%__mkdir_p %buildroot%_sysconfdir/cron.d
%__mkdir_p %buildroot%_datadir/%name/{lang,ip2name,tpl}
%__mkdir_p %buildroot%apache_addonconfdir
%__mkdir_p %buildroot%_localstatedir/%name
%__mkdir_p %buildroot%lightdir
%__mkdir_p %buildroot%_lockdir/%name
# install bin
%__install -p -m 755 lightparser.pl %buildroot%_sbindir/
# install configs
%__install -p -m 644 lightsquid.cfg %buildroot%lightsquid_confdir/lightsquid.cfg
%__install -p -m 644 group.cfg.src %buildroot%lightsquid_confdir/group.cfg
%__install -p -m 644 realname.cfg %buildroot%lightsquid_confdir/realname.cfg
%__install -p -m 644 skipuser.cfg %buildroot%lightsquid_confdir/skipuser.cfg
%__install -m 750 %SOURCE1 %buildroot%_sbindir/%name-init-db
%__install -m 644 %SOURCE2 %buildroot%apache_addonconfdir/lightsquid.conf
%__install -m 644 %SOURCE3 %buildroot%_sysconfdir/cron.d/lightsquid
# install lib
%__install -p -m 644 common.pl %buildroot%_datadir/%name/
%__install -p -m 755 check-setup.pl %buildroot%_datadir/%name/
%__install -p -m 644 lang/[^A-Z]*.lng %buildroot%_datadir/%name/lang/
%__install -p -m 644 ip2name/[^A-Z]* %buildroot%_datadir/%name/ip2name/
%__cp -aRf tpl/[^A-Z]* %buildroot%_datadir/%name/tpl/
##%__install -p -m 644 tpl/[^A-Z]* %buildroot%_datadir/%name/tpl/
# install web
#%__install -p -m 644 .htaccess %buildroot%apache_home/%name/
%__install -p -m 755 [^A-Z]*.cgi %buildroot%apache_home/%name/
%pre
/usr/sbin/groupadd -r -f %name &> /dev/null ||:
/usr/sbin/useradd -r -g %name -G squid -d %_localstatedir/%name -c 'Log parser lightsquid' -s /bin/false -n %name &> /dev/null ||:
%post
if [[ -d %lightdir/report ]]; then
mv %lightdir/report/* %_localstatedir/%name
## rm -f %lightdir/report
echo "Reports move from %lightdir/report to %_localstatedir/%name"
fi
find %_localstatedir/%name -print0 | xargs -r0 chown %name:%name
%post apache
%post_service httpd
%files
%doc doc/*
%_sbindir/*
%_datadir/%name
%dir %lightsquid_confdir
%config(noreplace) %lightsquid_confdir/lightsquid.cfg
%config(noreplace) %lightsquid_confdir/group.cfg
%config(noreplace) %lightsquid_confdir/realname.cfg
%config(noreplace) %lightsquid_confdir/skipuser.cfg
%config %_sysconfdir/cron.d/lightsquid
%dir %attr(1775,root,%name) %_localstatedir/%name
%lightdir
%dir %attr(1775,root,%name) %_lockdir/%name
%files apache
%config(noreplace) %apache_addonconfdir/lightsquid.conf
%changelog
…
Полный changelog можно просмотреть здесь