From 8b821cae47e1278c28af857cdf9d5b4c8b9cf280 Mon Sep 17 00:00:00 2001 From: Tomek Orzechowski Date: Wed, 18 Feb 2004 17:29:18 +0000 Subject: [PATCH] - initial Changed files: dnsgraph.spec -> 1.1 --- dnsgraph.spec | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 dnsgraph.spec diff --git a/dnsgraph.spec b/dnsgraph.spec new file mode 100644 index 0000000..d41b1bc --- /dev/null +++ b/dnsgraph.spec @@ -0,0 +1,69 @@ +%include /usr/lib/rpm/macros.perl +Summary: Simple BIND statistics +Summary(pl): Proste statystyki dla BINDa +Name: dnsgraph +Version: 0.9 +Release: 1 +License: GPL v2 +Group: Applications/Networking +Source0: http://dl.sourceforge.net/%{name}/%{name}-%{version}.tar.gz +# Source0-md5: 4847627fb3709bbe166d59e872225693 +Source1: %{name}.cron +Source1: %{name}.conf +Patch0: %{name}-what.patch +URL: http://dnsgraph.sourceforge.net/ +Requires(post,preun): grep +Requires(preun): fileutils +BuildArch: noarch +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +%define _dnsgraphdir %{_datadir}/%{name} + +%description +Dnsgraph is a very simple dns statistics RRDtool frontend for Bind +(named) that produces daily, weekly, monthly, and yearly graphs of +success/failure, recursion/referral, nxrrset/nxdomain. + +%prep +%setup -q + +%install +rm -rf $RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT{/etc/{cron.d,httpd},%{_dnsgraphdir}/html/imgs} + +install dnsanalise.pl dnsreport.pl $RPM_BUILD_ROOT%{_dnsgraphdir} + +install %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.d/%{name} +install %{SOURCE2} $RPM_BUILD_ROOT/etc/httpd + +%clean +rm -rf $RPM_BUILD_ROOT + +%post +if [ -f /etc/httpd/httpd.conf ] && \ + ! grep -q "^Include.*/%{name}.conf" /etc/httpd/httpd.conf; then + echo "Include /etc/httpd/%{name}.conf" >> /etc/httpd/httpd.conf + if [ -f /var/lock/subsys/httpd ]; then + apachectl restart + fi +fi + +%preun +if [ "$1" = "0" ]; then + umask 027 + grep -E -v "^Include.*%{name}.conf" /etc/httpd/httpd.conf > \ + /etc/httpd/httpd.conf.tmp + mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf + if [ -f /var/lock/subsys/httpd ]; then + apachectl restart + fi +fi + +%files +%defattr(644,root,root,755) +%doc README +/etc/cron.d/%{name} +/etc/httpd/%{name}.conf +%dir %{_dnsgraphdir} +%{_dnsgraphdir}/html +%attr(755,root,root) %{_dnsgraphdir}/dns*.pl -- 2.44.0