]> git.pld-linux.org Git - packages/rpm-pld-macros.git/blame - macros.ruby
explicitly set CMAKE_SYSTEM_{NAME,PROCESSOR} in %cmake; rel 2
[packages/rpm-pld-macros.git] / macros.ruby
CommitLineData
603fd8a1
JR
1# Ruby specific macro definitions.
2
3%__ruby /usr/bin/ruby
4
a40cd61f
JB
5# helpers to get rbconfig parameter
6%__ruby_rbconfig() %(%{__ruby} -r rbconfig -e 'print RbConfig::CONFIG["%1"]' 2>/dev/null || echo ERROR)
7%__ruby_rbconfig_path() %(%{__ruby} -r rbconfig -r pathname -e 'print Pathname(RbConfig::CONFIG["%1"]).cleanpath' 2>/dev/null || echo ERROR)
8
603fd8a1
JR
9# Ruby ABI version
10# NOTE: %ruby_version may be empty, depending how Ruby was built
11%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
a40cd61f
JB
12# Ruby arch combo (CPU-OS, e.g. i686-linux)
13%ruby_arch %{expand:%%global ruby_arch %{__ruby_rbconfig arch}}%ruby_arch
603fd8a1
JR
14
15%ruby_archdir %{expand:%%global ruby_archdir %{__ruby_rbconfig_path archdir}}%ruby_archdir
16%ruby_libdir %{expand:%%global ruby_libdir %{__ruby_rbconfig rubylibdir}}%ruby_libdir
17%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
18%ruby_rubylibdir %{expand:%%global ruby_rubylibdir %{__ruby_rbconfig_path rubylibdir}}%ruby_rubylibdir
a40cd61f 19%ruby_rubyhdrdir %{expand:%%global ruby_rubyhdrdir %{__ruby_rbconfig_path rubyhdrdir}}%ruby_rubyhdrdir
603fd8a1
JR
20%ruby_vendorarchdir %{expand:%%global ruby_vendorarchdir %{__ruby_rbconfig vendorarchdir}}%ruby_vendorarchdir
21%ruby_vendorlibdir %{expand:%%global ruby_vendorlibdir %{__ruby_rbconfig_path vendorlibdir}}%ruby_vendorlibdir
22%ruby_sitearchdir %{expand:%%global ruby_sitearchdir %{__ruby_rbconfig sitearchdir}}%ruby_sitearchdir
23%ruby_sitedir %{expand:%%global ruby_sitedir %{__ruby_rbconfig sitedir}}%ruby_sitedir
24%ruby_sitelibdir %{expand:%%global ruby_sitelibdir %{__ruby_rbconfig_path sitelibdir}}%ruby_sitelibdir
25%ruby_rdocdir /usr/share/rdoc
26%ruby_vendordir %{expand:%%global ruby_vendordir %{__ruby_rbconfig vendordir}}%ruby_vendordir
27%ruby_version %{expand:%%global ruby_version %(r=%{__ruby_rbconfig ruby_version}; echo ${r:-%%nil})}%ruby_version
28
29%ruby_gemdir %{expand:%%global ruby_gemdir %(%{__ruby} -r rubygems -e 'puts Gem.respond_to?(:default_dirs) ? Gem.default_dirs[:system][:gem_dir] : Gem.path.first' 2>/dev/null || echo ERROR)}%{ruby_gemdir}
30%ruby_specdir %{ruby_gemdir}/specifications
31
32# deprecated, ruby 2.0 noarch packages are versionless and extension dependency is generated by rpm5
33%ruby_ver_requires_eq %{nil}
34%ruby_mod_ver_requires_eq %{nil}
35
f224c382 36%__gem_helper %{_rpmconfigdir}/gem_helper.rb
603fd8a1
JR
37
38%gem_build(f:j:) \
39 %__gem_helper build \\\
40 %{-f:-f%{-f*}} \\\
41 %{!-j:%{_smp_mflags}}%{-j:-j%{-j*}}
42
43%gem_install(i:n:C) \
44 DESTDIR=${DESTDIR:-%{buildroot}} \\\
45 %__gem_helper install \\\
46 --env-shebang --rdoc --ri --force --ignore-dependencies \\\
47 %{!-i:--install-dir %{buildroot}%{ruby_gemdir}}%{-i:--install-dir %{-i*}} \\\
48 %{!-n:--bindir %{buildroot}%{_bindir}}%{-n:--bindir%{-n*}} \\\
49 %{!-C:--fix-permissions}
This page took 0.054573 seconds and 4 git commands to generate.