1 |
# $Id: smeserver-cacti.spec,v 1.3 2008/11/25 16:20:19 slords Exp $ |
# $Id: smeserver-cacti.spec,v 1.2 2013/10/16 03:07:57 unnilennium Exp $ |
2 |
# Authority: nocvs |
# Authority: nocvs |
3 |
# Name: Michel Van hees |
# Name: Michel Van hees |
4 |
|
|
5 |
Summary: Cacti for smeserver |
Summary: Cacti for smeserver |
6 |
%define name smeserver-cacti |
%define name smeserver-cacti |
7 |
Name: %{name} |
Name: %{name} |
8 |
%define version 0.8.7a |
%define version 0.8.8b |
9 |
%define release 1 |
%define release 2 |
10 |
Version: %{version} |
Version: %{version} |
11 |
Release: %{release}%{?dist} |
Release: %{release}%{?dist} |
12 |
License: Freely distributable |
License: Freely distributable |
16 |
BuildRoot: /var/tmp/e-smith-buildroot |
BuildRoot: /var/tmp/e-smith-buildroot |
17 |
BuildRequires: e-smith-devtools |
BuildRequires: e-smith-devtools |
18 |
BuildArchitectures: noarch |
BuildArchitectures: noarch |
19 |
Requires: smeserver-release >= 7, rrdtool >= 1 |
Requires: smeserver-release >= 8 , rrdtool >= 1 |
20 |
|
Requires: cacti-0.8.8b-2.el5 |
21 |
AutoReqProv: no |
AutoReqProv: no |
22 |
|
|
23 |
%changelog |
%changelog |
24 |
|
* Tue Oct 15 2013 Jean-Philippe Pialasse <tests@pialasse.com> 0.8.8b.sme-2 |
25 |
|
- initial release for SME 8 |
26 |
|
- use el5 repo cacti |
27 |
|
|
28 |
* Tue Dec 4 2007 Michel Van hees <michel@vanhees.cc> |
* Tue Dec 4 2007 Michel Van hees <michel@vanhees.cc> |
29 |
- Update contrib to 0.8.7a version |
- Update contrib to 0.8.7a version |
30 |
- Adding access limitation |
- Adding access limitation |
57 |
rm -rf $RPM_BUILD_ROOT |
rm -rf $RPM_BUILD_ROOT |
58 |
|
|
59 |
%pre |
%pre |
60 |
/sbin/e-smith/db accounts set cacti reserved |
#/sbin/e-smith/db accounts set cacti reserved |
61 |
|
|
62 |
%preun |
%preun |
63 |
|
|
64 |
%post |
%post |
65 |
/sbin/e-smith/db configuration set cacti service |
#/sbin/e-smith/db configuration set cacti service |
66 |
/sbin/e-smith/db configuration setprop cacti access private |
#/sbin/e-smith/db configuration setprop cacti access private |
67 |
|
|
68 |
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
#/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
69 |
/sbin/e-smith/expand-template /opt/cacti/include/config.php |
#/sbin/e-smith/expand-template /opt/cacti/include/config.php |
70 |
service httpd-e-smith sigusr1 |
#service httpd-e-smith sigusr1 |
71 |
|
|
72 |
|
|
73 |
cactiVersion=`mysql cacti_sme -N -s -e"select * from version"` |
#cactiVersion=`mysql cacti_sme -N -s -e"select * from version"` |
74 |
case "$cactiVersion" in |
#case "$cactiVersion" in |
75 |
0.8.6j) |
# 0.8.6j) |
76 |
echo "" |
# echo "" |
77 |
echo "Upgrade process !!!!!!" |
# echo "Upgrade process !!!!!!" |
78 |
mysql cacti_sme < /opt/cacti/cacti_upg086j.sql |
# mysql cacti_sme < /opt/cacti/cacti_upg086j.sql |
79 |
rm -f /opt/cacti/cacti_sme.sql |
# rm -f /opt/cacti/cacti_sme.sql |
80 |
rm -f /opt/cacti/cacti_upg086j.sql |
# rm -f /opt/cacti/cacti_upg086j.sql |
81 |
echo "Upgrade complete ..." |
# echo "Upgrade complete ..." |
82 |
echo "" |
# echo "" |
83 |
;; |
# ;; |
84 |
0.8.7a) |
# 0.8.7a) |
85 |
# Shoul not be here for the moment |
# # Shoul not be here for the moment |
86 |
;; |
# ;; |
87 |
*) |
# *) |
88 |
# Fresh install |
# # Fresh install |
89 |
echo "" |
# echo "" |
90 |
echo "fresh install..." |
# echo "fresh install..." |
91 |
mysqladmin create cacti_sme |
# mysqladmin create cacti_sme |
92 |
mysql cacti_sme < /opt/cacti/cacti_sme.sql |
# mysql cacti_sme < /opt/cacti/cacti_sme.sql |
93 |
rm -Rf /opt/cacti/install |
# rm -Rf /opt/cacti/install |
94 |
rm -f /opt/cacti/cacti_sme.sql |
# rm -f /opt/cacti/cacti_sme.sql |
95 |
rm -f /opt/cacti/cacti_upg086j.sql |
# rm -f /opt/cacti/cacti_upg086j.sql |
96 |
echo "Install complete ..." |
# echo "Install complete ..." |
97 |
echo "" |
# echo "" |
98 |
esac |
#esac |
|
|
|
|
case "${LANG:0:2}" in |
|
|
fr) |
|
|
echo "" |
|
|
echo "Vous pouvez maintenant acceder à cacti via un browser web de la maniere suivante https://nom_server/cacti" |
|
|
echo "Vous pourrez vous loger sous admin avec comme mot de pass admin." |
|
|
echo "Si vous mettez à jour, le mot de passe admin n'aura pas changer!" |
|
|
echo "" |
|
|
echo "Attention !!!!!" |
|
|
echo "Cacti est limité en accès au réseau interne, donc pas depuis internet" |
|
|
echo "Vous pouvez changer cette option avec les commandes :" |
|
|
echo "db configuration setprop cacti access public" |
|
|
echo "signal-events console-save" |
|
|
echo "" |
|
|
;; |
|
|
*) |
|
|
echo "" |
|
|
echo "Now you can access cacti though your browser at https://server_name/cacti" |
|
|
echo "You can connect using login admin and password admin." |
|
|
echo "If you update a 2.1 version of this contribs, admin password don't change!" |
|
|
echo "" |
|
|
echo "BEWARE !!!" |
|
|
echo "Cacti is now limited to internal network, so it couldn't be access from internet" |
|
|
echo "You can change this with the following command :" |
|
|
echo "db configuration setprop cacti access public" |
|
|
echo "signal-events console-save" |
|
|
echo "" |
|
99 |
|
|
|
;; |
|
|
esac |
|
100 |
|
|
101 |
%postun |
%postun |
|
/sbin/e-smith/db accounts delete cacti |
|
|
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
|
|
service httpd-e-smith sigusr1 |
|
|
if [ $1 = 0 ] ; then |
|
|
# action to been done if remove |
|
|
case "${LANG:0:2}" in |
|
|
fr) |
|
|
echo "" |
|
|
echo "La base de donnée ne sera pas effacé" |
|
|
echo "Si vous voulez supprimer la base de donnée lancé la commande suivante :" |
|
|
echo "mysqladmin drop cacti_sme" |
|
|
;; |
|
|
*) |
|
|
echo "" |
|
|
echo "Database will not be removed" |
|
|
echo "If you want to remove completly the database launch" |
|
|
echo "mysqladmin drop cacti_sme" |
|
|
;; |
|
|
esac |
|
|
|
|
|
fi |
|
102 |
|
|
103 |
%files -f %{name}-%{version}-filelist |
%files -f %{name}-%{version}-filelist |
104 |
%defattr(-,root,root) |
%defattr(-,root,root) |