Skip to content

Commit 2e68296

Browse files
committed
Initial implementation of Ruby macros
These macros provide similar interfaces to Fedora's macros, but are implemented in such a way that it dynamically gets the correct information from the Ruby interpreter.
1 parent 2b217d5 commit 2e68296

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

debbuild-macros.spec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ Provides: python3-deb-macros
4141
# Provides perl macros
4242
Provides: debbuild-macros-perl
4343
Provides: perl-deb-macros
44+
# Provides ruby macros
45+
Provides: debbuild-macros-ruby
46+
Provides: ruby-deb-macros
4447
# Provides golang macros
4548
Provides: debbuild-macros-golang
4649
Provides: go-deb-macros

macros.ruby

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# SPDX-License-Identifier: MIT
2+
3+
%__ruby %{_bindir}/ruby
4+
5+
%ruby_version %(%{__ruby} -r rbconfig -e 'print RbConfig::CONFIG["ruby_version"]')
6+
7+
%ruby_libprefixdir %(%{__ruby} -rrbconfig -e 'puts RbConfig::CONFIG["rubylibprefix"]')
8+
%ruby_libdir %(%{__ruby} -rrbconfig -e 'puts RbConfig::CONFIG["rubylibdir"]')
9+
%ruby_libarchdir %(%{__ruby} -rrbconfig -e 'puts RbConfig::CONFIG["archdir"]')
10+
11+
# This is the local lib/arch and should not be used for packaging.
12+
%ruby_sitedir %(%{__ruby} -rrbconfig -e 'puts RbConfig::CONFIG["sitedir"]')
13+
%ruby_sitelibdir %(%{__ruby} -rrbconfig -e 'puts RbConfig::CONFIG["sitelibdir"]')
14+
%ruby_sitearchdir %(%{__ruby} -rrbconfig -e 'puts RbConfig::CONFIG["sitearchdir"]')
15+
16+
# This is the general location for libs/archs compatible with all
17+
# or most of the Ruby versions available in the repositories.
18+
%ruby_vendordir %(%{__ruby} -rrbconfig -e 'puts RbConfig::CONFIG["vendordir"]')
19+
%ruby_vendorlibdir %(%{__ruby} -rrbconfig -e 'puts RbConfig::CONFIG["vendorlibdir"]')
20+
%ruby_vendorarchdir %(%{__ruby} -rrbconfig -e 'puts RbConfig::CONFIG["vendorarchdir"]')

0 commit comments

Comments
 (0)