%global gem_name whenever Name: rubygem-%{gem_name} Version: 0.9.2 Release: 1%{?dist} Summary: Cron jobs in ruby Group: Development/Languages License: MIT URL: https://github.com/javan/whenever Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # https://github.com/javan/whenever/pull/483/files#diff-0 Source1: whenever.1 # https://github.com/javan/whenever/pull/483/files#diff-1 Source2: wheneverize.1 BuildArch: noarch BuildRequires: rubygems-devel # missing shoulda and rails on EPEL7 %if ! 0%{?rhel} BuildRequires: rubygem(activesupport) >= 2.3.4 BuildRequires: rubygem(chronic) >= 0.6.3 BuildRequires: rubygem(minitest) BuildRequires: rubygem(mocha) >= 0.9.5 BuildRequires: rubygem(shoulda) >= 2.1.1 %endif %if 0%{?fedora} && 0%{?fedora} <= 20 || 0%{?rhel} && 0%{?rhel} <= 7 Requires: ruby(release) Requires: ruby(rubygems) Requires: rubygem(chronic) >= 0.6.3 Requires: rubygem(activesupport) >= 2.3.4 Provides: rubygem(%{gem_name}) = %{version} %endif %description Clean ruby syntax for writing and deploying cron jobs. %package doc Summary: Documentation for %{name} Group: Documentation BuildArch: noarch Requires: %{name} = %{version}-%{release} %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 %build gem build %{gem_name}.gemspec %gem_install %install mkdir -p %{buildroot}%{gem_dir} cp -a .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ mkdir -p %{buildroot}%{_bindir} cp -a .%{_bindir}/* \ %{buildroot}%{_bindir}/ mkdir -p %{buildroot}%{_mandir}/man1 install -p -m 0644 %{SOURCE1} %{buildroot}%{_mandir}/man1 install -p -m 0644 %{SOURCE2} %{buildroot}%{_mandir}/man1 %check # Disable testsuite for EPEL 7 %if ! 0%{?rhel} pushd .%{gem_instdir} %if 0%{?fedora} && 0%{?fedora} <= 20 || 0%{?rhel} && 0%{?rhel} <= 7 ruby -Ilib -e 'Dir.glob "./test/**/*_test.rb", &method(:require)' %else # Test suite using Minitest 5.x needs some hacks sed -i \ -e "/test\/unit/ s/^/#/" \ -e "s/Test::Unit::TestCase/Minitest::Test/" \ -e "s/assert_raise_/assert_raises_/g" \ -e "s/assert_raise\>/assert_raises/g" \ -e "s/assert_not_/refute_/g" \ -e "s/assert_no_/refute_/g" \ test/functional/*.rb test/unit/*.rb test/*.rb ruby -rminitest/autorun -Ilib -e 'Dir.glob "./test/**/*_test.rb", &method(:require)' %endif popd %endif %files %doc %{gem_instdir}/LICENSE %dir %{gem_instdir} %{_bindir}/whenever %{_bindir}/wheneverize %{_mandir}/man1/whenever.1* %{_mandir}/man1/wheneverize.1* %{gem_instdir}/bin %{gem_libdir} %exclude %{gem_cache} %{gem_spec} %exclude %{gem_instdir}/.gitignore %exclude %{gem_instdir}/.travis.yml %files doc %doc %{gem_docdir} %doc %{gem_instdir}/README.md %doc %{gem_instdir}/CHANGELOG.md %{gem_instdir}/test %{gem_instdir}/Gemfile %{gem_instdir}/Rakefile %{gem_instdir}/%{gem_name}.gemspec %changelog * Tue Sep 2 2014 František Dvořák - 0.9.2-1 - Initial package