Annotation of pkgsrc/lang/ruby/rubyversion.mk, revision 1.1

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

CVSweb <webmaster@jp.NetBSD.org>