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