sync
[bitrig.git] / share / man / man5 / ruby-module.5
blob6a95601b1149479435dc46553254f573b8f03341
1 .\"     $OpenBSD: ruby-module.5,v 1.9 2013/03/21 10:53:13 jmc 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: March 21 2013 $
28 .Dt RUBY-MODULE 5
29 .Os
30 .Sh NAME
31 .Nm ruby-module
32 .Nd lang/ruby port module
33 .Sh DESCRIPTION
34 This manual page documents the behavior of setting
35 .Li MODULE=lang/ruby
36 in the
37 .Xr ports 7
38 tree.
39 .Pp
40 Sets
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_WANTLIB ,
48 .Ev MODRUBY_RUN_DEPENDS ,
49 .Ev MODRUBY_LIB_DEPENDS ,
50 .Ev MODRUBY_BUILD_DEPENDS ,
51 .Ev MODRUBY_ICONV_DEPENDS ,
52 .Ev MODRUBY_RAKE_DEPENDS ,
53 .Ev MODRUBY_RSPEC_DEPENDS ,
54 .Ev MODRUBY_RSPEC2_DEPENDS ,
55 .Ev MODRUBY_RUBY_ADJ ,
56 .Ev MODRUBY_ADJ_FILES ,
57 .Ev MODRUBY_LIBDIR ,
58 .Ev MODRUBY_DOCDIR ,
59 .Ev MODRUBY_SITEARCHDIR ,
60 .Ev MODRUBY_SITEDIR ,
61 .Ev MODRUBY_EXAMPLEDIR ,
62 .Ev MODRUBY_ARCH ,
63 .Ev MODRUBY_LIBREV ,
64 .Ev MODRUBY_BINREV ,
65 .Ev MODRUBY_HANDLE_FLAVORS ,
66 .Ev MODRUBY_PKG_PREFIX ,
67 .Ev MODRUBY_FLAVOR ,
68 .Ev MODRUBY_TEST ,
69 .Ev MODRUBY_TEST_TARGET ,
70 .Ev MODRUBY_TEST_DIR ,
71 .Ev MODRUBY_TEST_ENV ,
72 .Ev MODRUBY_BUILD_TARGET ,
73 .Ev MODRUBY_INSTALL_TARGET ,
74 .Ev MODRUBY_EXTRACT_TARGET ,
75 .Ev GEM ,
76 .Ev GEM_BIN ,
77 .Ev GEM_LIB ,
78 .Ev GEM_BASE_LIB ,
79 .Ev GEM_ABS_PATH ,
80 .Ev GEM_BASE_BIN ,
81 .Ev GEM_BIN_SUFFIX ,
82 .Ev GEM_MAN_SUFFIX ,
83 and
84 .Ev GEM_FLAGS .
85 .Pp
86 Appends to
87 .Ev CATEGORIES
88 and
89 .Ev SUBST_VARS .
90 Appends to
91 .Ev BUILD_DEPENDS
92 unless
93 .Ev MODRUBY_BUILDDEP
94 is set to No or
95 .Ev NO_BUILD
96 is set to Yes.
97 Appends to
98 .Ev RUN_DEPENDS
99 unless
100 .Ev MODRUBY_RUNDEP
101 is set to No.
103 .Ev MODRUBY_ICONV_DEPENDS
104 is set to the dependency line for the iconv port for the version of ruby in
105 use.
106 .Ev MODRUBY_RAKE_DEPENDS
107 is set to the dependency line for the rake port for the version of ruby in
108 use.
109 .Ev MODRUBY_RSPEC_DEPENDS
110 is set to the dependency line for the rspec 1 port for the version of ruby in
111 use.
112 .Ev MODRUBY_RSPEC2_DEPENDS
113 is set to the dependency line for the rspec 2 port for the version of ruby in
114 use.
116 .Ev RUBY ,
117 .Ev RAKE ,
119 .Ev MODRUBY_BIN_TESTRB
120 are the path to the ruby, rake, and
121 testrb binaries for the related ruby implementation.
122 .Ev RSPEC
124 .Ev MODRUBY_BIN_RSPEC
125 are the path to the spec (rspec 1) and
126 rspec (rspec 2) binaries for the related ruby implementation.
128 .Ev MODRUBY_RUBY_ADJ
129 is a command that takes filename arguments and replaces
130 the /usr/bin/env ruby shebang lines with
131 .Ev RUBY .
132 .Ev MODRUBY_ADJ_FILES
133 is a list of filename patterns that will automatically have
134 .Ev MODRUBY_RUBY_ADJ
135 called on them during pre-configure.
137 Creates a do-test target if
138 .Ev MODRUBY_TEST
139 is used and one is not already defined.
140 .Ev MODRUBY_TEST
141 can be set to ruby, rake, rspec, rspec2, or testrb to
142 choose the appropriate binary to run the regress tests.
143 .Ev MODRUBY_TEST_ENV
144 can be used to set environment variables for the regress tests.
145 .Ev MODRUBY_TEST_DIR
146 can be used to set the directory in which to execute
147 the regress tests, it defaults to
148 .Ev WRKSRC .
149 .Ev MODRUBY_TEST_TARGET
150 sets the argument to the regress test program.
152 Supports additional
153 .Ev CONFIGURE_STYLE Ns s ,
154 and setting specific
155 .Ev CONFIGURE_STYLE Ns s
156 modifies some additional parameters:
157 .Bl -bullet
159 The "ruby gem"
160 .Ev CONFIGURE_STYLE
161 should be used for pure ruby gems without C extensions.
162 This adds
163 .Ev PKG_ARCH
164 = * and adds ruby18, ruby19, ruby20, rbx, and jruby
165 .Ev FLAVOR Ns s
166 to the port, so the same port can build packages for multiple versions of ruby.
168 The "ruby gem ext"
169 .Ev CONFIGURE_STYLE
170 should be used for ruby gems with C extensions.
171 This adds
172 .Ev SHARED_ONLY Ns =Yes
173 and adds
174 .Ev MODRUBY_LIB_DEPENDS
176 .Ev LIB_DEPENDS
178 c, m, and
179 .Ev MODRUBY_WANTLIB
181 .Ev WANTLIB .
182 It also adds ruby18, ruby19, ruby20, and rbx
183 .Ev FLAVOR Ns s
184 to the port.
185 If the C extension in the gem requires specific arguments to extconf.rb, set those
187 .Ev CONFIGURE_ARGS .
189 The "ruby extconf"
190 .Ev CONFIGURE_STYLE
191 is similar to the "ruby gem ext"
192 .Ev CONFIGURE_STYLE ,
193 except that it is used when the package is distributed with an extconf.rb file
194 and not as a ruby gem.
197 To ensure that dependencies use the same ruby implementation as the
198 current port, all ruby gem/extconf dependencies specified in the port
199 should use this format:
201 .Dl category/ruby-foo,${MODRUBY_FLAVOR}
203 Use of a ruby19, ruby20, rbx, or jruby
204 .Ev FLAVOR
205 causes the
206 .Ev FULLPKGNAME
207 to use the
208 .Ev FLAVOR
209 instead of ruby as the package prefix.
210 Specifying
211 .Ev MODRUBY_FLAVOR
212 is necessary so that if a ruby 1.9 package is being built for the current
213 port, it depends on the ruby 1.9 package of the
214 dependencies.
216 The ports system defaults to using ruby 1.9 if the version of ruby is not
217 specified.
218 If you want to specify a version for a gem/extconf port, use a specific
219 .Ev FLAVOR ,
220 such as ruby18 to use ruby 1.8.
221 If you want to specify a version for a non-gem/extconf port, set
222 .Ev MODRUBY_REV
223 for the version of ruby you want to use (1.8, 1.9, 2.0, jruby, rbx).
225 If you do not want the ports system to automatically set up
226 .Ev FLAVOR Ns s
227 when using a gem/extconf port, set
228 .Ev MODRUBY_HANDLE_FLAVORS
229 to No.
230 Similarly, if you want the ports system to automatically set up
231 .Ev FLAVOR Ns s
232 when using a non-gem/extconf port, set
233 .Ev MODRUBY_HANDLE_FLAVORS
234 to Yes.
235 When
236 .Ev MODRUBY_HANDLE_FLAVORS
237 is Yes, the ports system automatically adds the appropriate prefix to the
238 .Ev FULLPKGNAME
239 (e.g. ruby- for ruby 1.8, ruby19- for ruby 1.9).
240 Additionally, it adds
241 .Ev GEM_BIN_SUFFIX
243 .Ev GEM_MAN_SUFFIX
245 .Ev SUBST_VARS
246 so that the PLISTs will work on multiple ruby versions.
248 For ruby gem ports that can work on both ruby 1.8 and ruby 1.9, any binary
249 file entries in the PLIST should be appended with
250 .Ev GEM_BIN_SUFFIX .
251 This is because the ruby 1.8 and ruby 1.9 gem binaries are both installed to
252 .Pa ${LOCALBASE}/bin ,
253 and ruby 1.9 installs the binaries with a 19 suffix.
254 Any man pages and other files that would be installed to locations not
255 specific to a ruby implementation (such as under
256 .Pa ${LOCALBASE}/share ) ,
257 should use
258 .Ev GEM_MAN_SUFFIX
259 before the extension so the different
260 .Ev FLAVOR Ns s
261 do not conflict.
262 make update-plist currently removes
263 .Ev GEM_BIN_SUFFIX
265 .Ev GEM_MAN_SUFFIX ,
266 so be careful when updating gem ports with binaries or man pages.
267 .Sh SEE ALSO
268 .Xr port-modules 5