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