]>
Commit | Line | Data |
---|---|---|
8b821cae | 1 | Summary: Simple BIND statistics |
8ee4a005 | 2 | Summary(pl.UTF-8): Proste statystyki dla BINDa |
8b821cae TO |
3 | Name: dnsgraph |
4 | Version: 0.9 | |
f73a4f22 | 5 | Release: 0.1 |
8b821cae TO |
6 | License: GPL v2 |
7 | Group: Applications/Networking | |
026c1b67 | 8 | Source0: http://dl.sourceforge.net/dnsgraph/%{name}-%{version}.tar.gz |
8b821cae TO |
9 | # Source0-md5: 4847627fb3709bbe166d59e872225693 |
10 | Source1: %{name}.cron | |
fda13c12 | 11 | Source2: %{name}.conf |
8b821cae | 12 | URL: http://dnsgraph.sourceforge.net/ |
9f93ffe6 | 13 | BuildRequires: rpm-perlprov |
8b821cae TO |
14 | Requires(post,preun): grep |
15 | Requires(preun): fileutils | |
16 | BuildArch: noarch | |
17 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
18 | ||
19 | %define _dnsgraphdir %{_datadir}/%{name} | |
20 | ||
21 | %description | |
72167384 | 22 | Dnsgraph is a very simple DNS statistics RRDtool frontend for Bind |
8b821cae TO |
23 | (named) that produces daily, weekly, monthly, and yearly graphs of |
24 | success/failure, recursion/referral, nxrrset/nxdomain. | |
25 | ||
18a42158 | 26 | %description -l pl.UTF-8 |
72167384 | 27 | dnsgraph to bardzo prosty frontend dla RRDtoola do statystyk DNS dla |
18a42158 JR |
28 | Binda (named) tworzący dzienne, tygodniowe, miesięczne i roczne |
29 | wykresy powodzeń/niepowodzeń, rekurencji/odniesień, nxrrset/nxdomain. | |
72167384 | 30 | |
8b821cae TO |
31 | %prep |
32 | %setup -q | |
33 | ||
34 | %install | |
35 | rm -rf $RPM_BUILD_ROOT | |
36 | install -d $RPM_BUILD_ROOT{/etc/{cron.d,httpd},%{_dnsgraphdir}/html/imgs} | |
37 | ||
38 | install dnsanalise.pl dnsreport.pl $RPM_BUILD_ROOT%{_dnsgraphdir} | |
39 | ||
40 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.d/%{name} | |
41 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/httpd | |
42 | ||
43 | %clean | |
44 | rm -rf $RPM_BUILD_ROOT | |
45 | ||
46 | %post | |
47 | if [ -f /etc/httpd/httpd.conf ] && \ | |
de45b2f6 | 48 | ! grep -q "^Include.*/%{name}.conf" /etc/httpd/httpd.conf; then |
49 | echo "Include /etc/httpd/%{name}.conf" >> /etc/httpd/httpd.conf | |
50 | if [ -f /var/lock/subsys/httpd ]; then | |
8b821cae | 51 | apachectl restart |
de45b2f6 | 52 | fi |
8b821cae TO |
53 | fi |
54 | ||
55 | %preun | |
56 | if [ "$1" = "0" ]; then | |
de45b2f6 | 57 | umask 027 |
58 | grep -E -v "^Include.*%{name}.conf" /etc/httpd/httpd.conf > \ | |
59 | /etc/httpd/httpd.conf.tmp | |
60 | mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf | |
61 | if [ -f /var/lock/subsys/httpd ]; then | |
62 | apachectl restart | |
63 | fi | |
8b821cae TO |
64 | fi |
65 | ||
66 | %files | |
67 | %defattr(644,root,root,755) | |
68 | %doc README | |
69 | /etc/cron.d/%{name} | |
fda13c12 | 70 | %{_sysconfdir}/httpd/%{name}.conf |
8b821cae TO |
71 | %dir %{_dnsgraphdir} |
72 | %{_dnsgraphdir}/html | |
73 | %attr(755,root,root) %{_dnsgraphdir}/dns*.pl |