1.\" $OpenBSD: ruby-module.5,v 1.3 2011/12/06 11:40:25 espie Exp $ 2.\" 3.\" Copyright (c) 2008 Marc Espie, Jeremy Evans 4.\" 5.\" All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 16.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR 17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26.\" 27.Dd $Mdocdate: December 6 2011 $ 28.Dt RUBY-MODULE 5 29.Os 30.Sh NAME 31.Nm ruby-module 32.Nd lang/ruby port module 33.Sh DESCRIPTION 34This manual page documents the behavior of setting 35.Li MODULE=lang/ruby 36in the 37.Xr ports 7 38tree. 39.Pp 40Sets 41.Ev MODRUBY_REV , 42.Ev RUBY , 43.Ev RAKE , 44.Ev RSPEC , 45.Ev MODRUBY_BIN_TESTRB , 46.Ev MODRUBY_BIN_RSPEC , 47.Ev MODRUBY_RUN_DEPENDS , 48.Ev MODRUBY_LIB_DEPENDS , 49.Ev MODRUBY_BUILD_DEPENDS , 50.Ev MODRUBY_ICONV_DEPENDS , 51.Ev MODRUBY_LIBDIR , 52.Ev MODRUBY_DOCDIR , 53.Ev MODRUBY_SITEARCHDIR , 54.Ev MODRUBY_SITEDIR , 55.Ev MODRUBY_ARCH , 56.Ev MODRUBY_EXAMPLEDIR , 57.Ev MODRUBY_RUBY_ADJ , 58.Ev MODRUBY_ADJ_FILES , 59.Ev GEM_BIN_SUFFIX , 60.Ev GEM_MAN_SUFFIX , 61.Ev MODRUBY_LIBREV , 62.Ev MODRUBY_BINREV , 63.Ev MODRUBY_PKGSPEC , 64.Ev MODRUBY_PKG_PREFIX , 65.Ev MODRUBY_RAKE_DEPENDS , 66.Ev MODRUBY_RSPEC_DEPENDS , 67.Ev MODRUBY_WANTLIB , 68.Ev MODRUBY_FLAVOR , 69.Ev MODRUBY_REGRESS , 70.Ev MODRUBY_REGRESS_TARGET , 71.Ev MODRUBY_REGRESS_DIR , 72.Ev MODRUBY_REGRESS_ENV , 73.Ev MODRUBY_BUILD_TARGET , 74.Ev MODRUBY_INSTALL_TARGET , 75.Ev MODRUBY_EXTRACT_TARGET , 76.Ev GEM , 77.Ev GEM_BIN , 78.Ev GEM_LIB , 79.Ev GEM_BASE_LIB , 80.Ev GEM_ABS_PATH , 81.Ev GEM_BASE_BIN , 82and 83.Ev GEM_FLAGS . 84.Pp 85Appends to 86.Ev CATEGORIES 87and 88.Ev SUBST_VARS . 89Appends to 90.Ev BUILD_DEPENDS 91unless 92.Ev MODRUBY_BUILDDEP 93is set to No or 94.Ev NO_BUILD 95is set to Yes. 96Appends to 97.Ev RUN_DEPENDS 98unless 99.Ev MODRUBY_RUNDEP 100is set to No. 101.Pp 102.Ev RUBY , 103.Ev RAKE , 104and 105.Ev MODRUBY_BIN_TESTRB 106are the path to the ruby, rake, and 107testrb binaries for the related ruby implementation. 108.Ev RSPEC 109and 110.Ev MODRUBY_BIN_RSPEC 111are the path to the spec (rspec 1) and 112rspec (rspec 2) binaries for the related ruby implementation. 113.Pp 114.Ev MODRUBY_RUBY_ADJ 115is a command that takes filename arguments and replaces 116the /usr/bin/env ruby shebang lines with 117.Ev RUBY . 118.Ev MODRUBY_ADJ_FILES 119is a list of filename patterns that will automatically have 120.Ev MODRUBY_RUBY_ADJ 121called on them during pre-configure. 122.Pp 123Creates a do-regress target if 124.Ev MODRUBY_REGRESS 125is used and one is not already defined. 126.Ev MODRUBY_REGRESS 127can be set to ruby, rake, rspec, rspec2, or testrb to 128choose the appropriate binary to run the regress tests. 129.Ev MODRUBY_REGRESS_ENV 130can be used to set environment variables for the regress tests. 131.Ev MODRUBY_REGRESS_DIR 132can be used to set the directory in which to execute 133the regress tests, it defaults to 134.Ev WRKSRC . 135.Ev MODRUBY_REGRESS_TARGET 136sets the argument to the regress test program. 137.Pp 138Supports additional 139.Ev CONFIGURE_STYLE Ns s , 140and setting specific 141.Ev CONFIGURE_STYLE Ns s 142modifies some additional parameters: 143.Bl -bullet 144.It 145The "ruby gem" 146.Ev CONFIGURE_STYLE 147should be used for pure ruby gems without C extensions. 148This adds 149.Ev PKG_ARCH 150= * and adds ruby19, rbx, and jruby 151.Ev FLAVOR Ns s 152to the port, so the same port can build packages for multiple versions of ruby. 153.It 154The "ruby gem ext" 155.Ev CONFIGURE_STYLE 156should be used for ruby gems with C extensions. 157This adds 158.Ev SHARED_ONLY Ns =Yes 159and adds 160.Ev MODRUBY_LIB_DEPENDS 161to 162.Ev LIB_DEPENDS 163and 164c, m, and 165.Ev MODRUBY_WANTLIB 166to 167.Ev WANTLIB . 168It also adds ruby19, rbx, and jruby 169.Ev FLAVOR Ns s 170to the port. 171.It 172The "ruby extconf" 173.Ev CONFIGURE_STYLE 174is similar to the "ruby gem ext" 175.Ev CONFIGURE_STYLE , 176except that it is used when the package is not distributed as a ruby gem. 177.El 178.Pp 179In order for ruby 1.9, rubinius, and jruby packages to be built from the same 180port directory, any gem dependencies specified in the port should use this 181format: 182.Pp 183.Dl category/ruby-foo,${MODRUBY_FLAVOR} 184.Pp 185Use of a ruby19, rbx, or jruby 186.Ev FLAVOR 187causes the 188.Ev FULLPKGNAME 189to use the 190.Ev FLAVOR 191instead of ruby as the package prefix. 192Specifying 193.Ev MODRUBY_FLAVOR 194is necessary so that if you are building a ruby 1.9 195package for the current port, it depends on the ruby 1.9 package of the 196dependencies. 197.Pp 198For ruby gem ports that can work on both ruby 1.8 and ruby 1.9, any binary 199file entries in the PLIST should be appended with 200.Ev GEM_BIN_SUFFIX . 201This is because the ruby 1.8 and ruby 1.9 gem binaries are both installed to 202.Pa ${LOCALBASE}/bin , 203and ruby 1.9 installs the binaries with a 19 suffix. 204Any man pages and other files that would be installed to locations not 205specific to a ruby implementation (such as under 206.Pa ${LOCALBASE}/share ) , 207should use 208.Ev GEM_MAN_SUFFIX 209before the extension so the different 210.Ev FLAVOR Ns s 211do not conflict. 212make update-plist currently removes 213.Ev GEM_BIN_SUFFIX 214and 215.Ev GEM_MAN_SUFFIX , 216so be careful when updating gem ports with binaries or man pages. 217.Sh SEE ALSO 218.Xr port-modules 5 219