2012-03-18 06:35:17 +01:00
|
|
|
# $NetBSD: rails.mk,v 1.14 2012/03/18 05:35:17 taca Exp $
|
2011-03-23 15:22:49 +01:00
|
|
|
|
|
|
|
.if !defined(_RUBY_RAILS_MK)
|
|
|
|
_RUBY_RAILS_MK= # defined
|
|
|
|
|
|
|
|
#
|
|
|
|
# === User-settable variables ===
|
|
|
|
#
|
|
|
|
# RUBY_RAILS_DEFAULT
|
|
|
|
# Select default Ruby on Rails version.
|
|
|
|
#
|
2011-12-13 16:47:06 +01:00
|
|
|
# Possible values: 2 3 31
|
|
|
|
# Default: 3 31
|
2011-03-23 15:22:49 +01:00
|
|
|
#
|
|
|
|
#
|
|
|
|
# === Package-settable variables ===
|
|
|
|
#
|
2011-12-13 16:47:06 +01:00
|
|
|
# RUBY_RAILS_SUPPORTED
|
|
|
|
# The Ruby on Rails versions that are acceptable for the package.
|
|
|
|
#
|
|
|
|
# Possible values: 2 3 31
|
|
|
|
# Default: (empty)
|
|
|
|
#
|
|
|
|
# === Defined variables ===
|
|
|
|
#
|
2011-03-23 15:22:49 +01:00
|
|
|
# RUBY_RAILS
|
2011-12-13 16:47:06 +01:00
|
|
|
# Selected Ruby on Rails version.
|
2011-03-23 15:22:49 +01:00
|
|
|
#
|
2011-12-13 16:47:06 +01:00
|
|
|
# Possible values: 2 3 31
|
2011-03-23 15:22:49 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# current Ruby on Rails versions.
|
|
|
|
#
|
2011-08-17 16:11:18 +02:00
|
|
|
RUBY_RAILS2_VERSION?= 2.3.14
|
2012-03-18 06:19:55 +01:00
|
|
|
RUBY_RAILS3_VERSION?= 3.0.12
|
2012-03-18 06:35:17 +01:00
|
|
|
RUBY_RAILS31_VERSION?= 3.1.4
|
2011-03-23 15:22:49 +01:00
|
|
|
|
2011-12-13 16:47:06 +01:00
|
|
|
RUBY_RAILS_SUPPORTED?= # defined
|
|
|
|
RUBY_RAILS_DEFAULT?= 3
|
|
|
|
|
|
|
|
.if !empty(RUBY_RAILS_SUPPORTED) && ${RUBY_RAILS_SUPPORTED:[\#]} == 1
|
|
|
|
RUBY_RAILS= ${RUBY_RAILS_SUPPORTED}
|
2011-03-23 15:22:49 +01:00
|
|
|
_RUBY_RAILS_DEPENDS_EXACT= yes
|
|
|
|
.endif
|
|
|
|
|
2011-12-13 16:47:06 +01:00
|
|
|
.if empty(RUBY_RAILS)
|
2011-03-23 15:22:49 +01:00
|
|
|
_RUBY_INSTALLED_RAILS!= \
|
2011-12-13 16:47:06 +01:00
|
|
|
if ${PKG_INFO} -qe "${RUBY_PKGPREFIX}-rack>=1.3" || \
|
|
|
|
${PKG_INFO} -qe "${RUBY_PKGPREFIX}-activesupport>=3.1"; then \
|
|
|
|
${ECHO} 31; \
|
|
|
|
elif ${PKG_INFO} -qe "${RUBY_PKGPREFIX}-rack>=1.2" || \
|
|
|
|
${PKG_INFO} -qe "${RUBY_PKGPREFIX}-activesupport>=3.0<3.1"; then \
|
2011-03-23 15:22:49 +01:00
|
|
|
${ECHO} 3; \
|
|
|
|
elif ${PKG_INFO} -qe "${RUBY_PKGPREFIX}-rack<1.2" || \
|
|
|
|
${PKG_INFO} -qe "${RUBY_PKGPREFIX}-activesupport<3"; then \
|
|
|
|
${ECHO} 2; \
|
|
|
|
else \
|
|
|
|
${ECHO} "none"; \
|
|
|
|
fi
|
|
|
|
. if ${_RUBY_INSTALLED_RAILS} != "none"
|
2011-12-13 16:47:06 +01:00
|
|
|
RUBY_RAILS:= ${_RUBY_INSTALLED_RAILS}
|
|
|
|
. else
|
|
|
|
RUBY_RAILS:= ${RUBY_RAILS_DEFAULT}
|
2011-03-23 15:22:49 +01:00
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
2011-12-13 16:47:06 +01:00
|
|
|
.if ${RUBY_RAILS} == "2"
|
2011-03-23 15:22:49 +01:00
|
|
|
RUBY_RAILS_VERSION:= ${RUBY_RAILS2_VERSION}
|
2011-12-13 16:47:06 +01:00
|
|
|
.elif ${RUBY_RAILS} == "3"
|
2011-03-23 15:22:49 +01:00
|
|
|
RUBY_RAILS_VERSION:= ${RUBY_RAILS3_VERSION}
|
2011-12-13 16:47:06 +01:00
|
|
|
.else
|
|
|
|
RUBY_RAILS_VERSION:= ${RUBY_RAILS31_VERSION}
|
2011-03-23 15:22:49 +01:00
|
|
|
.endif
|
|
|
|
|
|
|
|
#
|
2011-12-13 16:47:06 +01:00
|
|
|
# If _RUBY_RAILS_DEPENDS_EXACT is defined, match exact version.
|
|
|
|
# Otherwise allow greater minor version.
|
2011-03-23 15:22:49 +01:00
|
|
|
#
|
2011-12-13 16:47:06 +01:00
|
|
|
_RAILS_MAJOR= ${RUBY_RAILS_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/}
|
|
|
|
_RAILS_MINOR= ${RUBY_RAILS_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/}
|
|
|
|
_RAILS_TEENY= ${RUBY_RAILS_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\3/}
|
2011-03-23 15:22:49 +01:00
|
|
|
|
2011-12-13 16:47:06 +01:00
|
|
|
.if !empty(_RUBY_RAILS_DEPENDS_EXACT)
|
|
|
|
_RAILS_NEXT!= ${EXPR} ${_RAILS_TEENY} + 1
|
|
|
|
_RAILS_DEP= \
|
|
|
|
>=${RUBY_RAILS_VERSION}<${_RAILS_MAJOR}.${_RAILS_MINOR}.${_RAILS_NEXT}
|
|
|
|
.else
|
|
|
|
_RAILS_NEXT!= ${EXPR} ${_RAILS_MINOR} + 1
|
|
|
|
_RAILS_DEP= >=${RUBY_RAILS_VERSION}<${_RAILS_MAJOR}.${_RAILS_NEXT}
|
2011-03-23 15:22:49 +01:00
|
|
|
.endif
|
|
|
|
|
2011-12-13 16:47:06 +01:00
|
|
|
#
|
2012-03-18 06:18:16 +01:00
|
|
|
MAKE_ENV+= RUBY_RAILS_DEFAULT=${RUBY_RAILS} \
|
|
|
|
RUBY_RAILS_SUPPORTED=${RUBY_RAILS}
|
|
|
|
#
|
|
|
|
MULTI+= RUBY_RAILS_DEFAULT=${RUBY_RAILS} \
|
|
|
|
RUBY_RAILS_SUPPORTED=${RUBY_RAILS}
|
2011-12-13 16:47:06 +01:00
|
|
|
|
2011-03-23 15:22:49 +01:00
|
|
|
RUBY_ACTIVESUPPORT?= ${RUBY_RAILS_VERSION}
|
|
|
|
RUBY_ACTIONPACK?= ${RUBY_RAILS_VERSION}
|
|
|
|
RUBY_ACTIVERECORD?= ${RUBY_RAILS_VERSION}
|
|
|
|
RUBY_ACTIVERESOURCE?= ${RUBY_RAILS_VERSION}
|
|
|
|
RUBY_ACTIONMAILER?= ${RUBY_RAILS_VERSION}
|
|
|
|
RUBY_RAILTIES?= ${RUBY_RAILS_VERSION}
|
|
|
|
|
|
|
|
RUBY_RAILS2_ACTIVESUPPORT= ../../devel/ruby-activesupport
|
|
|
|
RUBY_RAILS2_ACTIONPACK= ../../www/ruby-actionpack
|
|
|
|
RUBY_RAILS2_ACTIVERECORD= ../../databases/ruby-activerecord
|
|
|
|
RUBY_RAILS2_ACTIVERESOURCE= ../../www/ruby-activeresource
|
|
|
|
RUBY_RAILS2_ACTIONMAILER= ../../mail/ruby-actionmailer
|
2011-03-27 17:54:43 +02:00
|
|
|
RUBY_RAILS2_RAILS= ../../www/ruby-rails
|
2011-03-23 15:22:49 +01:00
|
|
|
|
|
|
|
RUBY_RAILS3_ACTIVESUPPORT= ../../devel/ruby-activesupport3
|
|
|
|
RUBY_RAILS3_ACTIVEMODEL= ../../devel/ruby-activemodel
|
|
|
|
RUBY_RAILS3_ACTIONPACK= ../../www/ruby-actionpack3
|
|
|
|
RUBY_RAILS3_ACTIVERECORD= ../../databases/ruby-activerecord3
|
|
|
|
RUBY_RAILS3_ACTIVERESOURCE= ../../www/ruby-activeresource3
|
|
|
|
RUBY_RAILS3_ACTIONMAILER= ../../mail/ruby-actionmailer3
|
|
|
|
RUBY_RAILS3_RAILTIES= ../../devel/ruby-railties
|
2011-03-27 17:54:43 +02:00
|
|
|
RUBY_RAILS3_RAILS= ../../www/ruby-rails3
|
2011-03-23 15:22:49 +01:00
|
|
|
|
2011-12-13 16:47:06 +01:00
|
|
|
RUBY_RAILS31_ACTIVESUPPORT= ../../devel/ruby-activesupport31
|
|
|
|
RUBY_RAILS31_ACTIVEMODEL= ../../devel/ruby-activemodel31
|
|
|
|
RUBY_RAILS31_ACTIONPACK= ../../www/ruby-actionpack31
|
|
|
|
RUBY_RAILS31_ACTIVERECORD= ../../databases/ruby-activerecord31
|
|
|
|
RUBY_RAILS31_ACTIVERESOURCE= ../../www/ruby-activeresource31
|
|
|
|
RUBY_RAILS31_ACTIONMAILER= ../../mail/ruby-actionmailer31
|
|
|
|
RUBY_RAILS31_RAILTIES= ../../devel/ruby-railties31
|
|
|
|
RUBY_RAILS31_RAILS= ../../www/ruby-rails31
|
|
|
|
|
|
|
|
.if ${RUBY_RAILS} == "2"
|
2011-03-23 15:22:49 +01:00
|
|
|
RUBY_ACTIVESUPPORT_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-activesupport${_RAILS_DEP}:${RUBY_RAILS2_ACTIVESUPPORT}
|
|
|
|
RUBY_ACTIONPACK_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-actionpack${_RAILS_DEP}:${RUBY_RAILS2_ACTIONPACK}
|
|
|
|
RUBY_ACTIVERECORD_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-activerecord${_RAILS_DEP}:${RUBY_RAILS2_ACTIVERECORD}
|
|
|
|
RUBY_ACTIVERESOURCE_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-activeresource${_RAILS_DEP}:${RUBY_RAILS2_ACTIVERESOURCE}
|
|
|
|
RUBY_ACTIONMAILER_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-actionmailer${_RAILS_DEP}:${RUBY_RAILS2_ACTIONMAILER}
|
|
|
|
RUBY_RAILTIES_DEPENDS= # empty
|
2011-03-27 17:54:43 +02:00
|
|
|
RUBY_RAILTIES_DEPENDS= # empty
|
|
|
|
RUBY_RAILS_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-rails${_RAILS_DEP}:${RUBY_RAILS2_RAILS}
|
2011-12-13 16:47:06 +01:00
|
|
|
.elif ${RUBY_RAILS} == "3"
|
2011-03-23 15:22:49 +01:00
|
|
|
RUBY_ACTIVESUPPORT_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-activesupport${_RAILS_DEP}:${RUBY_RAILS3_ACTIVESUPPORT}
|
|
|
|
RUBY_ACTIVEMODEL_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-activemodel${_RAILS_DEP}:${RUBY_RAILS3_ACTIVEMODEL}
|
|
|
|
RUBY_ACTIONPACK_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-actionpack${_RAILS_DEP}:${RUBY_RAILS3_ACTIONPACK}
|
|
|
|
RUBY_ACTIVERECORD_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-activerecord${_RAILS_DEP}:${RUBY_RAILS3_ACTIVERECORD}
|
|
|
|
RUBY_ACTIVERESOURCE_DEPENDS= \
|
2011-05-30 15:08:15 +02:00
|
|
|
${RUBY_PKGPREFIX}-activeresource${_RAILS_DEP}:${RUBY_RAILS3_ACTIVERESOURCE}
|
2011-03-23 15:22:49 +01:00
|
|
|
RUBY_ACTIONMAILER_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-actionmailer${_RAILS_DEP}:${RUBY_RAILS3_ACTIONMAILER}
|
|
|
|
RUBY_RAILTIES_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-railties${_RAILS_DEP}:${RUBY_RAILS3_RAILTIES}
|
2011-03-27 17:54:43 +02:00
|
|
|
RUBY_RAILS_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-rails${_RAILS_DEP}:${RUBY_RAILS3_RAILS}
|
2011-12-13 16:47:06 +01:00
|
|
|
.else
|
|
|
|
RUBY_ACTIVESUPPORT_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-activesupport${_RAILS_DEP}:${RUBY_RAILS31_ACTIVESUPPORT}
|
|
|
|
RUBY_ACTIVEMODEL_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-activemodel${_RAILS_DEP}:${RUBY_RAILS31_ACTIVEMODEL}
|
|
|
|
RUBY_ACTIONPACK_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-actionpack${_RAILS_DEP}:${RUBY_RAILS31_ACTIONPACK}
|
|
|
|
RUBY_ACTIVERECORD_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-activerecord${_RAILS_DEP}:${RUBY_RAILS31_ACTIVERECORD}
|
|
|
|
RUBY_ACTIVERESOURCE_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-activeresource${_RAILS_DEP}:${RUBY_RAILS31_ACTIVERESOURCE}
|
|
|
|
RUBY_ACTIONMAILER_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-actionmailer${_RAILS_DEP}:${RUBY_RAILS31_ACTIONMAILER}
|
|
|
|
RUBY_RAILTIES_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-railties${_RAILS_DEP}:${RUBY_RAILS31_RAILTIES}
|
|
|
|
RUBY_RAILS_DEPENDS= \
|
|
|
|
${RUBY_PKGPREFIX}-rails${_RAILS_DEP}:${RUBY_RAILS31_RAILS}
|
2011-03-23 15:22:49 +01:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.endif
|