Annotation of pkgsrc/lang/ruby/rubyversion.mk, revision 1.7
1.7 ! taca 1: # $NetBSD: rubyversion.mk,v 1.6 2005/01/16 11:48:56 taca Exp $
1.1 taca 2: #
3:
4: .ifndef _RUBYVERSION_MK
5: _RUBYVERSION_MK= # defined
6:
7: .include "../../mk/bsd.prefs.mk"
8:
9: # current supported Ruby's version
10: RUBY16_VERSION?= 1.6.8
1.7 ! taca 11: RUBY18_VERSION?= 1.8.2
1.1 taca 12:
13: # default Ruby packages
14: RUBY_VER_DEFAULT= 18
15:
16: # RUBY_VERSION_DEFAULT defines default version for Ruby related
17: # packages and user can define in mk.conf. (1.6 or 1.8)
18: #
19: RUBY_VERSION_DEFAULT?= 1.8
20:
21: # RUBY_VERSION defines the specific Ruby's version which is supported
22: # by the package. It should be defined by packages whose distfiles
23: # are contained by Ruby's release distribution.
24: #
25: # Default value is set to ${RUBY_VERSION_DEFAULT}
26: #
27: .if !defined(RUBY_VERSION)
28: .if ${RUBY_VERSION_DEFAULT} == "1.6"
29: RUBY_VERSION?= ${RUBY16_VERSION}
30: .elif ${RUBY_VERSION_DEFAULT} == "1.8"
31: RUBY_VERSION?= ${RUBY18_VERSION}
32: .endif
33: .endif
34:
35: # RUBY_VERSION_SUPPORTED defines the list of ${RUBY_VER} which is
36: # supported by the package. It should be defined by The pacakges
37: # for specific version Ruby.
38: #
39: RUBY_VERSION_SUPPORTED?= 16 18
40:
1.4 taca 41: # RUBY_VERSION_LIST defines the list of ${RUBY_VER} which is known to
42: # this framework.
43: #
1.5 taca 44: RUBY_VERSION_LIST= 16,18
1.4 taca 45:
1.1 taca 46: # RUBY_NOVERSION should be set to "Yes" if the package dosen't depend on
47: # any specific version of ruby command. In this case, package's
48: # name begin with "ruby-".
49: # If RUBY_NOVERSION is "No" (default), the package's name is begin
50: # with ${RUBY_NAME}; "ruby16-", "ruby18" and so on.
51: #
52: # It also affects to RUBY_DOCDIR, RUBY_EXAMPLESDIR...
53: #
54: RUBY_NOVERSION?= No
55:
56: # _RUBY_VER_MAJOR, _RUBY_VER_MINOR, _RUBY_VERS_TEENY is defined from
57: # version of Ruby. It could be used in packages' Makefile but
58: # it isn't recommended.
59: #
60: _RUBY_VER_MAJOR= ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/}
61: _RUBY_VER_MINOR= ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/}
62: _RUBY_VERS_TEENY= ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\3/}
63:
64: # RUBY_VER defines Ruby base release.
65: #
66: RUBY_VER= ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}
67:
1.3 taca 68: #
1.6 taca 69: # RUBY_HAS_ARCHLIB This package contains machine dependent binaries.
70: # RUBY_REQD Minimum required Ruby's version
1.3 taca 71: #
1.6 taca 72: .if defined(RUBY_HAS_ARCHLIB) && empty(RUBY_HAS_ARCHLIB:M[nN][oO])
73: .if ${RUBY_VER} == "16"
74: RUBY_REQD?= ${RUBY16_VERSION}
75: .elif ${RUBY_VER} == "18"
76: RUBY_REQD?= ${RUBY18_VERSION}
77: .endif
78: .else
1.3 taca 79: .if ${RUBY_VER} == "16"
80: RUBY_REQD?= 1.6.8
81: .elif ${RUBY_VER} == "18"
82: RUBY_REQD?= 1.8.1
83: .endif
1.6 taca 84: .endif
1.3 taca 85:
1.1 taca 86: # RUBY_SUFFIX is appended to Ruby's commands; ruby, irb and so on.
87: #
88: RUBY_SUFFIX?= ${RUBY_VER}
89:
90: # RUBY_NAME defines executable's name of Ruby itself.
91: #
92: RUBY_NAME?= ruby${RUBY_SUFFIX}
93:
94: # RUBY_PKGPREFIX is prefix part for ruby based packages.
95: #
96: RUBY_PKGPREFIX?= ${RUBY_NAME}
97:
98: # RUBY_VER_DIR is used as part of Ruby's library directories.
99: #
100: RUBY_VER_DIR?= ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
101:
102: # Simple check for package availability with Ruby's version.
103: #
104: .if empty(RUBY_VERSION_SUPPORTED:M${RUBY_VER})
105: PKG_FAIL_REASON+= "This package isn't supported by ${RUBY_NAME}."
106: .endif
107:
108: # RUBY_NOVERSION specifies that package dosen't depends on any
109: # version of Ruby.
110: #
111: .if empty(RUBY_NOVERSION:M[nN][oO])
112: RUBY_SUFFIX=
113: RUBY_NAME= ruby
114: .endif
115:
116: # RUBY related command's full pathname.
117: #
118: RUBY?= ${LOCALBASE}/bin/${RUBY_NAME}
119: RDOC?= ${LOCALBASE}/bin/rdoc${RUBY_VER}
120:
121: #
122: # RUBY_ARCH is used architecture depended direcotry name.
123: #
124: .if ${OPSYS} != "Linux"
125: RUBY_ARCH?= ${LOWER_ARCH}-${LOWER_OPSYS}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}
126: .else
127: RUBY_ARCH?= ${LOWER_ARCH}-${LOWER_OPSYS}-gnu
128: .endif
129:
130: #
1.5 taca 131: # RUBY_DLEXT is suffix of extention library.
132: #
133: .if ${OPSYS} == "Darwin"
134: RUBY_DLEXT= bundle
135: .else
136: RUBY_DLEXT= so
137: .endif
138:
139: #
1.1 taca 140: # common PATH
141: #
142: RUBY_LIBDIR?= ${LOCALBASE}/lib/ruby/${RUBY_VER_DIR}
143: RUBY_ARCHLIBDIR?= ${RUBY_LIBDIR}/${RUBY_ARCH}
144: RUBY_SITELIBDIR?= ${LOCALBASE}/lib/ruby/site_ruby/${RUBY_VER_DIR}
145: RUBY_SITEARCHLIBDIR?= ${RUBY_SITELIBDIR}/${RUBY_ARCH}
146: RUBY_DOCDIR?= ${LOCALBASE}/share/doc/${RUBY_NAME}
147: RUBY_EXAMPLESDIR?= ${LOCALBASE}/share/examples/${RUBY_NAME}
148:
149: #
150: # make ruby based packages' distfiles to one place.
151: #
152: RUBY_DIST_SUBDIR?= ruby
153:
154: #
155: # MAKE_ENV
156: #
157: MAKEFLAGS+= RUBY_VER=${RUBY_VER}
158:
159: #
160: # PLIST
161: #
162: PLIST_RUBY_DIRS= RUBY_LIBDIR="${RUBY_LIBDIR}" \
163: RUBY_ARCHLIBDIR="${RUBY_ARCHLIBDIR}" \
164: RUBY_SITELIBDIR="${RUBY_SITELIBDIR}" \
165: RUBY_SITEARCHLIBDIR="${RUBY_SITEARCHLIBDIR}" \
166: RUBY_DOCDIR="${RUBY_DOCDIR}" \
1.5 taca 167: RUBY_EXAMPLESDIR="${RUBY_EXAMPLESDIR}" \
168: RUBY_DLEXT="${RUBY_DLEXT}"
1.1 taca 169:
170: PLIST_SUBST+= RUBY_VER="${RUBY_VER}" \
171: ${PLIST_RUBY_DIRS:S,DIR="${LOCALBASE}/,DIR=",}
1.2 taca 172: MESSAGE_SUBST+= RUBY_VER="${RUBY_VER}" \
173: ${PLIST_RUBY_DIRS:S,DIR="${LOCALBASE}/,DIR=",}
1.1 taca 174:
175: .endif # _RUBY_MK
CVSweb <webmaster@jp.NetBSD.org>