Name: qpid-snmpd Version: 1.0.0 Release: 5%{?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 BuildRequires: systemd-units Requires: net-snmp %description qpid-snmpd - SNMP agent for Apache qpid. Provides read-only information about qpid brokers, queues, messages, exchanges, etc. %prep %setup -q -c %{name}-%{version} %build pushd %{name} %cmake . make %{?_smp_mflags} popd %install rm -rf %{buildroot} pushd %{name} make install DESTDIR=%{buildroot} # install the config files mkdir -p %{buildroot}%{_datadir}/snmp/ install -p -m 664 conf/qpid010.conf %{buildroot}%{_datadir}/snmp install -p -m 664 conf/snmp.conf %{buildroot}%{_datadir}/snmp/qpid_snmp.conf # install the mib mkdir -p %{buildroot}%{_datadir}/snmp/mibs/ install -p -m 664 conf/QPID-MESSAGING-MIB.txt %{buildroot}%{_datadir}/snmp/mibs # install the init script mkdir -p %{buildroot}%{_unitdir}/ install -p -m 664 etc/%{name}.service %{buildroot}%{_unitdir} #zip the raw man page mkdir -p %{buildroot}%{_mandir}/man8/ install -p -m 664 conf/%{name}.8 %{buildroot}%{_mandir}/man8/ popd %clean rm -rf %{buildroot} %post %if 0%{?fedora} >= 18 %systemd_post %{name}.service %else if [ $1 -eq 1 ] ; then # Initial installation /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi %endif %preun %if 0%{?fedora} >= 18 %systemd_preun %{name}.service %else if [ $1 -eq 0 ] ; then # Package removal, not upgrade /bin/systemctl --no-reload disable %{name}.service > /dev/null 2>&1 || : /bin/systemctl stop %{name}.service > /dev/null 2>&1 || : fi %endif %postun %if 0%{?fedora} >= 18 %systemd_postun_with_restart %{name}.service %else /bin/systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || : fi %endif %files %{_bindir}/%{name} %doc %{name}/README.txt %doc %{name}/license.txt %{_unitdir}/%{name}.service %{_datadir}/snmp/qpid010.conf %{_datadir}/snmp/qpid_snmp.conf %{_datadir}/snmp/mibs/QPID-MESSAGING-MIB.txt %{_mandir}/man8/%{name}.8.gz %changelog * Tue Oct 02 2012 Ernie Allen 1.0.0-5 - Updated to release 5 - Use the newer macroized scriptlets for Fedora 18+ * Fri Sep 21 2012 Ernie Allen 1.0.0-4 - Updated to release 4 - Switched to systed unit file instead of sysv init script - Removed the step to gzip the man page since it is automatic * Thu Sep 20 2012 Ernie Allen 1.0.0-3 - Updated to release 3 - Removed the global source_dir and used pushd and popd - Modified referenes to file locations to match original tar file * 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