]> git.pld-linux.org Git - packages/mailgraph.git/blob - mailgraph.spec
- sync with HEAD version because 0.22 dies with C=pl_PL (this version not!)
[packages/mailgraph.git] / mailgraph.spec
1 #
2 # TODO:
3 # - write %post script with display short activatuion instruction
4 #   depending on information is httpd cnfig file is vanilla or not,
5 #
6 %include        /usr/lib/rpm/macros.perl
7 Summary:        Simple mail statistics for Postfix
8 Summary(pl):    Proste statystyki dla Postfiksa
9 Name:           mailgraph
10 Version:        1.8
11 Release:        1
12 License:        GPL v2
13 Group:          Applications/Networking
14 Source0:        http://people.ee.ethz.ch/~dws/software/mailgraph/pub/%{name}-%{version}.tar.gz
15 # Source0-md5:  f06cf84a49479529e9d280e78b7b34a9
16 Source1:        %{name}.init
17 Source2:        %{name}.sysconfig
18 Source3:        %{name}.conf
19 Patch0:         %{name}-paths.patch
20 Patch1:         %{name}-postfix_rbl.patch
21 URL:            http://people.ee.ethz.ch/~dws/software/mailgraph/
22 PreReq:         rc-scripts
23 Requires(post,preun):   /sbin/chkconfig
24 Requires(post,preun):   grep
25 Requires(preun):        fileutils
26 Requires:       postfix
27 BuildArch:      noarch
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %define         _pkglibdir              /var/lib/%{name}
31 %define         _httpappsdir            %{_datadir}/%{name}
32
33 %description
34 Mailgraph is a very simple mail statistics RRDtool frontend for
35 Postfix that produces daily, weekly, monthly and yearly graphs of
36 received/sent and bounced/rejected mail.
37
38 %description -l pl
39 Mailgraph to prosty frontend na RRDtool do statystyk pocztowych dla
40 Postfiksa. Produkuje wykresy dzienne, tygodniowe, miesiêczne i roczne
41 poczty wys³anej/odebranej i odbitej/odrzuconej.
42
43 %prep
44 %setup  -q
45 %patch0 -p1
46 %patch1 -p1
47
48 %install
49 rm -rf $RPM_BUILD_ROOT
50 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig,httpd},%{_bindir}} \
51         $RPM_BUILD_ROOT{%{_httpappsdir},%{_pkglibdir}}
52
53 install mailgraph.cgi $RPM_BUILD_ROOT%{_httpappsdir}/index.cgi
54 install mailgraph.pl $RPM_BUILD_ROOT%{_bindir}/mailgraph.pl
55
56 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
57 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/mailgraph
58 install %{SOURCE3} $RPM_BUILD_ROOT/etc/httpd/%{name}.conf
59
60 %clean
61 rm -rf $RPM_BUILD_ROOT
62
63 %post
64 /sbin/chkconfig --add %{name}
65 if [ -f /etc/httpd/httpd.conf ] && \
66      ! grep -q "^Include.*/%{name}.conf" /etc/httpd/httpd.conf; then
67         echo "Include /etc/httpd/%{name}.conf" >> /etc/httpd/httpd.conf
68         if [ -f /var/lock/subsys/httpd ]; then
69                 /etc/rc.d/init.d/httpd restart 1>&2
70         fi
71 fi
72 if [ -f /var/lock/subsys/%{name} ]; then
73         /etc/rc.d/init.d/%{name} restart 1>&2
74 else
75         echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
76 fi
77
78 %preun
79 if [ "$1" = "0" ]; then
80         umask 027
81         grep -E -v "^Include.*%{name}.conf" /etc/httpd/httpd.conf > \
82                 /etc/httpd/httpd.conf.tmp
83         mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
84         if [ -f /var/lock/subsys/httpd ]; then
85                 /etc/rc.d/init.d/httpd restart 1>&2
86         fi
87         if [ -f /var/lock/subsys/%{name} ]; then
88                 /etc/rc.d/init.d/%{name} stop 1>&2
89         fi
90         /sbin/chkconfig --del %{name}
91 fi
92
93 %files
94 %defattr(644,root,root,755)
95 %doc README CHANGES
96 %attr(755,root,root) %{_bindir}/mailgraph.pl
97 %attr(754,root,root) /etc/rc.d/init.d/mailgraph
98 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/mailgraph
99 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/httpd/mailgraph.conf
100 %dir %{_httpappsdir}
101 %attr(755,root,root) %{_httpappsdir}/index.cgi
102 %attr(750,root,http) %dir %{_pkglibdir}
This page took 0.257865 seconds and 3 git commands to generate.