%global gem_name openshift-origin-controller # Conditionally set required macros for distros without rubygems-devel This can # be removed once https://bugzilla.redhat.com/show_bug.cgi?id=788001 is # resolved. %if 0%{?el6}%{?fc16} %global rubyabi 1.8 %global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) %global gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem %global gem_docdir %{gem_dir}/doc/%{gem_name}-%{version} %global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version} %global gem_libdir %{gem_instdir}/lib %global gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec %endif Summary: Rails engine for the OpenShift Broker API Name: rubygem-%{gem_name} Version: 0.14.15 Release: 9%{?dist} Group: Development/Tools License: ASL 2.0 URL: http://openshift.redhat.com Source0: http://mirror.openshift.com/pub/openshift-origin/source/rubygem-%{gem_name}/%{gem_name}-%{version}.gem # https://github.com/openshift/crankcase/pull/390 Patch0: openshift-origin-controller_fix_test_deps.patch # This patch is actually not needed upstream. The OpenShift team is in the # process of renaming the packages for Fedora. Once the packages are accepted # the packages will be renamed on the master branch to match Fedora. #https://github.com/openshift/crankcase/blob/master/stickshift/controller/lib/stickshift-controller.rb Patch1: openshift-origin-controller_stickshift-common-load.patch Requires: ruby(abi) >= 1.8 Requires: rubygems Requires: rubygem(state_machine) Requires: rubygem(openshift-origin-common) Requires: rubygem(mongo) %if 0%{?rhel} == 6 BuildRequires: rubygems %else BuildRequires: rubygems-devel %endif BuildArch: noarch Provides: rubygem(%{gem_name}) = %version %description This packages contains a Rails engine that provides the majority of the OpenShift Broker API. %prep gem unpack %{SOURCE0} %setup -q -D -T -n %{gem_name}-%{version} gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec # Note: The patching of the spec file must happen after the 'gem spec' command. %patch0 -p1 %patch1 -p1 %build mkdir -p .%{gem_dir} # Create the gem as gem install only works on a gem file 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 -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/ rm -rf %{buildroot}%{gem_instdir}/test # https://github.com/openshift/crankcase/pull/344 chmod 0644 %{buildroot}%{gem_libdir}/stickshift-controller/app/models/application.rb chmod 0644 %{buildroot}%{gem_libdir}/stickshift-controller/app/models/gear.rb chmod 0644 %{buildroot}%{gem_libdir}/stickshift-controller/app/controllers/base_controller.rb %files %dir %{gem_instdir} %{gem_instdir}/Gemfile %{gem_instdir}/Rakefile %{gem_libdir} %{gem_instdir}/%{gem_name}.gemspec %{gem_spec} %doc %{gem_instdir}/LICENSE %doc %{gem_instdir}/COPYRIGHT %doc %{gem_docdir} %doc %{gem_instdir}/README.md %exclude %{gem_cache} %exclude %{gem_instdir}/%{name}.spec %changelog * Tue Aug 21 2012 Brenton Leanhardt - 0.14.15-9 - Adding rubygem-mongo require - Patching openshift-origin-common load * Mon Aug 20 2012 Brenton Leanhardt - 0.14.15-8 - Properly recreate the gemspec with 'gem spec' - Dropped upstreamed openshift-origin-controller_gemspec_fixes.patch * Fri Aug 17 2012 Brenton Leanhardt - 0.14.15-7 - Fixed prep and build sections - Removed ruby-devel BuildRequire - Removed useless CONFIGURE_ARGS variable - Proper usage of gem_libdir and gem_instdir in install section - Correctly incorrect usage of doc directive and fixed incorrect gem_libdir exclusion * Thu Aug 16 2012 Brenton Leanhardt - 0.14.15-6 - Using rubygem-devel macros - Removed open4, and json requirement and patched gemspec. These were used only for tests. - Remove unneeded activemodel require * Fri Aug 10 2012 Brenton Leanhardt 0.14.15-5 - Added patch to fix project homepage * Tue Aug 07 2012 Brenton Leanhardt 0.14.15-4 - Removed tests - Fixed file modes * Mon Aug 06 2012 Brenton Leanhardt 0.14.15-3 - Removed unneeded BuildRoot tag - Removed unneeded clean section - Removed unneeded defattr usage - Removed unneeded cached gem - Removed unneeded highline, parseconfig and json_pure BuildRequires - Fixed the Source0 URL * Thu Aug 02 2012 Troy Dawson 0.14.15-1 - Renamed package to openshift-origin-node - Updated to the latest upstream stable release - Added LICENSE and COPYRIGHT to doc * Fri Jul 20 2012 Brenton Leanhardt 0.14.4-1 - Latest upstream release - Switched Source0 to gem * Wed Jul 18 2012 Brenton Leanhardt 0.14.2-1 - Added ruby-devel and rubygem-devel build requires and replaced the ruby_sitelib and geminstdir macros with the standard macros. - Renamed %%gemname to %%gem_name so %%geminstdir will work correctly. - Fixed several file mode problems with libraries - Rebased to the latest upstream version * Mon Jul 09 2012 Brenton Leanhardt 0.14.1-1 - Initial package creation for Fedora - Removed rcov