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.
27 Summary: Documentation files for flashpolicyd
29 Requires: ruby >= 1:1.8.7-4
32 Documentation files for flashpolicyd.
34 %package -n nagios-plugin-%{plugin}
35 Summary: Nagios plugin to check flashpolicyd
37 Requires: nagios-common
39 %description -n nagios-plugin-%{plugin}
40 Nagios plugin to check flashpolicyd.
48 cat > nagios.cfg <<'EOF'
52 command_name %{plugin}
53 command_line %{plugindir}/%{plugin} --host $HOSTADDRESS$ $ARG1$
59 service_description flashpolicyd
62 normal_check_interval 5
63 retry_check_interval 1
65 check_command check_flashpolicyd
70 rm -rf $RPM_BUILD_ROOT
71 install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_sbindir}}
72 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/flashpolicyd
73 install -p flashpolicyd.rb $RPM_BUILD_ROOT%{_sbindir}/flashpolicyd
74 cp -a flashpolicy.xml $RPM_BUILD_ROOT%{_sysconfdir}/flashpolicy.xml
77 install -d $RPM_BUILD_ROOT%{ruby_rdocdir}
78 cp -a rdoc $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version}
80 install -d $RPM_BUILD_ROOT{%{pluginconf},%{plugindir}}
81 cp -a nagios.cfg $RPM_BUILD_ROOT%{pluginconf}/%{plugin}.cfg
82 install -p %{plugin}.rb $RPM_BUILD_ROOT%{plugindir}/%{plugin}
85 rm -rf $RPM_BUILD_ROOT
88 /sbin/chkconfig --add flashpolicyd
89 %service flashpolicyd restart
92 if [ "$1" = 0 ] ; then
93 %service flashpolicyd stop
94 /sbin/chkconfig --del flashpolicyd
98 %defattr(644,root,root,755)
100 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/flashpolicy.xml
101 %attr(754,root,root) /etc/rc.d/init.d/flashpolicyd
102 %attr(755,root,root) %{_sbindir}/flashpolicyd
105 %defattr(644,root,root,755)
106 %{ruby_rdocdir}/%{name}-%{version}
108 %files -n nagios-plugin-%{plugin}
109 %defattr(644,root,root,755)
110 %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{pluginconf}/%{plugin}.cfg
111 %attr(755,root,root) %{plugindir}/%{plugin}