1 |
Summary: SME server Sarg |
2 |
%define name smeserver-sarg |
3 |
Name: %{name} |
4 |
%define version 2.2.1 |
5 |
%define release 4 |
6 |
Version: %{version} |
7 |
Release: %{release}%{?dist} |
8 |
License: Freely distributable |
9 |
Group: Apache/php/caching |
10 |
Source: %{name}-%{version}.tar.gz |
11 |
BuildRoot: /var/tmp/e-smith-buildroot |
12 |
BuildRequires: e-smith-devtools |
13 |
BuildArchitectures: noarch |
14 |
Requires: smeserver-release >= 7 |
15 |
Requires: sarg >= 2.2 |
16 |
AutoReqProv: no |
17 |
|
18 |
%changelog |
19 |
* Tue Jan 9 2007 Stephen Noble <support@dungog.net> |
20 |
- add db setting for lastlog correctly |
21 |
- [2.2.1-4] |
22 |
|
23 |
* Tue Jan 9 2007 Stephen Noble <support@dungog.net> |
24 |
- remove duplicate access_log [sme 2217] |
25 |
- add db setting for lastlog, ie 365 = 1yr |
26 |
- [2.2.1-3] |
27 |
|
28 |
* Tue Nov 14 2006 Stephen Noble <support@dungog.net> |
29 |
- requires sarg >= 2.2 |
30 |
- cosmetic update of /var/www/sarg/index.htm |
31 |
- [2.2.1-2] |
32 |
|
33 |
* Tue Oct 17 2006 Stephen Noble <support@dungog.net> |
34 |
- update to sarg 2.2.1 |
35 |
- removed sarg binary, use seperate sarg rpm + dependancies |
36 |
- [2.2.1-1] |
37 |
|
38 |
* Tue Oct 17 2006 Stephen Noble <support@dungog.net> |
39 |
- add index.html files to avoid confusion and 404 errors |
40 |
- removed -p option (ip only) now sorts users as well |
41 |
- [1.4.1-6] |
42 |
|
43 |
* Sun Oct 15 2006 Stephen Noble <support@dungog.net> |
44 |
- db setting to use dansguardian instead of squid |
45 |
- /usr/bin/sarglog [squid|dansguardian] |
46 |
|
47 |
* Sun Oct 08 2006 Michel Van hees <michel@vanhees.cc> |
48 |
- Bug fixing in cron script |
49 |
- Make report by name and by ip |
50 |
|
51 |
* Mon May 22 2006 Michel Van hees <michel@vanhees.cc> |
52 |
- Bug fixing |
53 |
|
54 |
* Tue May 9 2006 Michel Van hees <michel@vanhees.cc> |
55 |
- Integrate binary |
56 |
|
57 |
* Sun May 7 2006 Michel Van hees <michel@vanhees.cc> |
58 |
- Debug cron job |
59 |
|
60 |
* Mon May 1 2006 Michel Van hees <michel@vanhees.cc> |
61 |
- start developpement |
62 |
|
63 |
%description |
64 |
Sarg templates for SME Server release 7 |
65 |
|
66 |
%prep |
67 |
%setup |
68 |
|
69 |
%build |
70 |
perl createlinks |
71 |
mkdir -p root/etc/e-smith/db/configuration/defaults/sarg |
72 |
echo "service" > root/etc/e-smith/db/configuration/defaults/sarg/type |
73 |
echo "squid" > root/etc/e-smith/db/configuration/defaults/sarg/logfile |
74 |
echo "English" > root/etc/e-smith/db/configuration/defaults/sarg/language |
75 |
echo "bytes" > root/etc/e-smith/db/configuration/defaults/sarg/values |
76 |
|
77 |
%install |
78 |
rm -rf $RPM_BUILD_ROOT |
79 |
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
80 |
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
81 |
--file '/usr/bin/sarglog' 'attr(755,root,root)' \ |
82 |
> %{name}-%{version}-filelist |
83 |
echo "%doc " >> %{name}-%{version}-filelist |
84 |
|
85 |
%clean |
86 |
rm -rf $RPM_BUILD_ROOT |
87 |
|
88 |
%pre |
89 |
|
90 |
%preun |
91 |
%post |
92 |
#new installs |
93 |
if [ $1 = 1 ] ; then |
94 |
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
95 |
/etc/rc.d/init.d/httpd-e-smith sigusr1 |
96 |
/etc/e-smith/events/actions/navigation-conf > /dev/null 2>&1 |
97 |
fi |
98 |
|
99 |
/sbin/e-smith/expand-template /etc/sarg/sarg.conf |
100 |
/sbin/e-smith/expand-template /etc/cron.daily/sarg |
101 |
/sbin/e-smith/expand-template /etc/cron.weekly/sarg |
102 |
/sbin/e-smith/expand-template /etc/cron.monthly/sarg |
103 |
|
104 |
|
105 |
#/etc/e-smith/events/actions/initialize-default-databases |
106 |
|
107 |
echo '' |
108 |
echo 'optional settings for sarg, first option is default' |
109 |
echo '' |
110 |
echo 'config setprop sarg language [English|Dutch|French|German|Spanish|Italian|...]' |
111 |
echo 'config setprop sarg values [bytes|abbreviation]' |
112 |
echo 'config setprop sarg logfile [squid|dansguardian]' |
113 |
echo 'config setprop sarg lastlog [0|365|num.of.days.to.keep.logs]' |
114 |
echo '' |
115 |
echo 'expand-templates shortcut with /usr/bin/sarglog' |
116 |
echo '' |
117 |
|
118 |
|
119 |
%postun |
120 |
#uninstalls |
121 |
if [ $1 = 0 ] ; then |
122 |
DBS=`find /home/e-smith/db/navigation -type f -name "navigation.*"` |
123 |
for db in $DBS ; do |
124 |
/sbin/e-smith/db $db delete sarg 2>/dev/null |
125 |
done |
126 |
|
127 |
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
128 |
/etc/rc.d/init.d/httpd-e-smith sigusr1 |
129 |
fi |
130 |
|
131 |
%files -f %{name}-%{version}-filelist |
132 |
%defattr(-,root,root) |