-
Notifications
You must be signed in to change notification settings - Fork 0
/
isoqlog.spec
239 lines (217 loc) · 9.95 KB
/
isoqlog.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
Name: isoqlog
Summary: Isoqlog is an MTA log analysis program written in C.
Version: 2.2.1
Release: 1%{?dist}
License: BSD
Group: Monitoring
Vendor: QmailToaster
Packager: Eric Shubert <[email protected]>
URL: http://www.enderunix.org/isoqlog/
Source0: http://www.enderunix.org/isoqlog/isoqlog-%{version}.tar.gz
Source1: isoqlog.module
Source2: isoqlog.conf
Source3: isoqlog.cron.sh
Source4: index.html
Source5: days.html
Source6: domain.html
Source7: daily.html
Source8: monthly.html
Source9: generaldomain.html
Source10: generaldaily.html
Source11: generalmonthly.html
Source12: generalyearly.html
Source13: isoqlog.httpd.conf
Requires: control-panel
Obsoletes: isoqlog-toaster
Obsoletes: isoqlog-toaster-doc
BuildRoot: %{_topdir}/BUILDROOT/%{name}-%{version}-%{release}.%{_arch}
%define apacheuser apache
%define apachegroup apache
%define crontab /etc/crontab
%define debug_package %{nil}
%define basedir %{_datadir}/toaster
%define isoqdir %{basedir}/isoqlog
#----------------------------------------------------------------------------
%description
#----------------------------------------------------------------------------
Isoqlog is an MTA log analysis program written in C. It is
designed to scan qmail, postfix, sendmail logfiles and
produce usage statistics in HTML format. for viewing through a
browser. It produces Top domains output according to Incoming,
Outgoing, total mails and bytes, it keeps your main domain
mail statistics with Days Top Domain, Top Users values for per
day, per month, and years.
#----------------------------------------------------------------------------
%prep
#----------------------------------------------------------------------------
%setup -q
# CVS cleanup
#----------------------------------------------------------------------------
for i in `find . -type d -name CVS` `find . -type f -name .cvs\*` `find . -type f -name .#\*`; do
if [ -e "$i" ]; then rm -r $i; fi >&/dev/null
done
#----------------------------------------------------------------------------
%build
#----------------------------------------------------------------------------
./configure \
--prefix=%{_prefix} \
--exec-prefix=%{_exec_prefix} \
--bindir=%{_bindir} \
--sbindir=%{_sbindir} \
--sysconfdir=%{_sysconfdir}/%{name} \
--datadir=%{_datadir} \
--includedir=%{_includedir} \
--libdir=%{_libdir} \
--libexecdir=%{_libexecdir} \
--localstatedir=%{_localstatedir} \
--sharedstatedir=%{_sharedstatedir} \
--mandir=%{_mandir} \
--infodir=%{_infodir}
make
#----------------------------------------------------------------------------
%install
#----------------------------------------------------------------------------
rm -rf %{buildroot}
make DESTDIR="%{buildroot}" install
# Write the module into the control panel
# (shubes) Why?
#install %{SOURCE1} %{_builddir}/%{name}-%{version}
install -d %{buildroot}%{_docdir}/%{name}
install -d %{buildroot}%{basedir}/include
install -d %{buildroot}%{_datadir}/%{name}/htdocs
install %{SOURCE1} %{buildroot}%{basedir}/include
install -Dp %{SOURCE13} %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf
install -Dp %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name}/isoqlog.conf
install -Dp %{SOURCE3} %{buildroot}%{isoqdir}/bin/cron.sh
#mv %{buildroot}/%{basedir}/doc/isoqlog/* %{buildroot}/%{_docdir}/%{name}/
mv %{buildroot}/usr/etc/isoqlog.conf-dist %{buildroot}/%{_sysconfdir}/%{name}
mv %{buildroot}/usr/etc/isoqlog.domains-dist %{buildroot}/%{_sysconfdir}/%{name}
install -Dp %{SOURCE4} %{buildroot}%{_datadir}/%{name}/htmltemp/index.html
install -p %{SOURCE5} %{buildroot}%{_datadir}/%{name}/htmltemp/days.html
install -p %{SOURCE6} %{buildroot}%{_datadir}/%{name}/htmltemp/domain.html
install -p %{SOURCE7} %{buildroot}%{_datadir}/%{name}/htmltemp/daily.html
install -p %{SOURCE8} %{buildroot}%{_datadir}/%{name}/htmltemp/monthly.html
install -p %{SOURCE9} \
%{buildroot}%{_datadir}/%{name}/htmltemp/generaldomain.html
install -p %{SOURCE10} \
%{buildroot}%{_datadir}/%{name}/htmltemp/generaldaily.html
install -p %{SOURCE11} \
%{buildroot}%{_datadir}/%{name}/htmltemp/generalmonthly.html
install -p %{SOURCE12} \
%{buildroot}%{_datadir}/%{name}/htmltemp/generalyearly.html
%{__ln_s} ../htmltemp/images %{buildroot}%{_datadir}/%{name}/htdocs/
%{__ln_s} ../htmltemp/library %{buildroot}%{_datadir}/%{name}/htdocs/
#----------------------------------------------------------------------------
%clean
#----------------------------------------------------------------------------
rm -rf %{buildroot}
#----------------------------------------------------------------------------
%postun
#----------------------------------------------------------------------------
# Remove cron-job
if [ "$1" = "0" ]; then
grep -v '* * * * root %{vdir}/bin/clearopensmtp' %{crontab} > %{crontab}.new
mv -f %{crontab}.new %{crontab}
fi
#----------------------------------------------------------------------------
%post
#----------------------------------------------------------------------------
# Install cron-job
if ! grep '* * * * root %{isoqdir}/bin/cron.sh' %{crontab} > /dev/null; then
echo "" >> %{crontab}
echo "58 * * * * root %{isoqdir}/bin/cron.sh 2>&1 > /dev/null" >> %{crontab}
fi
#----------------------------------------------------------------------------
%files
#----------------------------------------------------------------------------
%defattr(-,root,root)
# Docs
%attr(0644,root,root) %doc %{_docdir}/%{name}/*
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/%{name}/*
%attr(0644,root,root) %config %{_sysconfdir}/httpd/conf.d/%{name}.conf
%attr(0755,root,root) %{_bindir}/%{name}
%attr(0755,%{apacheuser},%{apachegroup}) %dir %{isoqdir}
%attr(0755,%{apacheuser},%{apachegroup}) %dir %{isoqdir}/bin
%attr(0755,root,root) %{isoqdir}/bin/cron.sh
%attr(0755,%{apacheuser},%{apachegroup}) %dir %{_datadir}/%{name}/htdocs
%attr(0755,%{apacheuser},%{apachegroup}) %dir %{_datadir}/%{name}/htmltemp
%attr(0755,%{apacheuser},%{apachegroup}) %dir %{_datadir}/%{name}/htmltemp/images
%attr(0755,%{apacheuser},%{apachegroup}) %dir %{_datadir}/%{name}/htmltemp/library
%attr(0644,%{apacheuser},%{apachegroup}) %{_datadir}/%{name}/htdocs/*
%attr(0644,%{apacheuser},%{apachegroup}) %{_datadir}/%{name}/htmltemp/*.html
%attr(0644,%{apacheuser},%{apachegroup}) %{_datadir}/%{name}/htmltemp/images/*
%attr(0644,%{apacheuser},%{apachegroup}) %{_datadir}/%{name}/htmltemp/library/*
%attr(0755,%{apacheuser},%{apachegroup}) %dir %{_datadir}/%{name}/lang
%attr(0644,%{apacheuser},%{apachegroup}) %{_datadir}/%{name}/lang/*
%attr(0755,root,root) %dir %{_docdir}/%{name}/tr
%attr(0644,root,root) %{basedir}/include/*
#----------------------------------------------------------------------------"
%changelog
#----------------------------------------------------------------------------
* Mon Jul 7 2014 Eric Shubert <[email protected]> 2.2.1-1.qt
- Fixed some bugs
- Changed location of some components, removing toaster directory
- Created /etc/httpd/conf.d/isoqlog.conf to it's not in control-panel
* Fri Nov 15 2013 Eric Shubert <[email protected]> 2.2.1-0.qt
- Migrated to github
- Removed -toaster designation
- Added CentOS 6 support
- Removed unsupported cruft
- Bumped version to current upstream
* Fri Jun 12 2009 Jake Vickers <[email protected]> 2.1-1.3.7
- Added Fedora 11 support
- Added Fedora 11 x86_64 support
* Wed Jun 10 2009 Jake Vickers <[email protected]> 2.1-1.3.7
- Added Mandriva 2009 support
* Thu Apr 23 2009 Jake Vickers <[email protected]> 2.1-1.3.6
- Added Fedora 9 x86_64 and Fedora 10 x86_64 support
* Sat Feb 14 2009 Jake Vickers <[email protected]> 2.1-1.3.5
- Added Suse 11.1 support
* Mon Feb 09 2009 Jake Vickers <[email protected]> 2.1-1.3.5
- Added Fedora 9 and 10 support
* Sat Apr 14 2007 Nick Hemmesch <[email protected]> 2.1-1.3.4
- Added CentOS 5 i386 support
- Added CentOS 5 x86_64 support
* Fri Feb 23 2007 Nick Hemmesch <[email protected]> 2.1-1.3.3
- Fix ownership of cron.sh to root:root
* Wed Nov 01 2006 Erik A. Espinoza <[email protected]> 2.1-1.3.2
- Added Fedora Core 6 support
* Mon Jun 05 2006 Nick Hemmesch <[email protected]> 2.1-1.3.1
- Add SuSE 10.1 support
- Set apacheuser and apachegroup correctly in cron.sh
* Sat May 13 2006 Nick Hemmesch <[email protected]> 2.1-1.2.10
- Add Fedora Core 5 support
* Sun Nov 20 2005 Nick Hemmesch <[email protected]> 2.1-1.2.9
- Add SuSE 10.0 and Mandriva 2006.0 support
* Sat Oct 15 2005 Nick Hemmesch <[email protected]> 2.1-1.2.8
- Add Fedora Core 4 x86_64 support
* Sat Oct 01 2005 Nick Hemmesch <[email protected]> 2.1-1.2.7
- Add CentOS 4 x86_64 support
* Fri Sep 22 2005 Nick Hemmesch <[email protected]> 2.1-1.2.6
- Remove automake config for Mandrake acct build failures
* Fri Jul 01 2005 Nick Hemmesch <[email protected]> 2.1-1.2.5
- Add Fedora Core 4 support
* Fri Jun 03 2005 Torbjorn Turpeinen <[email protected]> 2.1-1.2.4
- Gnu/Linux Mandrake 10.0,10.1,10.2 support
* Fri May 27 2005 Nick Hemmesch <[email protected]> 2.1-1.2.3
- Remove doc rpm
* Sun Feb 27 2005 Nick Hemmesch <[email protected]> 2.1-1.2.2
- Add Fedora Core 3 support
- Add CentOS 4 support
* Thu Jun 03 2004 Nick Hemmesch <[email protected]> 2.1-1.2.1
- Add Fedora Core 2 support
* Wed Feb 11 2004 Nick Hemmesch <[email protected]> 2.1-1.1.5
- Fix Trustix 2.0 crontab call to fcrontab
- Define crontab
- Define appacheuser and apachegroup
* Mon Dec 29 2003 Nick Hemmesch <[email protected]> 2.1-1.1.4
- Add Fedora Core 1 support
* Tue Nov 25 2003 Nick Hemmesch <[email protected]> 2.1-1.1.3
- Add Red Hat 9 support
- Add Trustix 2.0 support
- Add Mandrake 9.2 support
- Fix images to images-toaster
* Sun Mar 30 2003 Miguel Beccari <[email protected]> 2.1-1.1.2
- Toaster HTML templates (alpha status)
* Sat Mar 29 2003 Miguel Beccari <[email protected]> 2.1-1.1.1
- First rpm: everything is OK. Templates are NOT ok.