1 %define plugin check_flashpolicyd
2 Summary: Daemon to serve Adobe Flash socket policy XML
7 Group: Networking/Daemons
8 URL: http://code.google.com/p/flashpolicyd/
9 Source0: http://flashpolicyd.googlecode.com/files/%{name}-%{version}.tgz
10 # Source0-md5: 0ad1ed0b130cf5850d77600fab90a7c2
12 Patch0: %{name}-runas-user.patch
13 BuildRequires: rpmbuild(macros) >= 1.268
14 Requires(post,preun): /sbin/chkconfig
16 Requires: ruby-modules
18 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20 %define pluginconf /etc/nagios/plugins
21 %define plugindir %{_prefix}/lib/nagios/plugins
24 Daemon to serve Adobe Flash socket policy XML.
26 %package -n nagios-plugin-%{plugin}
27 Summary: Nagios plugin to check flashpolicyd
29 Requires: nagios-common
31 %description -n nagios-plugin-%{plugin}
32 Nagios plugin to check flashpolicyd.
39 cat > nagios.cfg <<'EOF'
43 command_name %{plugin}
44 command_line %{plugindir}/%{plugin} --host $HOSTADDRESS$ $ARG1$
49 rm -rf $RPM_BUILD_ROOT
50 install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_sbindir}}
51 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/flashpolicyd
52 install -p flashpolicyd.rb $RPM_BUILD_ROOT%{_sbindir}/flashpolicyd
53 cp -a flashpolicy.xml $RPM_BUILD_ROOT%{_sysconfdir}/flashpolicy.xml
55 install -d $RPM_BUILD_ROOT{%{pluginconf},%{plugindir}}
56 cp -a nagios.cfg $RPM_BUILD_ROOT%{pluginconf}/%{plugin}.cfg
57 install -p %{plugin}.rb $RPM_BUILD_ROOT%{plugindir}/%{plugin}
60 rm -rf $RPM_BUILD_ROOT
63 /sbin/chkconfig --add flashpolicyd
64 %service flashpolicyd restart
67 if [ "$1" = 0 ] ; then
68 %service flashpolicyd stop
69 /sbin/chkconfig --del flashpolicyd
73 %defattr(644,root,root,755)
75 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/flashpolicy.xml
76 %attr(754,root,root) /etc/rc.d/init.d/flashpolicyd
77 %attr(755,root,root) %{_sbindir}/flashpolicyd
79 %files -n nagios-plugin-%{plugin}
80 %defattr(644,root,root,755)
81 %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{pluginconf}/%{plugin}.cfg
82 %attr(755,root,root) %{plugindir}/%{plugin}