lstat.spec
Jan Palus
jan.palus at student.put.poznan.pl
Fri Nov 4 23:33:20 CET 2005
I attached some patches to lstat.spec:
- /usr/share/lstat/statimg directory moved to /var/lib/lstat and
linked to /usr/share/lstat/statimg - its content changes when lstat
is running
- FollowSymLinks option was enabled in apache configs to make statimg
and doc accessible
- /usr/share/lstat/{,edit}/.htaccess files were moved to
/etc/lstat/htaccess.{edit,view} (I'm not sure about the naming
convention) and linked to their previous locations
- Reqs were corrected
- disabled building lstat with mod_perl1 support (with mod_perl1 live
graphs are not generated for me)
Please review the patches and if good enough add them to repo. Thanks.
--
atler
-------------- next part --------------
Index: lstat.spec
===================================================================
RCS file: /cvsroot/SPECS/lstat.spec,v
retrieving revision 1.57
diff -u -r1.57 lstat.spec
--- lstat.spec 17 Oct 2005 06:05:33 -0000 1.57
+++ lstat.spec 29 Oct 2005 20:07:31 -0000
@@ -2,9 +2,6 @@
# TODO:
# - allow to show while configure where are: "w","users","sh","ipchains","df","fping","ifconfig","install","perl","chmod","iptables","uptime","htpasswd"
# Or guess it...
-# - make .htaccess files in /etc/lstat and symlink them into proper places...
-# - /usr/share/lstat/statimg should be in /var?
-# - /en/ docs in .pl?
# Conditional build:
%bcond_with apache1
#
@@ -13,7 +10,7 @@
Summary(pl): LinuxStat służy do generowania i prezentacji różnych statystyk
Name: lstat
Version: 2.3.2
-Release: 10.2
+Release: 11.1
Epoch: 1
License: GPL
Group: Applications/Networking
@@ -24,6 +21,8 @@
Patch1: %{name}-PLD.patch
Patch2: %{name}-perlhandler.patch
Patch3: %{name}-permission.patch
+Patch4: %{name}-statimg.patch
+Patch5: %{name}-htaccess.patch
URL: http://lstat.sourceforge.net/
BuildRequires: apache%{?with_apache1:1}-mod_auth
BuildRequires: perl-base
@@ -37,10 +36,11 @@
Requires(post,preun): grep
Requires(preun): apache
Requires(preun): fileutils
+Requires: perl-CGI
+Requires: perl-rrdtool
%if %{with apache1}
Requires: apache1-mod_auth
Requires: apache1-mod_dir
-Requires: apache1-mod_perl
%else
Requires: apache-mod_auth
Requires: apache-mod_dir
@@ -86,12 +86,13 @@
%patch1 -p1
%patch2 -p1
%patch3 -p1
+%patch4 -p1
+%patch5 -p1
%build
%{__perl} ./configure \
--apache \
%if %{with apache1}
- --mod_perl1 \
--with-lstatconf=/etc/apache/conf.d/ \
%else
--mod_perl2 \
@@ -104,6 +105,7 @@
--with-www=%{_wwwrootdir}/lstat \
--with-rrd=%{_pkglibdir}/rrd \
--with-pages=%{_pkglibdir}/pages \
+ --with-statimg=%{_pkglibdir}/statimg \
--with-objects=%{_pkglibdir}/objects \
--with-templates=%{_pkglibdir}/templates \
--with-wwwuser=%{_wwwuser} \
@@ -122,6 +124,16 @@
install %{SOURCE1} $RPM_BUILD_ROOT%{_initdir}/lstatd
rm -rf $RPM_BUILD_ROOT%{_wwwrootdir}/lstat/doc
ln -sf %{_docdir}/%{name}-%{version} $RPM_BUILD_ROOT%{_wwwrootdir}/lstat/doc
+rm -rf $RPM_BUILD_ROOT%{_wwwrootdir}/lstat/statimg
+ln -sf %{_pkglibdir}/statimg $RPM_BUILD_ROOT%{_wwwrootdir}/lstat/statimg
+rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/lstat/users
+touch $RPM_BUILD_ROOT%{_sysconfdir}/lstat/users
+rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/lstat/htaccess.{view,edit}
+touch $RPM_BUILD_ROOT%{_sysconfdir}/lstat/htaccess.{view,edit}
+rm -rf $RPM_BUILD_ROOT%{_wwwrootdir}/lstat/.htaccess
+ln -sf %{_sysconfdir}/lstat/htaccess.view $RPM_BUILD_ROOT%{_wwwrootdir}/lstat/.htaccess
+rm -rf $RPM_BUILD_ROOT%{_wwwrootdir}/lstat/edit/.htaccess
+ln -sf %{_sysconfdir}/lstat/htaccess.edit $RPM_BUILD_ROOT%{_wwwrootdir}/lstat/edit/.htaccess
%if %{with apache1}
sed -i -e "s#lstat/#lstat#g" $RPM_BUILD_ROOT%{_sysconfdir}/apache/conf.d/lstat.conf
@@ -134,6 +146,7 @@
%pre
test -h %{_wwwrootdir}/lstat/doc || rm -rf %{_wwwrootdir}/lstat/doc
+test -h %{_wwwrootdir}/lstat/statimg || rm -rf %{_wwwrootdir}/lstat/statimg
%post
/sbin/chkconfig --add lstatd
@@ -183,7 +196,10 @@
sed -i -e "s#/home/services/apache/lstat/#/usr/share/lstat/#g" /etc/lstat/config
fi
if [ -s /home/services/apache/lstat/.htaccess ]; then
- mv /home/services/apache/lstat/.htaccess /usr/share/lstat/
+ mv /home/services/apache/lstat/.htaccess /etc/lstat/htaccess.view
+fi
+if [ -s /home/services/apache/lstat/edit/.htaccess ]; then
+ mv /home/services/apache/lstat/edit/.htaccess /etc/lstat/htaccess.edit
fi
%else
if [ -s /etc/httpd/httpd.conf/lstat.conf ]; then
@@ -193,9 +209,18 @@
sed -i -e "s#/home/services/httpd/lstat/#/usr/share/lstat/#g" /etc/lstat/config
fi
if [ -s /home/services/httpd/lstat/.htaccess ]; then
- mv /home/services/httpd/lstat/.htaccess /usr/share/lstat/
+ mv /home/services/httpd/lstat/.htaccess /etc/lstat/htaccess.view
+fi
+if [ -s /home/services/httpd/lstat/edit/.htaccess ]; then
+ mv /home/services/httpd/lstat/edit/.htaccess /etc/lstat/htaccess.edit
fi
%endif
+if [ -s /usr/share/lstat/.htaccess -a ! -L /usr/share/lstat/.htaccess ]; then
+ mv /usr/share/lstat/.htaccess /etc/lstat/htaccess.view
+fi
+if [ -s /usr/share/lstat/edit/.htaccess -a ! -L /usr/share/lstat/edit/.htaccess ]; then
+ mv /usr/share/lstat/edit/.htaccess /etc/lstat/htaccess.edit
+fi
%files
%defattr(644,root,root,755)
@@ -203,6 +228,9 @@
%attr(754,root,root) %{_initdir}/lstatd
%dir %{_sysconfdir}/lstat
%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/lstat/config
+%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/lstat/htaccess.view
+%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/lstat/htaccess.edit
+%config(noreplace missingok) %verify(not size mtime md5) %{_sysconfdir}/lstat/users
%if %{with apache1}
%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/apache/conf.d/lstat.conf
%else
@@ -210,11 +238,13 @@
%endif
%dir %{_wwwrootdir}/lstat
%{_wwwrootdir}/lstat/doc
+%{_wwwrootdir}/lstat/statimg
+%{_wwwrootdir}/lstat/.htaccess
%dir %{_wwwrootdir}/lstat/icons
%dir %{_wwwrootdir}/lstat/skins
%dir %{_wwwrootdir}/lstat/edit
+%{_wwwrootdir}/lstat/edit/.htaccess
%dir %{_pkglibdir}
-%attr(700,http,http) %dir %{_wwwrootdir}/lstat/statimg
%attr(755,root,root) %{_wwwrootdir}/lstat/edit/edit.cgi
%attr(755,root,root) %{_wwwrootdir}/lstat/lstat.cgi
%{_wwwrootdir}/lstat/skins/*
@@ -224,6 +254,7 @@
%attr(755,root,root) %{_bindir}/security_lstat
%attr(755,root,root) %{_bindir}/Mkgraph.pl
%{perl_vendorlib}/*
+%attr(700,http,http) %dir %{_pkglibdir}/statimg
%dir %{_pkglibdir}/rrd
%attr(700,http,http) %dir %{_pkglibdir}/objects
%attr(700,http,http) %dir %{_pkglibdir}/pages
-------------- next part --------------
Index: lstat-perlhandler.patch
===================================================================
RCS file: /cvsroot/SOURCES/lstat-perlhandler.patch,v
retrieving revision 1.3
diff -u -r1.3 lstat-perlhandler.patch
--- lstat-perlhandler.patch 19 Dec 2004 13:48:26 -0000 1.3
+++ lstat-perlhandler.patch 29 Oct 2005 20:23:19 -0000
@@ -1,12 +1,26 @@
-diff -urN lstat-2.3.2.org/src/misc/lstat.conf.mp.in lstat-2.3.2/src/misc/lstat.conf.mp.in
---- lstat-2.3.2.org/src/misc/lstat.conf.mp.in 2002-11-22 13:11:31.000000000 +0100
-+++ lstat-2.3.2/src/misc/lstat.conf.mp.in 2004-12-19 14:42:33.686446968 +0100
-@@ -5,8 +5,10 @@
+diff -Nur lstat-2.3.2.orig/src/misc/lstat.conf.in lstat-2.3.2/src/misc/lstat.conf.in
+--- lstat-2.3.2.orig/src/misc/lstat.conf.in 2005-10-29 20:46:19.000000000 +0200
++++ lstat-2.3.2/src/misc/lstat.conf.in 2005-10-29 20:42:55.000000000 +0200
+@@ -2,7 +2,7 @@
+ Alias @@PNGURL@@ "@@WWWDIR@@"
<Directory "@@WWWDIR@@">
#for execute CGI files
- Options ExecCGI
+-Options ExecCGI
++Options ExecCGI FollowSymLinks
+ AddHandler cgi-script .cgi
+ AllowOverride AuthConfig Limit
+ DirectoryIndex lstat.cgi
+diff -Nur lstat-2.3.2.orig/src/misc/lstat.conf.mp.in lstat-2.3.2/src/misc/lstat.conf.mp.in
+--- lstat-2.3.2.orig/src/misc/lstat.conf.mp.in 2005-10-29 20:42:04.000000000 +0200
++++ lstat-2.3.2/src/misc/lstat.conf.mp.in 2005-10-29 20:43:16.000000000 +0200
+@@ -4,9 +4,11 @@
+ Alias @@PNGURL@@ "@@WWWDIR@@"
+ <Directory "@@WWWDIR@@">
+ #for execute CGI files
+-Options ExecCGI
-AddHandler perl-script .cgi
-PerlHandler ModPerl::Registry::handler
++Options ExecCGI FollowSymLinks
+# AddHandler perl-script .cgi
+AddHandler cgi-script .cgi
+# PerlHandler ModPerl::Registry::handler
-------------- next part --------------
diff -Nur lstat-2.3.2/src/security_lstat.in lstat-2.3.2.new/src/security_lstat.in
--- lstat-2.3.2/src/security_lstat.in 2005-10-29 21:31:11.000000000 +0200
+++ lstat-2.3.2.new/src/security_lstat.in 2005-10-29 21:30:56.000000000 +0200
@@ -8,12 +8,12 @@
#my $wwwdir="@@ WWWDIR@@";
#my $usersfile="@@ ETCDIR@@users";
#my $htpass ="@@ htpasswd@@";
-my $wwwdir="@@WWWDIR@@";
+my $etcdir="@@ETCDIR@@";
my $usersfile="@@ETCDIR@@users";
my $htpass ="@@htpasswd@@";
-my $htread=$wwwdir.'.htaccess';
-my $htedit=$wwwdir.'edit/.htaccess';
+my $htread=$etcdir.'htaccess.view';
+my $htedit=$etcdir.'htaccess.edit';
my $dialog='';
my ($key, $msg, $cmd);
-------------- next part --------------
diff -Nur lstat-2.3.2/configure lstat-2.3.2.new/configure
--- lstat-2.3.2/configure 2004-10-23 22:16:11.000000000 +0200
+++ lstat-2.3.2.new/configure 2005-10-29 18:01:52.000000000 +0200
@@ -41,6 +41,7 @@
my $rrddir="";
my $objectsdir="";
my $initrcdir="";
+my $statimgdir="";
my $pngurl="/lstat/";
my $apache=0;
@@ -79,6 +80,7 @@
'--with-pages=s' => \$pagesdir,
'--with-objects=s' => \$objectsdir,
'--with-initrc=s' => \$initrcdir,
+ '--with-statimg=s' => \$statimgdir,
'--with-pngurl=s' => \$pngurl,
'--with-mountpoint=s' => \@filesystems,
'--with-interface=s' => \@inters,
@@ -124,6 +126,8 @@
addslash (\$rrddir);
$initrcdir='/etc/rc.d/init.d/' if (! $initrcdir);
addslash (\$rrddir);
+$statimgdir=$etcdir.'statimg/' if (! $statimgdir);
+addslash (\$statimgdir);
$httpdconf='/etc/httpd/conf/httpd.conf' if (! $httpdconf);
$pngurl='/lstat/' if (! $pngurl);
addslash (\$pngurl);
@@ -232,6 +236,7 @@
$dict {"OBJECTSDIR"}=$objectsdir;
$dict {"RRDDIR"}=$rrddir;
$dict {"PAGESDIR"}=$pagesdir;
+$dict {"STATIMGDIR"}=$statimgdir;
$dict {"WWWDIR"}=$wwwdir;
$dict {"PNGURL"}=$pngurl;
$dict {"APACHE"}=$apache;
@@ -338,6 +343,7 @@
--with-objects=DIR
--with-rrd=DIR
--with-initrc=DIR
+ --with-statimg=DIR
--with-www=DIR
--with-pngurl=RELATIVE_URL
@@ -397,6 +403,9 @@
--with-initrc=DIR
program init script directory (default /etc/rc.d/init)
+--with-statimg=DIR
+program statimg directory (PNG images of graphs) (default ETCDIR/statimg)
+
--with-www=DIR
program www (HTML, images and CGI) directory (default PREFIX/www)
diff -Nur lstat-2.3.2/Makefile.in lstat-2.3.2.new/Makefile.in
--- lstat-2.3.2/Makefile.in 2005-10-29 20:47:30.000000000 +0200
+++ lstat-2.3.2.new/Makefile.in 2005-10-29 18:11:49.000000000 +0200
@@ -9,6 +9,7 @@
TEMPLATESDIR=@@TEMPLATESDIR@@
OBJECTSDIR=@@OBJECTSDIR@@
PAGESDIR=@@PAGESDIR@@
+STATIMGDIR=@@STATIMGDIR@@
ETCDIR=@@ETCDIR@@
RRDDIR=@@RRDDIR@@
WWWDIR=@@WWWDIR@@
@@ -101,7 +102,7 @@
@${INSTALL} -p -m 644 ${SRCDIR}/images/skins/sky/uni/* $(DESTDIR)${WWWDIR}/skins/sky/uni
@echo "Instaling CGI scripts"
- @${INSTALL} -p -m 700 -d $(DESTDIR)${WWWDIR}statimg
+ @${INSTALL} -p -m 700 -d $(DESTDIR)${STATIMGDIR}
@${INSTALL} -d $(DESTDIR)${WWWDIR}edit
@${INSTALL} -p -m 755 ${SRCDIR}/lstat.cgi $(DESTDIR)${WWWDIR}
@${INSTALL} -p -m 755 ${SRCDIR}/edit.cgi $(DESTDIR)${WWWDIR}edit
diff -Nur lstat-2.3.2/src/lib/config.in lstat-2.3.2.new/src/lib/config.in
--- lstat-2.3.2/src/lib/config.in 2005-10-29 20:47:30.000000000 +0200
+++ lstat-2.3.2.new/src/lib/config.in 2005-10-29 18:13:15.000000000 +0200
@@ -9,7 +9,7 @@
RRD_DIR=@@RRDDIR@@
OBJ_DIR=@@OBJECTSDIR@@
PNG_DIR=@@WWWDIR@@
-STAT_PNG_DIR=@@WWWDIR@@statimg/
+STAT_PNG_DIR=@@STATIMGDIR@@
PNG_URL=@@PNGURL@@
DOC_URL=@@PNGURL@@doc/
STAT_PNG_URL=@@PNGURL@@statimg/
@@ -36,4 +36,4 @@
W=@@w@@
WWWUSER=@@WWWUSER@@
WWWGROUP=@@WWWGROUP@@
-
\ No newline at end of file
+
More information about the pld-devel-en
mailing list