Annotation of pkgsrc/lang/ruby/rubyversion.mk, revision 1.3
1.3 ! taca 1: # $NetBSD: rubyversion.mk,v 1.2 2004/11/28 15:38:35 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
11: RUBY18_VERSION?= 1.8.1
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:
41: # RUBY_NOVERSION should be set to "Yes" if the package dosen't depend on
42: # any specific version of ruby command. In this case, package's
43: # name begin with "ruby-".
44: # If RUBY_NOVERSION is "No" (default), the package's name is begin
45: # with ${RUBY_NAME}; "ruby16-", "ruby18" and so on.
46: #
47: # It also affects to RUBY_DOCDIR, RUBY_EXAMPLESDIR...
48: #
49: RUBY_NOVERSION?= No
50:
51: # _RUBY_VER_MAJOR, _RUBY_VER_MINOR, _RUBY_VERS_TEENY is defined from
52: # version of Ruby. It could be used in packages' Makefile but
53: # it isn't recommended.
54: #
55: _RUBY_VER_MAJOR= ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/}
56: _RUBY_VER_MINOR= ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/}
57: _RUBY_VERS_TEENY= ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\3/}
58:
59: # RUBY_VER defines Ruby base release.
60: #
61: RUBY_VER= ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}
62:
1.3 ! taca 63: #
! 64: # RUBY_REQD is minimum required Ruby's version
! 65: #
! 66: .if ${RUBY_VER} == "16"
! 67: RUBY_REQD?= 1.6.8
! 68: .elif ${RUBY_VER} == "18"
! 69: RUBY_REQD?= 1.8.1
! 70: .endif
! 71:
1.1 taca 72: # RUBY_SUFFIX is appended to Ruby's commands; ruby, irb and so on.
73: #
74: RUBY_SUFFIX?= ${RUBY_VER}
75:
76: # RUBY_NAME defines executable's name of Ruby itself.
77: #
78: RUBY_NAME?= ruby${RUBY_SUFFIX}
79:
80: # RUBY_PKGPREFIX is prefix part for ruby based packages.
81: #
82: RUBY_PKGPREFIX?= ${RUBY_NAME}
83:
84: # RUBY_VER_DIR is used as part of Ruby's library directories.
85: #
86: RUBY_VER_DIR?= ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
87:
88: # Simple check for package availability with Ruby's version.
89: #
90: .if empty(RUBY_VERSION_SUPPORTED:M${RUBY_VER})
91: PKG_FAIL_REASON+= "This package isn't supported by ${RUBY_NAME}."
92: .endif
93:
94: # RUBY_NOVERSION specifies that package dosen't depends on any
95: # version of Ruby.
96: #
97: .if empty(RUBY_NOVERSION:M[nN][oO])
98: RUBY_SUFFIX=
99: RUBY_NAME= ruby
100: .endif
101:
102: # RUBY related command's full pathname.
103: #
104: RUBY?= ${LOCALBASE}/bin/${RUBY_NAME}
105: RDOC?= ${LOCALBASE}/bin/rdoc${RUBY_VER}
106:
107: #
108: # RUBY_ARCH is used architecture depended direcotry name.
109: #
110: .if ${OPSYS} != "Linux"
111: RUBY_ARCH?= ${LOWER_ARCH}-${LOWER_OPSYS}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}
112: .else
113: RUBY_ARCH?= ${LOWER_ARCH}-${LOWER_OPSYS}-gnu
114: .endif
115:
116: #
117: # common PATH
118: #
119: RUBY_LIBDIR?= ${LOCALBASE}/lib/ruby/${RUBY_VER_DIR}
120: RUBY_ARCHLIBDIR?= ${RUBY_LIBDIR}/${RUBY_ARCH}
121: RUBY_SITELIBDIR?= ${LOCALBASE}/lib/ruby/site_ruby/${RUBY_VER_DIR}
122: RUBY_SITEARCHLIBDIR?= ${RUBY_SITELIBDIR}/${RUBY_ARCH}
123: RUBY_DOCDIR?= ${LOCALBASE}/share/doc/${RUBY_NAME}
124: RUBY_EXAMPLESDIR?= ${LOCALBASE}/share/examples/${RUBY_NAME}
125:
126: #
127: # make ruby based packages' distfiles to one place.
128: #
129: RUBY_DIST_SUBDIR?= ruby
130:
131: #
132: # MAKE_ENV
133: #
134: MAKEFLAGS+= RUBY_VER=${RUBY_VER}
135:
136: #
137: # PLIST
138: #
139: PLIST_RUBY_DIRS= RUBY_LIBDIR="${RUBY_LIBDIR}" \
140: RUBY_ARCHLIBDIR="${RUBY_ARCHLIBDIR}" \
141: RUBY_SITELIBDIR="${RUBY_SITELIBDIR}" \
142: RUBY_SITEARCHLIBDIR="${RUBY_SITEARCHLIBDIR}" \
143: RUBY_DOCDIR="${RUBY_DOCDIR}" \
144: RUBY_EXAMPLESDIR="${RUBY_EXAMPLESDIR}"
145:
146: PLIST_SUBST+= RUBY_VER="${RUBY_VER}" \
147: ${PLIST_RUBY_DIRS:S,DIR="${LOCALBASE}/,DIR=",}
1.2 taca 148: MESSAGE_SUBST+= RUBY_VER="${RUBY_VER}" \
149: ${PLIST_RUBY_DIRS:S,DIR="${LOCALBASE}/,DIR=",}
1.1 taca 150:
151: .endif # _RUBY_MK
CVSweb <webmaster@jp.NetBSD.org>