Annotation of pkgsrc/lang/ruby/rubyversion.mk, revision 1.4
1.4 ! taca 1: # $NetBSD: rubyversion.mk,v 1.3 2004/11/29 07:05:00 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:
1.4 ! taca 41: # RUBY_VERSION_LIST defines the list of ${RUBY_VER} which is known to
! 42: # this framework.
! 43: #
! 44: RUBY_VERSION_LIST= 16 18
! 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: #
69: # RUBY_REQD is minimum required Ruby's version
70: #
71: .if ${RUBY_VER} == "16"
72: RUBY_REQD?= 1.6.8
73: .elif ${RUBY_VER} == "18"
74: RUBY_REQD?= 1.8.1
75: .endif
76:
1.1 taca 77: # RUBY_SUFFIX is appended to Ruby's commands; ruby, irb and so on.
78: #
79: RUBY_SUFFIX?= ${RUBY_VER}
80:
81: # RUBY_NAME defines executable's name of Ruby itself.
82: #
83: RUBY_NAME?= ruby${RUBY_SUFFIX}
84:
85: # RUBY_PKGPREFIX is prefix part for ruby based packages.
86: #
87: RUBY_PKGPREFIX?= ${RUBY_NAME}
88:
89: # RUBY_VER_DIR is used as part of Ruby's library directories.
90: #
91: RUBY_VER_DIR?= ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
92:
93: # Simple check for package availability with Ruby's version.
94: #
95: .if empty(RUBY_VERSION_SUPPORTED:M${RUBY_VER})
96: PKG_FAIL_REASON+= "This package isn't supported by ${RUBY_NAME}."
97: .endif
98:
99: # RUBY_NOVERSION specifies that package dosen't depends on any
100: # version of Ruby.
101: #
102: .if empty(RUBY_NOVERSION:M[nN][oO])
103: RUBY_SUFFIX=
104: RUBY_NAME= ruby
105: .endif
106:
107: # RUBY related command's full pathname.
108: #
109: RUBY?= ${LOCALBASE}/bin/${RUBY_NAME}
110: RDOC?= ${LOCALBASE}/bin/rdoc${RUBY_VER}
111:
112: #
113: # RUBY_ARCH is used architecture depended direcotry name.
114: #
115: .if ${OPSYS} != "Linux"
116: RUBY_ARCH?= ${LOWER_ARCH}-${LOWER_OPSYS}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}
117: .else
118: RUBY_ARCH?= ${LOWER_ARCH}-${LOWER_OPSYS}-gnu
119: .endif
120:
121: #
122: # common PATH
123: #
124: RUBY_LIBDIR?= ${LOCALBASE}/lib/ruby/${RUBY_VER_DIR}
125: RUBY_ARCHLIBDIR?= ${RUBY_LIBDIR}/${RUBY_ARCH}
126: RUBY_SITELIBDIR?= ${LOCALBASE}/lib/ruby/site_ruby/${RUBY_VER_DIR}
127: RUBY_SITEARCHLIBDIR?= ${RUBY_SITELIBDIR}/${RUBY_ARCH}
128: RUBY_DOCDIR?= ${LOCALBASE}/share/doc/${RUBY_NAME}
129: RUBY_EXAMPLESDIR?= ${LOCALBASE}/share/examples/${RUBY_NAME}
130:
131: #
132: # make ruby based packages' distfiles to one place.
133: #
134: RUBY_DIST_SUBDIR?= ruby
135:
136: #
137: # MAKE_ENV
138: #
139: MAKEFLAGS+= RUBY_VER=${RUBY_VER}
140:
141: #
142: # PLIST
143: #
144: PLIST_RUBY_DIRS= RUBY_LIBDIR="${RUBY_LIBDIR}" \
145: RUBY_ARCHLIBDIR="${RUBY_ARCHLIBDIR}" \
146: RUBY_SITELIBDIR="${RUBY_SITELIBDIR}" \
147: RUBY_SITEARCHLIBDIR="${RUBY_SITEARCHLIBDIR}" \
148: RUBY_DOCDIR="${RUBY_DOCDIR}" \
149: RUBY_EXAMPLESDIR="${RUBY_EXAMPLESDIR}"
150:
151: PLIST_SUBST+= RUBY_VER="${RUBY_VER}" \
152: ${PLIST_RUBY_DIRS:S,DIR="${LOCALBASE}/,DIR=",}
1.2 taca 153: MESSAGE_SUBST+= RUBY_VER="${RUBY_VER}" \
154: ${PLIST_RUBY_DIRS:S,DIR="${LOCALBASE}/,DIR=",}
1.1 taca 155:
156: .endif # _RUBY_MK
CVSweb <webmaster@jp.NetBSD.org>