packages: cacti-template-postfix/cacti-template-postfix.spec - add dbfile t...

glen glen at pld-linux.org
Fri Oct 15 08:18:11 CEST 2010


Author: glen                         Date: Fri Oct 15 06:18:11 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- add dbfile to postfix dir, macor for agent script

---- Files affected:
packages/cacti-template-postfix:
   cacti-template-postfix.spec (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: packages/cacti-template-postfix/cacti-template-postfix.spec
diff -u packages/cacti-template-postfix/cacti-template-postfix.spec:1.1 packages/cacti-template-postfix/cacti-template-postfix.spec:1.2
--- packages/cacti-template-postfix/cacti-template-postfix.spec:1.1	Fri Oct 15 07:55:35 2010
+++ packages/cacti-template-postfix/cacti-template-postfix.spec	Fri Oct 15 08:18:06 2010
@@ -4,7 +4,7 @@
 Summary:	Postifix monitoring with Cacti
 Name:		cacti-template-%{template}
 Version:	0.1
-Release:	0.4
+Release:	0.5
 License:	GPL v2
 Group:		Applications/WWW
 Source0:	http://forums.cacti.net/download/file.php?id=4091#/postfix_mailserver.tar.gz
@@ -21,6 +21,8 @@
 %define		scriptsdir		%{cactidir}/scripts
 %define		snmpdconfdir	/etc/snmp
 %define		_libdir			%{_prefix}/lib
+%define		dbfile			/var/spool/postfix/mailstats.db
+%define		agentscript		%{_libdir}/snmpd-agent-cacti_postfix
 # This is officially registered: http://www.oid-info.com/get/1.3.6.1.4.1.16606
 %define		snmpoid			.1.3.6.1.4.1.16606.2
 
@@ -42,7 +44,10 @@
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{resourcedir},%{scriptsdir},%{snmpdconfdir},%{_libdir}}
 cp -a *.xml $RPM_BUILD_ROOT%{resourcedir}
-install -p fetch_mail_statistics.pl $RPM_BUILD_ROOT%{_libdir}/snmpd-agent-cacti_postfix
+install -p fetch_mail_statistics.pl $RPM_BUILD_ROOT%{agentscript}
+# ghost the dbfile
+install -d $RPM_BUILD_ROOT$(dirname %{dbfile})
+touch $RPM_BUILD_ROOT%{dbfile}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -52,7 +57,7 @@
 
 %post -n net-snmp-agent-cacti_postfix
 if ! grep -qF %{snmpoid} %{snmpdconfdir}/snmpd.local.conf; then
-	echo "extend %{snmpoid} cacti_postfix %{_libdir}/snmpd-agent-cacti_postfix /var/log/maillog /var/log/mailstats.db %{snmpoid}" >> %{snmpdconfdir}/snmpd.local.conf
+	echo "extend %{snmpoid} cacti_postfix %{agentscript} /var/log/maillog %{dbfile} %{snmpoid}" >> %{snmpdconfdir}/snmpd.local.conf
 	%service -q snmpd reload
 fi
 
@@ -70,7 +75,8 @@
 
 %files -n net-snmp-agent-cacti_postfix
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/snmpd-agent-cacti_postfix
+%attr(755,root,root) %{agentscript}
+%ghost %attr(700,root,root) %{dbfile}
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -78,5 +84,8 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.2  2010/10/15 06:18:06  glen
+- add dbfile to postfix dir, macor for agent script
+
 Revision 1.1  2010/10/15 05:55:35  glen
 - initial inspired from from my earlier work: cacti-template-snmp_tcp_connection_status
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/cacti-template-postfix/cacti-template-postfix.spec?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list