Summary: Cacti for smeserver %define name smeserver-cacti Name: %{name} %define version 0.8.7a %define release 1 Version: %{version} Release: %{release}%{?dist} License: Freely distributable Group: Apache Source: %{name}-%{version}.tar.gz #Patch0: %{name}-%{version}.patch.yyyymmddnn BuildRoot: /var/tmp/e-smith-buildroot BuildRequires: e-smith-devtools BuildArchitectures: noarch Requires: smeserver-release >= 7, rrdtool >= 1 AutoReqProv: no %changelog * Tue Dec 4 2007 Michel Van hees - Update contrib to 0.8.7a version - Adding access limitation - Adding automatic redirection to https - Automatic Update process from 0.8.6j * Mon Jan 29 2007 Michel Van hees - Based on cacti 0.8.6j - Initial release %description SME server - Cacti %prep %setup #%patch0 -p1 #%patch1 -p1 %build perl createlinks %install rm -rf $RPM_BUILD_ROOT (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) rm -f %{name}-%{version}-filelist /sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist echo "%doc COPYING" >> %{name}-%{version}-filelist %clean rm -rf $RPM_BUILD_ROOT %pre /sbin/e-smith/db accounts set cacti reserved %preun %post /sbin/e-smith/db configuration set cacti service /sbin/e-smith/db configuration setprop cacti access private /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf /sbin/e-smith/expand-template /opt/cacti/include/config.php service httpd-e-smith sigusr1 cactiVersion=`mysql cacti_sme -N -s -e"select * from version"` case "$cactiVersion" in 0.8.6j) echo "" echo "Upgrade process !!!!!!" mysql cacti_sme < /opt/cacti/cacti_upg086j.sql rm -f /opt/cacti/cacti_sme.sql rm -f /opt/cacti/cacti_upg086j.sql echo "Upgrade complete ..." echo "" ;; 0.8.7a) # Shoul not be here for the moment ;; *) # Fresh install echo "" echo "fresh install..." mysqladmin create cacti_sme mysql cacti_sme < /opt/cacti/cacti_sme.sql rm -Rf /opt/cacti/install rm -f /opt/cacti/cacti_sme.sql rm -f /opt/cacti/cacti_upg086j.sql echo "Install complete ..." echo "" 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 "" ;; esac %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 %files -f %{name}-%{version}-filelist %defattr(-,root,root)