hdp_mon_nagios_addons.spec 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. ##
  2. #
  3. #/*
  4. # * Licensed to the Apache Software Foundation (ASF) under one
  5. # * or more contributor license agreements. See the NOTICE file
  6. # * distributed with this work for additional information
  7. # * regarding copyright ownership. The ASF licenses this file
  8. # * to you under the Apache License, Version 2.0 (the
  9. # * "License"); you may not use this file except in compliance
  10. # * with the License. You may obtain a copy of the License at
  11. # *
  12. # * http://www.apache.org/licenses/LICENSE-2.0
  13. # *
  14. # * Unless required by applicable law or agreed to in writing, software
  15. # * distributed under the License is distributed on an "AS IS" BASIS,
  16. # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. # * See the License for the specific language governing permissions and
  18. # * limitations under the License.
  19. # */
  20. #
  21. # RPM Spec file for Nagios Add-ons for HDP Monitoring Dashboard
  22. #
  23. Summary: Nagios Add-ons for HDP Monitoring Dashboard
  24. Name: hdp_mon_nagios_addons
  25. Version: 0.0.2.15
  26. URL: http://hortonworks.com
  27. Release: 1
  28. License: Apache License, Version 2.0
  29. Vendor: Hortonworks <ambari-group@hortonworks.com>
  30. Group: System Environment/Base
  31. Source: %{name}-%{version}.tar.gz
  32. Buildroot: %{_tmppath}/%{name}-%{version}-buildroot
  33. Requires: nagios, nagios-plugins, php >= 5
  34. %define nagioshdpscripts_dir %{_prefix}/share/hdp/nagios
  35. %define nagiosplugin_dir %{_libdir}/nagios/plugins
  36. %if 0%{?suse_version}
  37. %define httpd_confdir %{_sysconfdir}/apache2/conf.d
  38. %else
  39. %define httpd_confdir %{_sysconfdir}/httpd/conf.d
  40. %endif
  41. BuildArchitectures: noarch
  42. %description
  43. This package provides add-on helper scripts and plugins for nagios for
  44. monitoring of a Hadoop Cluster
  45. %prep
  46. %setup -q -n %{name}-%{version}
  47. %build
  48. %install
  49. # Flush any old RPM build root
  50. %__rm -rf $RPM_BUILD_ROOT
  51. %__mkdir -p $RPM_BUILD_ROOT/%{nagioshdpscripts_dir}/
  52. %__mkdir -p $RPM_BUILD_ROOT/%{nagiosplugin_dir}/
  53. %__mkdir -p $RPM_BUILD_ROOT/%{httpd_confdir}/
  54. %__cp -rf scripts/* $RPM_BUILD_ROOT/%{nagioshdpscripts_dir}/
  55. %__cp -rf plugins/* $RPM_BUILD_ROOT/%{nagiosplugin_dir}/
  56. echo "Alias /hdp %{_prefix}/share/hdp" >> $RPM_BUILD_ROOT/%{httpd_confdir}/hdp_mon_nagios_addons.conf
  57. echo "<Directory /usr/share/hdp>" >> $RPM_BUILD_ROOT/%{httpd_confdir}/hdp_mon_nagios_addons.conf
  58. echo " Options None" >> $RPM_BUILD_ROOT/%{httpd_confdir}/hdp_mon_nagios_addons.conf
  59. echo " AllowOverride None" >> $RPM_BUILD_ROOT/%{httpd_confdir}/hdp_mon_nagios_addons.conf
  60. echo " Order allow,deny" >> $RPM_BUILD_ROOT/%{httpd_confdir}/hdp_mon_nagios_addons.conf
  61. echo " Allow from all" >> $RPM_BUILD_ROOT/%{httpd_confdir}/hdp_mon_nagios_addons.conf
  62. echo "</Directory>" >> $RPM_BUILD_ROOT/%{httpd_confdir}/hdp_mon_nagios_addons.conf
  63. %files
  64. %defattr(-,root,root)
  65. %{nagioshdpscripts_dir}/*
  66. %attr(0755,root,root)%{nagiosplugin_dir}/*
  67. %{httpd_confdir}/hdp_mon_nagios_addons.conf
  68. %clean
  69. %__rm -rf $RPM_BUILD_ROOT
  70. %changelog
  71. * Fri Feb 17 2011 Hortonworks <ambari-group@hortonworks.com>
  72. - Initial version