## ## smokeping.spec -- OpenPKG RPM Package Specification ## Copyright (c) 2000-2005 OpenPKG Foundation e.V. ## Copyright (c) 2000-2005 Ralf S. Engelschall ## ## Permission to use, copy, modify, and distribute this software for ## any purpose with or without fee is hereby granted, provided that ## the above copyright notice and this permission notice appear in all ## copies. ## ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ## SUCH DAMAGE. ## # package information Name: smokeping Summary: Latency Logging and Graphing System URL: http://people.ee.ethz.ch/~oetiker/webtools/smokeping/ Vendor: Tobias Oetiker Packager: OpenPKG Distribution: OpenPKG Class: EVAL Group: Network License: GPL Version: 2.0.2 Release: 20050921 # list of sources Source0: http://people.ee.ethz.ch/~oetiker/webtools/smokeping/pub/smokeping-%{version}.tar.gz Source1: smokeping.conf Source2: smokeping.html Source3: rc.smokeping # build information Prefix: %{l_prefix} BuildRoot: %{l_buildroot} BuildPreReq: OpenPKG, openpkg >= 20040130 PreReq: OpenPKG, openpkg >= 20040130, perl, rrdtool, fping, MTA AutoReq: no AutoReqProv: no %description SmokePing is a latency logging and graphing system. It consists of a daemon process which organizes the latency measurements and a CGI which presents the graphs. %track prog smokeping = { version = %{version} url = http://people.ee.ethz.ch/~oetiker/webtools/smokeping/pub/ regex = smokeping-(__VER__)\.tar\.gz } %prep %setup -q # clean-up source tree find . -type f -name .#\* -exec rm -f {} \; # fix paths %{l_shtool} subst \ -e 's;^#!/.*$;#!%{l_prefix}/bin/perl;' \ -e 's;^\(use lib qw(\)[^)]*rrdtool[^)]*\()\;.*\)$;\1%{l_prefix}/lib/smokeping\2;' \ -e 's;^\(Smokeping::main("\).*\(")\;\)$;\1%{l_prefix}/etc/smokeping/smokeping.conf\2;' \ -e 's;^\(Smokeping::cgi("\).*\(")\;\)$;\1%{l_prefix}/etc/smokeping/smokeping.conf\2;' \ bin/smokeping.dist \ htdocs/smokeping.cgi.dist # fix typo %{l_shtool} subst \ -e 's;attache ;attached ;g' \ etc/smokemail.dist %build : %install rm -rf $RPM_BUILD_ROOT # create directories %{l_shtool} mkdir -f -p -m 755 \ $RPM_BUILD_ROOT%{l_prefix}/cgi/smokeping \ $RPM_BUILD_ROOT%{l_prefix}/etc/smokeping \ $RPM_BUILD_ROOT%{l_prefix}/lib/smokeping \ $RPM_BUILD_ROOT%{l_prefix}/sbin \ $RPM_BUILD_ROOT%{l_prefix}/share/smokeping \ $RPM_BUILD_ROOT%{l_prefix}/var/smokeping/dat \ $RPM_BUILD_ROOT%{l_prefix}/var/smokeping/img # install SmokePing %{l_shtool} install -c -m 755 %{l_value -s -a} \ bin/smokeping.dist \ $RPM_BUILD_ROOT%{l_prefix}/sbin/smokeping %{l_shtool} install -c -m 755 %{l_value -s -a} \ htdocs/smokeping.cgi.dist \ $RPM_BUILD_ROOT%{l_prefix}/cgi/smokeping/smokeping.cgi ( cd lib umask 022 %{l_tar} cf - . | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/smokeping/ ) || exit $? # install default configuration %{l_shtool} install -c -m 644 %{l_value -s -a} \ %{SOURCE smokeping.conf} \ %{SOURCE smokeping.html} \ $RPM_BUILD_ROOT%{l_prefix}/etc/smokeping/ %{l_shtool} mkln -s \ ../../etc/smokeping/smokeping.html \ $RPM_BUILD_ROOT%{l_prefix}/share/smokeping/ %{l_shtool} install -c -m 644 %{l_value -s -a} \ etc/smokemail.dist \ $RPM_BUILD_ROOT%{l_prefix}/etc/smokeping/smokemail # install run-command script %{l_shtool} mkdir -f -p -m 755 \ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d %{l_shtool} install -c -m 755 %{l_value -s -a} \ %{SOURCE rc.smokeping} \ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ # determine installation files %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \ '%config %{l_prefix}/etc/smokeping/*' \ '%dir %attr(1777,%{l_mgrp},%{l_mgrp}) %{l_prefix}/var/smokeping/img' %files -f files %clean rm -rf $RPM_BUILD_ROOT %post # after upgrade, restart service [ $1 -eq 2 ] || exit 0 eval `%{l_rc} smokeping status 2>/dev/null` [ ".$lighttpd_active" = .yes ] && %{l_rc} smokeping restart exit 0 %preun # before erase, stop service and remove archvies and image caches [ $1 -eq 0 ] || exit 0 %{l_rc} smokeping stop 2>/dev/null rm -rf $RPM_INSTALL_PREFIX/var/smokeping/dat/* >/dev/null 2>&1 || true rm -rf $RPM_INSTALL_PREFIX/var/smokeping/img/* >/dev/null 2>&1 || true exit 0