Name: qpid-snmpd Version: 1.0.0 Release: 2%{?dist} Summary: SNMP agent for Apache qpid License: ASL 2.0 URL: http://eallen.fedorapeople.org/ Source0: http://eallen.fedorapeople.org/%{name}-%{version}.tar.bz2 Group: System Environment/Daemons BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: net-snmp-devel BuildRequires: qpid-qmf-devel BuildRequires: pciutils-devel BuildRequires: cmake Requires: net-snmp %description qpid-snmpd - SNMP agent for Apache qpid. Provides read-only information about qpid brokers, queues, messages, exchanges, etc. %global source_dir %{name}-src %prep %setup -q -c %{name}-%{version} %build %cmake %{source_dir} make %{?_smp_mflags} %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} # install the config files mkdir -p %{buildroot}%{_datadir}/snmp/ install -p -m 664 %{source_dir}/conf/qpid010.conf %{buildroot}%{_datadir}/snmp install -p -m 664 %{source_dir}/conf/snmp.conf %{buildroot}%{_datadir}/snmp/qpid_snmp.conf # install the mib mkdir -p %{buildroot}%{_datadir}/snmp/mibs/ install -p -m 664 %{source_dir}/conf/QPID-MESSAGING-MIB.txt %{buildroot}%{_datadir}/snmp/mibs # install the init script mkdir -p %{buildroot}%{_initrddir}/ install -p -m 755 %{source_dir}/etc/%{name} %{buildroot}%{_initrddir} #zip the raw man page mkdir -p %{buildroot}%{_mandir}/man8/ install -p -m 664 %{source_dir}/conf/%{name}.8 %{buildroot}%{_mandir}/man8 gzip %{buildroot}%{_mandir}/man8/%{name}.8 %clean rm -rf %{buildroot} %post %{_sbindir}/chkconfig --add %{name} %preun if [ $1 = 0 ] ; then %{_sbindir}/service %{name} stop >/dev/null 2>&1 %{_sbindir}/chkconfig --del %{name} fi %postun if [ "$1" -ge "1" ] ; then # just an update %{_sbindir}/service %{name} condrestart >/dev/null 2>&1 || : fi %files %{_bindir}/%{name} %doc %{source_dir}/README.txt %doc %{source_dir}/license.txt %{_initrddir}/%{name} %{_datadir}/snmp/qpid010.conf %{_datadir}/snmp/qpid_snmp.conf %{_datadir}/snmp/mibs/QPID-MESSAGING-MIB.txt %{_mandir}/man8/%{name}.8.gz %changelog * Tue Sep 18 2012 Ernie Allen 1.0.0-2 - Updated release to 2 - Changed the global _build_dir to source_dir to avoid possible confusion - Changed the input source zip file to have a directory named qpid-snmpd-src instead of qpid-snmpd to avoid the naming conflict with the directory and the app name. The source_dir global now reflects the name change - Changed all cp -p to use install macro for consistency * Sat Sep 15 2012 Ernie Allen 1.0.0-1 - Initial version containing /usr/bin/qpid-snmpd installed as root