From 30b9f2f8eca951058f0aa0e4cefc617d4de148f7 Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Mon, 25 Nov 2013 23:49:43 -0700 Subject: add macros for el6 On RHEL 6 prior to 6.5, many of the modern Ruby and Gem RPM macros are not available. Conditionally define these macros if the happen to be missing. (See also https://rhn.redhat.com/errata/RHBA-2013-1694.html) --- rubygem-unicorn.spec | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rubygem-unicorn.spec b/rubygem-unicorn.spec index 5a00b9b..c809d7e 100644 --- a/rubygem-unicorn.spec +++ b/rubygem-unicorn.spec @@ -40,6 +40,16 @@ Provides: rubygem(%{gem_name}) = %{version} # Do not autorequire shebangs in the -doc subpackage %global __requires_exclude_from ^%{gem_instdir}/(t|test|script|examples)/.*$ +# macros for RHEL6 compatibility: +%{!?gem_dir: %global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)} +%{!?gem_instdir: %global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version}} +%{!?gem_libdir: %global gem_libdir %{gem_instdir}/lib} +%{!?gem_cache: %global gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem} +%{!?gem_spec: %global gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec} +%{!?gem_docdir: %global gem_docdir %{gem_dir}/doc/%{gem_name}-%{version}} +%{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"]')} + + %description Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of -- cgit