OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /e/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-src Date: 26-Dec-2004 19:57:25 Branch: HEAD Handle: 2004122618572500 Modified files: openpkg-src/flow2rrd flow2rrd.spec Log: upgrade to 0.9.1 and hook into Apache Summary: Revision Changes Path 1.5 +30 -14 openpkg-src/flow2rrd/flow2rrd.spec ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-src/flow2rrd/flow2rrd.spec ============================================================================ $ cvs diff -u -r1.4 -r1.5 flow2rrd.spec --- openpkg-src/flow2rrd/flow2rrd.spec 26 Dec 2004 18:38:50 -0000 1.4 +++ openpkg-src/flow2rrd/flow2rrd.spec 26 Dec 2004 18:57:25 -0000 1.5 @@ -33,7 +33,7 @@ Class: EVAL Group: Network License: GPL -Version: 0.9.0 +Version: 0.9.1 Release: 20041226 # list of sources @@ -47,7 +47,7 @@ PreReq: perl, perl-time, perl-text, perl-net, perl-www PreReq: cfg, cfg::with_perl = yes PreReq: flowtools, flowtools::with_perl = yes -PreReq: rrdtool +PreReq: rrdtool, apache AutoReq: no AutoReqProv: no @@ -71,18 +71,11 @@ ./configure \ --prefix=%{l_prefix} \ --sysconfdir=%{l_prefix}/etc/flow2rrd \ + --localstatedir=%{l_prefix}/var/flow2rrd \ --with-perl=%{l_prefix}/bin/perl \ --with-pod2man=%{l_prefix}/bin/pod2man %{l_make} %{l_mflags} - # adjust paths - %{l_shtool} subst \ - -e 's;flow2rrd\.cfg;%{l_prefix}/etc/flow2rrd/flow2rrd.cfg;g' \ - flow2rrd - %{l_shtool} subst \ - -e 's;/var/tmp/flow2rrd.rrd;%{l_prefix}/var/flow2rrd/flow2rrd.rrd;' \ - flow2rrd.cfg - # create storage wrapper for flow-capture(1)'s -R option ( echo "#!/bin/sh" echo "if [ \$# -ne 1 ]; then" @@ -101,10 +94,6 @@ %{l_shtool} install -c -m 755 \ flow2rrd-store $RPM_BUILD_ROOT%{l_prefix}/bin/ - # create directory of default RRD - %{l_shtool} mkdir -f -p -m 755 \ - $RPM_BUILD_ROOT%{l_prefix}/var/flow2rrd - # determine installation files %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ %{l_files_std} \ @@ -116,3 +105,30 @@ %clean rm -rf $RPM_BUILD_ROOT +%post + if [ ".$1" = .1 ]; then + # add hook to Apache configuration + apacheconf="$RPM_INSTALL_PREFIX/etc/apache/apache.conf" + if [ -f $apacheconf ]; then + ( echo "ScriptAlias /flow2rrd $RPM_INSTALL_PREFIX/bin/flow2rrd" + ) | $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \ + -a -i "$RPM_INSTALL_PREFIX:flow2rrd" $apacheconf + fi + fi + +%preun + # before erase, remove RRD + [ $1 -eq 0 ] || exit 0 + rm -f $RPM_INSTALL_PREFIX/var/flow2rrd/* >/dev/null 2>&1 || true + exit 0 + +%postun + if [ ".$1" = .0 ]; then + # remove hook from Apache configuration + apacheconf="$RPM_INSTALL_PREFIX/etc/apache/apache.conf" + if [ -f $apacheconf ]; then + $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \ + -r -i "$RPM_INSTALL_PREFIX:flow2rrd" $apacheconf + fi + fi + @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org