%global gem_name zbxapi %if 0%{?rhel} <= 6 && 0%{?fedora} <= 16 %global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) %global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version} %global gem_libdir %{gem_instdir}/lib %global gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem %global gem_spec %{gem_dir}/specifications/%%{gem_name}-%{version}.gemspec %global gem_docdir %{gem_dir}/doc/%{gem_name}-%{version} %global rubyabi 1.8 %else %global rubyabi 1.9.1 %endif Name: rubygem-%{gem_name} Version: 0.2.415 Release: 3%{?dist} Summary: Ruby wrapper to the Zabbix API Group: Development/Languages License: LGPLv2 URL: http://trac.red-tux.net/ # Source0: http://rubygems.org/downloads/%{gem_name}-%{version}.gem Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem # This pulls in all the patches for the Zabbix 2.0 from the project's git # repository until upstream releases the next version. # https://github.com/red-tux/zbxapi Patch0: rubygem-zbxapi.zabbix2.0_support.patch Requires: ruby(abi) = %{rubyabi} Requires: ruby(rubygems) Requires: rubygem(json) BuildRequires: ruby BuildRequires: ruby(abi) = %{rubyabi} %if 0%{?rhel} <= 6 && 0%{?fedora} <= 16 BuildRequires: rubygems %else BuildRequires: rubygems-devel %endif BuildArch: noarch Provides: rubygem(%{gem_name}) = %{version} %description Provides a straight forward interface to manipulate Zabbix servers using the Zabbix API. %package doc Summary: Documentation for %{name} Group: Documentation Requires: %{name} = %{version}-%{release} BuildArch: noarch %description doc Documentation for %{name} %prep gem unpack %{SOURCE0} %setup -q -D -T -n %{gem_name}-%{version} gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec %patch0 -p1 %build mkdir -p ./%{gem_dir} gem build %{gem_name}.gemspec gem install -V \ --local \ --install-dir ./%{gem_dir} \ --bindir ./%{_bindir} \ --force \ --rdoc \ %{gem_name}-%{version}.gem %install mkdir -p %{buildroot}%{gem_dir} cp -pa ./%{gem_dir}/* %{buildroot}%{gem_dir}/ %check # There are no checks yet. %files %defattr(-, root, root, -) %dir %{gem_instdir} %{gem_instdir}/api_classes %if 0%{?rhel} <= 6 && 0%{?fedora} <= 16 %{gem_instdir}/.require_paths %endif %{gem_instdir}/zbxapi.rb %{gem_instdir}/zbxapi %exclude %{gem_cache} %{gem_spec} %files doc %doc %{gem_docdir} %changelog * Thu Jan 10 2013 Russell Harrison - 0.2.415-3 - Fix upstream cut/paste error in resulting patch. * Thu Jan 10 2013 Russell Harrison - 0.2.415-2 - Bring in upstream patches to fix the Zabbix API 2.0 support * Wed Jan 09 2013 Russell Harrison - 0.2.415-1 - Updates to allow for building with Fedora and EPEL * Thu Dec 13 2012 Kenny Woodson - 0.2.0 - Initial RPM build for rubygem-zbxapi