]> git.pld-linux.org Git - packages/dnsgraph.git/blob - dnsgraph.spec
- drop obsolete and outdated manual inclusion of rpm macros
[packages/dnsgraph.git] / dnsgraph.spec
1 %include        /usr/lib/rpm/macros.perl
2 Summary:        Simple BIND statistics
3 Summary(pl.UTF-8):      Proste statystyki dla BINDa
4 Name:           dnsgraph
5 Version:        0.9
6 Release:        0.1
7 License:        GPL v2
8 Group:          Applications/Networking
9 Source0:        http://dl.sourceforge.net/dnsgraph/%{name}-%{version}.tar.gz
10 # Source0-md5:  4847627fb3709bbe166d59e872225693
11 Source1:        %{name}.cron
12 Source2:        %{name}.conf
13 URL:            http://dnsgraph.sourceforge.net/
14 BuildRequires:  rpm-perlprov
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
23 Dnsgraph is a very simple DNS statistics RRDtool frontend for Bind
24 (named) that produces daily, weekly, monthly, and yearly graphs of
25 success/failure, recursion/referral, nxrrset/nxdomain.
26
27 %description -l pl.UTF-8
28 dnsgraph to bardzo prosty frontend dla RRDtoola do statystyk DNS dla
29 Binda (named) tworzący dzienne, tygodniowe, miesięczne i roczne
30 wykresy powodzeń/niepowodzeń, rekurencji/odniesień, nxrrset/nxdomain.
31
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 ] && \
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
52                 apachectl restart
53         fi
54 fi
55
56 %preun
57 if [ "$1" = "0" ]; then
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
65 fi
66
67 %files
68 %defattr(644,root,root,755)
69 %doc README
70 /etc/cron.d/%{name}
71 %{_sysconfdir}/httpd/%{name}.conf
72 %dir %{_dnsgraphdir}
73 %{_dnsgraphdir}/html
74 %attr(755,root,root) %{_dnsgraphdir}/dns*.pl
This page took 0.08598 seconds and 3 git commands to generate.