hdp_mon_nagios_addons.spec 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. %define name hdp_mon_nagios_addons
  24. %define release %(cat %{_sourcedir}/release.txt)
  25. %define version %(cat %{_sourcedir}/version.txt)
  26. %define buildroot %{_tmppath}/%{name}-%{version}-buildroot
  27. Summary: Nagios Add-ons for HDP Monitoring Dashboard
  28. Name: %{name}
  29. Version: %{version}
  30. URL: http://incubator.apache.org/ambari
  31. Release: %{release}%{?dist}
  32. License: Apache License, Version 2.0
  33. Group: System Environment/Base
  34. Source: %{name}-%{version}.tar.gz
  35. Buildroot: %{buildroot}
  36. Requires: nagios = 3.5.0-99, nagios-plugins = 1.4.9, php >= 5
  37. %define nagioshdpscripts_dir %{_prefix}/share/hdp/nagios
  38. %define nagiosplugin_dir %{_libdir}/nagios/plugins
  39. %if 0%{?suse_version}
  40. %define httpd_confdir %{_sysconfdir}/apache2/conf.d
  41. %else
  42. %define httpd_confdir %{_sysconfdir}/httpd/conf.d
  43. %endif
  44. BuildArchitectures: noarch
  45. %description
  46. This package provides add-on helper scripts and plugins for nagios for
  47. monitoring of a Hadoop Cluster
  48. %prep
  49. %setup -q -n %{name}-%{version}
  50. %build
  51. %install
  52. # Flush any old RPM build root
  53. %__rm -rf $RPM_BUILD_ROOT
  54. %__mkdir -p $RPM_BUILD_ROOT/%{nagioshdpscripts_dir}/
  55. %__mkdir -p $RPM_BUILD_ROOT/%{nagiosplugin_dir}/
  56. %__mkdir -p $RPM_BUILD_ROOT/%{httpd_confdir}/
  57. %__cp -rf scripts/* $RPM_BUILD_ROOT/%{nagioshdpscripts_dir}/
  58. %__cp -rf plugins/* $RPM_BUILD_ROOT/%{nagiosplugin_dir}/
  59. echo "Alias /ambarinagios %{_prefix}/share/hdp" >> $RPM_BUILD_ROOT/%{httpd_confdir}/hdp_mon_nagios_addons.conf
  60. echo "<Directory /usr/share/hdp>" >> $RPM_BUILD_ROOT/%{httpd_confdir}/hdp_mon_nagios_addons.conf
  61. echo " Options None" >> $RPM_BUILD_ROOT/%{httpd_confdir}/hdp_mon_nagios_addons.conf
  62. echo " AllowOverride None" >> $RPM_BUILD_ROOT/%{httpd_confdir}/hdp_mon_nagios_addons.conf
  63. echo " Order allow,deny" >> $RPM_BUILD_ROOT/%{httpd_confdir}/hdp_mon_nagios_addons.conf
  64. echo " Allow from all" >> $RPM_BUILD_ROOT/%{httpd_confdir}/hdp_mon_nagios_addons.conf
  65. echo "</Directory>" >> $RPM_BUILD_ROOT/%{httpd_confdir}/hdp_mon_nagios_addons.conf
  66. %files
  67. %defattr(-,root,root)
  68. %{nagioshdpscripts_dir}/*
  69. %attr(0755,root,root)%{nagiosplugin_dir}/*
  70. %{httpd_confdir}/hdp_mon_nagios_addons.conf
  71. %clean
  72. %__rm -rf $RPM_BUILD_ROOT
  73. %changelog
  74. * Fri Feb 17 2011 Hortonworks <ambari-group@hortonworks.com>
  75. - Initial version