.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "DH_RUBY 1" .TH DH_RUBY 1 "2019-02-17" "" "" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" dh_ruby \- debhelper7 build system for Ruby software .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBdh_ruby\fR [\fI\s-1OPTIONS\s0\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBdh_ruby\fR is a Debhelper 7 build system for Ruby software. It will automatically build and install files contained in Ruby packages, trying to work as close to Rubygems as possible but respecting Debian standards for Ruby packages. .PP dh_ruby can automatically run your tests against all supported Ruby versions, see the \*(L"\s-1FILES\*(R"\s0 section below. .PP See dh_ruby \-\-help for details. .SH "SOURCE PACKAGE LAYOUT" .IX Header "SOURCE PACKAGE LAYOUT" \&\fBdh_ruby\fR supports two different source package styles: single-binary source packages, and multi-binary source packages. .SS "Single-binary layout" .IX Subsection "Single-binary layout" The default layout is the \fBsingle-binary\fR layout. This is the layout used by most Ruby packages upstream, i.e. Ruby code in \fIlib\fR/, executable programs in \&\fIbin\fR/, etc. Packages imported from Rubygems using \fB\fBgem2deb\fB\|(1)\fR will have this layout. .PP When using this layout, \fBdh_ruby\fR will install files (Ruby code, executables, gemspecs) to the \fIfirst binary package\fR listed in \&\fIdebian/control\fR. .SS "Multi-binary layout" .IX Subsection "Multi-binary layout" \&\fBgem2deb\fR version \fI0.4.0\fR introduced support for the \fBmulti-binary\fR layout. This layout should be used when you have a set of different Ruby packages maintained upstream in a single \s-1VCS,\s0 and you decide that you also want to maintain a single source package in Debian having the different components as separate binary packages. .PP In this layout, the source package contains the separate components in subdirectories where each of them will use the standard Ruby layout (\fIlib\fR/, \fIbin\fR/, etc). .PP This layout does not support creating separate binary packages from the same root directory. For those cases, see the documentation on \&\fI\s-1DH_RUBY_USE_DH_AUTO_INSTALL_DESTDIR\s0\fR below. .PP To indicate that you want to use a multi-binary layout, we have to 1) list your multiple binary packages in \fIdebian/control\fR as usual, and add an extra-field called \fIX\-DhRuby-Root\fR to each binary package stanza, indicating which directory has to be used as the root for that binary package. .PP An example: .PP .Vb 2 \& Source: mymultibinarypackage \& [...] \& \& Package: ruby\-foo \& X\-DhRuby\-Root: path/to/foo \& [...] \& \& Package: ruby\-bar \& X\-DhRuby\-Root: path/to/bar .Ve .PP The corresponding source package should be layed out like this: .PP .Vb 11 \& foo/ \& foo.gemspec \& lib/ \& foo.rb \& bin/foo \& bar/ \& bar.gemspec \& lib/ \& bar.rb \& bin/ \& bar .Ve .PP Important notes about multi-binary packages and the usage of \&\fIX\-DhRuby-Root\fR: .IP "\(bu" 4 If your package uses the multi-binary layout, it must include `\fIgem2deb\fR (>= 0.4.0~)` in \fIBuild-Depends\fR. .Sp \&\fBVersion 0.4.0 had a bug in the support for native extensions\fR in multi-binary packages, so if your package uses the multi-binary feature and at least one of the sub-components has native extensions, you must use `\fIgem2deb\fR (>= 0.4.1~)` in \fIBuild-Depends\fR instead. .IP "\(bu" 4 The path indicated in \fIX\-DhRuby-Root\fR, as you have probably guessed by now, must be relative to the root of the source package. .IP "\(bu" 4 If any binary package declares a \fIX\-DhRuby-Root\fR field, all other binary packages that don't have one will be ignored by \fBdh_ruby\fR. .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-\-clean\fR, \fB\-\-configure\fR, \fB\-\-build\fR, \fB\-\-test\fR, \fB\-\-install\fR" 4 .IX Item "--clean, --configure, --build, --test, --install" Commands called by debhelper at various steps of the build process. .IP "\fB\-\-print\-supported\fR" 4 .IX Item "--print-supported" Prints the supported Ruby versions. .IP "\fB\-h\fR, \fB\-\-help\fR" 4 .IX Item "-h, --help" Displays \fBdh_ruby\fR usage information. .IP "\fB\-v\fR, \fB\-\-version\fR" 4 .IX Item "-v, --version" Displays \fBdh_ruby\fR version information. .IP "\fB\-\-gem\-install\fR" 4 .IX Item "--gem-install" This option indicates that the build should use the \fBgem\fR command to install the files, instead of the homegrown installer. Native packages will be installed to \fI/usr/lib/$ARCH/rubygems\-integration/$RUBY_VERSION\fR, while pure Ruby packages will be installed to \fI/usr/share/rubygems\-integration/all\fR. .Sp There is an internal whitelist of directories from the source package that need to be installed, but we can't possibly know all possibilities: if a package needs to install a directory that is not automatically installed, use \&\fI\s-1DH_RUBY_GEM_INSTALL_WHITELIST_APPEND\s0\fR. If you want to exclude a directory from being installed, use \fI\s-1DH_RUBY_GEM_INSTALL_BLACKLIST_APPEND\s0\fR. .IP "\fB\-\-setuprb\fR" 4 .IX Item "--setuprb" This option indicates that the build should use \fIsetup.rb\fR rather than the usual gem-based build. To take effect, this option must come first ! .SH "ENVIRONMENT VARIABLES" .IX Header "ENVIRONMENT VARIABLES" .IP "\fI\s-1DH_RUBY\s0\fR" 4 .IX Item "DH_RUBY" Use this variable to pass command line parameters to dh_ruby. For example in debian/rules: .Sp .Vb 1 \& export DH_RUBY = \-\-gem\-install .Ve .IP "\fI\s-1DH_RUBY_IGNORE_TESTS\s0\fR" 4 .IX Item "DH_RUBY_IGNORE_TESTS" This is a space-separated list of tests that dh_ruby will ignore during package build. The available test names are the names of all supported Ruby versions (you can list them with `dh_ruby \-\-print\-supported`). .Sp If set to \*(L"all\*(R", all tests will be ignored during the package build. .IP "\fI\s-1DH_RUBY_USE_DH_AUTO_INSTALL_DESTDIR\s0\fR" 4 .IX Item "DH_RUBY_USE_DH_AUTO_INSTALL_DESTDIR" If this variable is defined (to anything), dh_ruby will respect the directory informed by \fBdh_auto_install\fR\|(1), usually \fIdebian/tmp\fR. By default, gem2deb will install files to debian/\fIpackage\fR, where \fIpackage\fR is the first binary package listed in debian/control. .Sp This is useful for multi-binary source packages that don't conform to the supported layout (i.e. separate subdirectories each with \fIlib\fR/, \&\fIbin\fR/ etc). Using this, all files will be installed to \fIdebian/tmp\fR, and you can them distribute them into separate binary packages by using \&\fIdebian/$package.install\fR files or explicit shell calls in \&\fIdebian/rules\fR. .Sp Mixing \fI\s-1DH_RUBY_USE_DH_AUTO_INSTALL_DESTDIR\s0\fR and multi-binary layout is not supported. .IP "\fI\s-1DH_RUBY_GEMSPEC\s0\fR" 4 .IX Item "DH_RUBY_GEMSPEC" Determines which file contain the gem specification with package metadata. By default, dh_ruby will read metadata from a .gemspec file in the root of source package directory. You can use this variable to override that if you want to provide custom metadata for the Debian package. .Sp In the case there are more than one .gemspec in the source package root, you will \fIneed\fR to use \s-1DH_RUBY_GEMSPEC\s0 to instruct dh_ruby about which one to use. .IP "\fI\s-1DH_RUBY_GEM_INSTALL_WHITELIST_APPEND\s0\fR." 4 .IX Item "DH_RUBY_GEM_INSTALL_WHITELIST_APPEND." When using \-\-gem\-install, this variable adds \fBfiles\fR to the list of files that need to be installed. Entries must be separated by spaces, and can be either exact filenames, of glob expressions (e.g. \fI*.txt\fR, \fIfoo/*\fR). .Sp Directories cannot be added directly, only files. If you want to include an entire directory, say \fIfoo\fR, use a glob expression like \fIfoo/*\fR. .Sp Note that by default all top-level files are automatically blacklisted, except \&\fIVERSION*\fR which is used by some packages. If you need a top-level file to be installed, you need to whitelist it. .IP "\fI\s-1DH_RUBY_GEM_INSTALL_BLACKLIST_APPEND\s0\fR." 4 .IX Item "DH_RUBY_GEM_INSTALL_BLACKLIST_APPEND." When using \-\-gem\-install, this variable adds files to the list of files that \&\s-1SHOULD NOT\s0 be installed. Entries must be separated by spaces, and must be either specific filenames, or glob expressions (e.g. \fI*.txt\fR). .Sp Directories cannot be blacklisted directly. To blacklist an entire directory, use a glob expression such as \fIfoo/*\fR. .SH "FILES" .IX Header "FILES" .IP "debian/\fIruby\-test\-files.yaml\fR, debian/\fIruby\-tests.rake\fR, debian/\fIruby\-tests.rb\fR" 4 .IX Item "debian/ruby-test-files.yaml, debian/ruby-tests.rake, debian/ruby-tests.rb" Theses files can be used to explicitly tell dh_ruby how to run the tests in your package. When running the tests, dh_ruby will automatically set \s-1RUBYLIB\s0 to include the appropriate directories where the package files were installed in your package to make sure the tests use them instead of the files in the source directory. .Sp \&\fBYour package can only contain at most one of these files.\fR .Sp debian/\fIruby\-test\-files.yaml\fR must contain a \s-1YAML\s0 document with a list of test files to be run. If the package metadata contains an explicit list of test files, \fBgem2deb\fR\|(1) will automatically generate this file for you. Example from ruby-mime-types: .Sp .Vb 3 \& \-\-\- \& \- test/test_mime_type.rb \& \- test/test_mime_types.rb .Ve .Sp debian/\fIruby\-tests.rake\fR can be used to run the tests with \fBrake\fR\|(1). If you use this file, your package must Build-Depend on the \fIrake\fR package. You can use anything you would use in a regular Rakefile, but you must define a default task. gem2deb includes a utility test task that makes it easier for you by creating a default task automatically. Example: .Sp .Vb 4 \& require \*(Aqgem2deb/rake/testtask\*(Aq \& Gem2Deb::Rake::TestTask.new do |t| \& t.test_files = FileList[\*(Aqtest/*_test.rb\*(Aq] \& end .Ve .Sp You can also use the equivalent RSpec task: .Sp .Vb 4 \& require \*(Aqgem2deb/rake/spectask\*(Aq \& Gem2Deb::Rake::RSpecTask.new do |spec| \& spec.pattern = \*(Aq./spec/**/*_spec.rb\*(Aq \& end .Ve .Sp If debian/\fIruby\-tests.rb\fR exists, it will be run with each supported Ruby version, and must finish with a exit status of \fI0\fR, otherwise dh_ruby assumes the tests failed. A simple example: .Sp .Vb 7 \& require \*(Aqtest/unit\*(Aq \& require \*(Aqmypackage\*(Aq # if \*(Aqmypackage.rb\*(Aq or \*(Aqmypackage.so\*(Aq was not installed properly, this will fail \& class MyPackageTest < Test::Unit::TestCase \& def test_features \& assert_equal 4, MyPackage.sum(2,2) \& end \& end .Ve .IP "debian/\fIdh_ruby.mk\fR" 4 .IX Item "debian/dh_ruby.mk" If this file is present, dh_ruby will call \fBmake\fR passing it as the makefile during the build, in the \fIclean\fR, \fIbuild\fR, and \fIinstall\fR steps, like this: .RS 4 .IP "clean: \fBmake \-f debian/dh_ruby.mk clean\fR" 4 .IX Item "clean: make -f debian/dh_ruby.mk clean" .PD 0 .IP "build: \fBmake \-f debian/dh_ruby.mk\fR" 4 .IX Item "build: make -f debian/dh_ruby.mk" .IP "install: \fBmake \-f debian/dh_ruby.mk install\fR" 4 .IX Item "install: make -f debian/dh_ruby.mk install" .RE .RS 4 .PD .Sp If you want the upstream Makefile to be used, just make \fIdebian/dh_ruby.mk\fR a symlink to \fI../Makefile\fR. .RE .IP "debian/\fIdh_ruby.rake\fR" 4 .IX Item "debian/dh_ruby.rake" If this file is present, dh_ruby will call \fBrake\fR passing it as the rakefile during the build, in the \fIclean\fR, \fIbuild\fR, and \fIinstall\fR steps, like this: .RS 4 .IP "clean: \fBrake \-f debian/dh_ruby.rake clean\fR" 4 .IX Item "clean: rake -f debian/dh_ruby.rake clean" .PD 0 .IP "build: \fBrake \-f debian/dh_ruby.rake\fR" 4 .IX Item "build: rake -f debian/dh_ruby.rake" .IP "install: \fBrake \-f debian/dh_ruby.rake install\fR" 4 .IX Item "install: rake -f debian/dh_ruby.rake install" .RE .RS 4 .PD .Sp If you want the upstream Rakefile to be used, just make \fIdebian/dh_ruby.rake\fR a symlink to \fI../Rakefile\fR. .RE .IP "debian/\fIgemspec\fR" 4 .IX Item "debian/gemspec" If this file exists, it will be used as the package gemspec, regardless of \&\fImetadata.yml\fR and any \fI*.gemspec\fR that exists in the upstream source. Using this is only advised on single-binary source packages, and the behavior of this feature is undefined for multi-binary source packages (see \fB\s-1SOURCE PACKAGE LAYOUT\s0\fR above). .Sp If debian/\fIgemspec\fR is a symlink, it will first be expanded, and then the symlink target will be used as a gemspec. .Sp Hint: for packages with multiple gemspec, you can have debian/\fIgemspec\fR as a symlink pointing to the one you want to use. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBgem2deb\fR(1) .SH "COPYRIGHT AND AUTHORS" .IX Header "COPYRIGHT AND AUTHORS" Copyright (c) 2011, Lucas Nussbaum .PP This program is free software: you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. .PP This program is distributed in the hope that it will be useful, but \s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \&\s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE.\s0 See the \&\s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with this program. If not, see .