Policies/Ruby
From Mandriva Community Wiki
Ruby packaging policy
Contents |
[edit] Rules
[edit] Naming
These naming guidelines only apply to ruby packages whose main purpose is providing a Ruby library; packages that mainly provide user-level tools that happen to be written in Ruby do not need to follow these naming guidelines.
The name of a ruby extension/library package must be of the form ruby-UPSTREAM. If the upstream name "UPSTREAM" contains "ruby", that should be dropped from the name. For example, the SQLite database driver for ruby is called "sqlite3-ruby", the corresponding package should be called ruby-sqlite3, and not ruby-sqlite3-ruby.
[edit] Macros
The following macros are defined in /etc/rpm/macros.d/ruby.macros which is provided by ruby rpm, and use ruby themselves, so you always need to BuildRequire at least ruby.
- %ruby_version %(ruby -rrbconfig -e 'print Config::CONFIG["ruby_version"]')
- %ruby_archdir %(ruby -rrbconfig -e 'print Config::CONFIG["archdir"]')
- %ruby_libdir %(ruby -rrbconfig -e 'print Config::CONFIG["rubylibdir"]')
- %ruby_sitearchdir %(ruby -rrbconfig -e 'print Config::CONFIG["sitearchdir"]')
- %ruby_sitelibdir %(ruby -rrbconfig -e 'print Config::CONFIG["sitelibdir"]')
- %ruby_gemdir %(ruby -rrbconfig -e 'include Config; print CONFIG["rubylibdir"].sub(CONFIG["ruby_version"], "gems/#{CONFIG["ruby_version"]}")')
- %ruby_ridir %(ruby -rrbconfig -e 'include Config; print File.join(CONFIG["datadir"], "ri", CONFIG["ruby_version"])')
[edit] Tags
- Group should be Development/Ruby
- BuildArch must be noarch for pure ruby packages

