1 |
Summary: Cacti for smeserver |
2 |
%define name smeserver-cacti |
3 |
Name: %{name} |
4 |
%define version 0.8.7a |
5 |
%define release 1 |
6 |
Version: %{version} |
7 |
Release: %{release} |
8 |
Copyright: Freely distributable |
9 |
Group: Apache |
10 |
Source: %{name}-%{version}.tar.gz |
11 |
#Patch0: %{name}-%{version}.patch.yyyymmddnn |
12 |
Packager: Michel Van hees <michel@vanhees.cc> |
13 |
BuildRoot: /var/tmp/e-smith-buildroot |
14 |
BuildRequires: e-smith-devtools |
15 |
BuildArchitectures: noarch |
16 |
Requires: smeserver-release >= 7, rrdtool >= 1 |
17 |
AutoReqProv: no |
18 |
|
19 |
%changelog |
20 |
* Tue Dec 4 2007 Michel Van hees <michel@vanhees.cc> |
21 |
- Update contrib to 0.8.7a version |
22 |
- Adding access limitation |
23 |
- Adding automatic redirection to https |
24 |
- Automatic Update process from 0.8.6j |
25 |
|
26 |
* Mon Jan 29 2007 Michel Van hees <michel@vanhees.cc> |
27 |
- Based on cacti 0.8.6j |
28 |
- Initial release |
29 |
|
30 |
%description |
31 |
SME server - Cacti |
32 |
|
33 |
%prep |
34 |
%setup |
35 |
#%patch0 -p1 |
36 |
#%patch1 -p1 |
37 |
|
38 |
%build |
39 |
perl createlinks |
40 |
|
41 |
%install |
42 |
rm -rf $RPM_BUILD_ROOT |
43 |
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
44 |
rm -f %{name}-%{version}-filelist |
45 |
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist |
46 |
echo "%doc COPYING" >> %{name}-%{version}-filelist |
47 |
|
48 |
%clean |
49 |
rm -rf $RPM_BUILD_ROOT |
50 |
|
51 |
%pre |
52 |
/sbin/e-smith/db accounts set cacti reserved |
53 |
|
54 |
%preun |
55 |
|
56 |
%post |
57 |
/sbin/e-smith/db configuration set cacti service |
58 |
/sbin/e-smith/db configuration setprop cacti access private |
59 |
|
60 |
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
61 |
/sbin/e-smith/expand-template /opt/cacti/include/config.php |
62 |
service httpd-e-smith sigusr1 |
63 |
|
64 |
|
65 |
cactiVersion=`mysql cacti_sme -N -s -e"select * from version"` |
66 |
case "$cactiVersion" in |
67 |
0.8.6j) |
68 |
echo "" |
69 |
echo "Upgrade process !!!!!!" |
70 |
mysql cacti_sme < /opt/cacti/cacti_upg086j.sql |
71 |
rm -f /opt/cacti/cacti_sme.sql |
72 |
rm -f /opt/cacti/cacti_upg086j.sql |
73 |
echo "Upgrade complete ..." |
74 |
echo "" |
75 |
;; |
76 |
0.8.7a) |
77 |
# Shoul not be here for the moment |
78 |
;; |
79 |
*) |
80 |
# Fresh install |
81 |
echo "" |
82 |
echo "fresh install..." |
83 |
mysqladmin create cacti_sme |
84 |
mysql cacti_sme < /opt/cacti/cacti_sme.sql |
85 |
rm -Rf /opt/cacti/install |
86 |
rm -f /opt/cacti/cacti_sme.sql |
87 |
rm -f /opt/cacti/cacti_upg086j.sql |
88 |
echo "Install complete ..." |
89 |
echo "" |
90 |
esac |
91 |
|
92 |
case "${LANG:0:2}" in |
93 |
fr) |
94 |
echo "" |
95 |
echo "Vous pouvez maintenant acceder à cacti via un browser web de la maniere suivante https://nom_server/cacti" |
96 |
echo "Vous pourrez vous loger sous admin avec comme mot de pass admin." |
97 |
echo "Si vous mettez à jour, le mot de passe admin n'aura pas changer!" |
98 |
echo "" |
99 |
echo "Attention !!!!!" |
100 |
echo "Cacti est limité en accès au réseau interne, donc pas depuis internet" |
101 |
echo "Vous pouvez changer cette option avec les commandes :" |
102 |
echo "db configuration setprop cacti access public" |
103 |
echo "signal-events console-save" |
104 |
echo "" |
105 |
;; |
106 |
*) |
107 |
echo "" |
108 |
echo "Now you can access cacti though your browser at https://server_name/cacti" |
109 |
echo "You can connect using login admin and password admin." |
110 |
echo "If you update a 2.1 version of this contribs, admin password don't change!" |
111 |
echo "" |
112 |
echo "BEWARE !!!" |
113 |
echo "Cacti is now limited to internal network, so it couldn't be access from internet" |
114 |
echo "You can change this with the following command :" |
115 |
echo "db configuration setprop cacti access public" |
116 |
echo "signal-events console-save" |
117 |
echo "" |
118 |
|
119 |
;; |
120 |
esac |
121 |
|
122 |
%postun |
123 |
/sbin/e-smith/db accounts delete cacti |
124 |
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
125 |
service httpd-e-smith sigusr1 |
126 |
if [ $1 = 0 ] ; then |
127 |
# action to been done if remove |
128 |
case "${LANG:0:2}" in |
129 |
fr) |
130 |
echo "" |
131 |
echo "La base de donnée ne sera pas effacé" |
132 |
echo "Si vous voulez supprimer la base de donnée lancé la commande suivante :" |
133 |
echo "mysqladmin drop cacti_sme" |
134 |
;; |
135 |
*) |
136 |
echo "" |
137 |
echo "Database will not be removed" |
138 |
echo "If you want to remove completly the database launch" |
139 |
echo "mysqladmin drop cacti_sme" |
140 |
;; |
141 |
esac |
142 |
|
143 |
fi |
144 |
|
145 |
%files -f %{name}-%{version}-filelist |
146 |
%defattr(-,root,root) |