X-Git-Url: https://git.tld-linux.org/?p=packages%2Frpm-tld-macros.git;a=blobdiff_plain;f=macros.ruby;h=c6133e919fcbadd8eb600f6ba377f5510be90f86;hp=e0d309a669fb04c59529a9d9cab87f7c574733c2;hb=44acd4f502565ebe81a9aa7b49406dd2c7428f86;hpb=b5115bb76a6795a89fadf5f4e7161f26203c7678 diff --git a/macros.ruby b/macros.ruby index e0d309a..c6133e9 100644 --- a/macros.ruby +++ b/macros.ruby @@ -2,18 +2,21 @@ %__ruby /usr/bin/ruby +# helpers to get rbconfig parameter +%__ruby_rbconfig() %(%{__ruby} -r rbconfig -e 'print RbConfig::CONFIG["%1"]' 2>/dev/null || echo ERROR) +%__ruby_rbconfig_path() %(%{__ruby} -r rbconfig -r pathname -e 'print Pathname(RbConfig::CONFIG["%1"]).cleanpath' 2>/dev/null || echo ERROR) + # Ruby ABI version # NOTE: %ruby_version may be empty, depending how Ruby was built %ruby_abi %{expand:%%global ruby_abi %(%{__ruby} -r rbconfig -e 'print [RbConfig::CONFIG["MAJOR"], RbConfig::CONFIG["MINOR"]].join(".")' 2>/dev/null || echo ERROR)}%ruby_abi - -# get rbconfig parameter -%__ruby_rbconfig() %(%{__ruby} -r rbconfig -e 'print RbConfig::CONFIG["%1"]' 2>/dev/null || echo ERROR) -%__ruby_rbconfig_path() %(%{__ruby} -r rbconfig -r pathname -e 'print Pathname(RbConfig::CONFIG["%1"]).cleanpath' 2>/dev/null || echo ERROR) +# Ruby arch combo (CPU-OS, e.g. i686-linux) +%ruby_arch %{expand:%%global ruby_arch %{__ruby_rbconfig arch}}%ruby_arch %ruby_archdir %{expand:%%global ruby_archdir %{__ruby_rbconfig_path archdir}}%ruby_archdir %ruby_libdir %{expand:%%global ruby_libdir %{__ruby_rbconfig rubylibdir}}%ruby_libdir %ruby_ridir %{expand:%%global ruby_ridir %(%{__ruby} -r rbconfig -e 'print File.join(RbConfig::CONFIG["datadir"], "ri", "system")' 2>/dev/null || echo ERROR)}%ruby_ridir %ruby_rubylibdir %{expand:%%global ruby_rubylibdir %{__ruby_rbconfig_path rubylibdir}}%ruby_rubylibdir +%ruby_rubyhdrdir %{expand:%%global ruby_rubyhdrdir %{__ruby_rbconfig_path rubyhdrdir}}%ruby_rubyhdrdir %ruby_vendorarchdir %{expand:%%global ruby_vendorarchdir %{__ruby_rbconfig vendorarchdir}}%ruby_vendorarchdir %ruby_vendorlibdir %{expand:%%global ruby_vendorlibdir %{__ruby_rbconfig_path vendorlibdir}}%ruby_vendorlibdir %ruby_sitearchdir %{expand:%%global ruby_sitearchdir %{__ruby_rbconfig sitearchdir}}%ruby_sitearchdir @@ -30,7 +33,7 @@ %ruby_ver_requires_eq %{nil} %ruby_mod_ver_requires_eq %{nil} -%__gem_helper %{_usrlibrpm}/gem_helper.rb +%__gem_helper %{_rpmconfigdir}/gem_helper.rb %gem_build(f:j:) \ %__gem_helper build \\\