2006-08-23 17:12:24 -04:00
|
|
|
# $OpenBSD: ruby.port.mk,v 1.6 2006/08/23 21:12:24 sturm Exp $
|
2002-03-17 17:29:02 -05:00
|
|
|
|
|
|
|
# ruby module
|
|
|
|
|
2006-07-14 11:41:21 -04:00
|
|
|
MODRUBY_REV= 1.8
|
|
|
|
|
2006-06-11 14:57:11 -04:00
|
|
|
RUBY= ${LOCALBASE}/bin/ruby
|
|
|
|
|
|
|
|
BUILD_DEPENDS+= ::lang/ruby
|
|
|
|
RUN_DEPENDS+= ::lang/ruby
|
2002-03-17 17:29:02 -05:00
|
|
|
|
2002-12-09 16:04:08 -05:00
|
|
|
# location of ruby libraries
|
2002-12-09 15:26:36 -05:00
|
|
|
MODRUBY_LIBDIR= ${LOCALBASE}/lib/ruby
|
2002-12-09 16:04:08 -05:00
|
|
|
|
|
|
|
# common directories for ruby extensions
|
|
|
|
# used to create docs and examples install path
|
2002-12-09 15:26:36 -05:00
|
|
|
MODRUBY_DOCDIR= ${PREFIX}/share/doc/ruby
|
|
|
|
MODRUBY_EXAMPLEDIR= ${PREFIX}/share/examples/ruby
|
2006-07-14 11:41:21 -04:00
|
|
|
MODRUBY_ARCH= ${MACHINE_ARCH:S/amd64/x86_64/}-openbsd${OSREV}
|
2002-03-17 17:29:02 -05:00
|
|
|
|
|
|
|
CONFIGURE_STYLE?= simple
|
|
|
|
CONFIGURE_SCRIPT?= ${LOCALBASE}/bin/ruby extconf.rb
|
2004-02-20 17:52:57 -05:00
|
|
|
|
2006-07-14 11:41:21 -04:00
|
|
|
REV=${MODRUBY_REV}
|
|
|
|
SUB=${MODRUBY_ARCH}
|
|
|
|
SUBST_VARS=MODRUBY_REV MODRUBY_ARCH SUB REV
|
|
|
|
|
2004-02-20 17:52:57 -05:00
|
|
|
|
2006-06-11 15:56:31 -04:00
|
|
|
.if ${CONFIGURE_STYLE:L:Mgem}
|
|
|
|
EXTRACT_SUFX= .gem
|
|
|
|
EXTRACT_ONLY=
|
|
|
|
|
|
|
|
BUILD_DEPENDS+= ::devel/ruby-gems
|
2006-08-23 17:12:24 -04:00
|
|
|
RUN_DEPENDS+= ::devel/ruby-gems
|
2006-06-11 15:56:31 -04:00
|
|
|
NO_BUILD= Yes
|
|
|
|
|
|
|
|
SUBST_VARS+= DISTNAME
|
|
|
|
|
|
|
|
GEM= ${LOCALBASE}/bin/gem
|
2006-07-14 11:41:21 -04:00
|
|
|
GEM_BASE= ${PREFIX}/lib/ruby/gems/${MODRUBY_REV}
|
2006-06-11 15:56:31 -04:00
|
|
|
GEM_FLAGS= --local --rdoc --no-force
|
|
|
|
|
|
|
|
. if !target(do-regress)
|
|
|
|
# XXX gem errors out w/o unit tests to run and I have not found any gem
|
|
|
|
# which actually supports tests
|
|
|
|
NO_REGRESS= Yes
|
|
|
|
|
|
|
|
# a generic regress target might look sth like this
|
|
|
|
#do-regress:
|
|
|
|
# @if [ ! -d ${WRKINST} ]; then \
|
|
|
|
# _CLEAN_FAKE=Yes; \
|
|
|
|
# fi; \
|
|
|
|
# mkdir -p ${WRKINST}${GEM_BASE}; \
|
|
|
|
# ${SUDO} ${GEM} install ${GEM_FLAGS} --test \
|
|
|
|
# --install-dir ${WRKINST}${GEM_BASE} \
|
|
|
|
# ${FULLDISTDIR}/${DISTFILES}; \
|
|
|
|
# if [ ! -z "$$_CLEAN_FAKE" ]; then \
|
|
|
|
# ${SUDO} rm -fr ${WRKINST}; \
|
|
|
|
# fi
|
|
|
|
. endif
|
|
|
|
. if !target(do-install)
|
|
|
|
do-install:
|
|
|
|
@${INSTALL_DATA_DIR} ${GEM_BASE}
|
|
|
|
@${SUDO} ${GEM} install ${GEM_FLAGS} --install-dir ${GEM_BASE} \
|
|
|
|
${FULLDISTDIR}/${DISTNAME}${EXTRACT_SUFX}
|
|
|
|
@if [ -d ${GEM_BASE}/bin ]; then \
|
|
|
|
for f in ${GEM_BASE}/bin/*; do \
|
|
|
|
mv $$f ${PREFIX}/bin; \
|
|
|
|
done; \
|
|
|
|
rm -r ${GEM_BASE}/bin; \
|
|
|
|
fi
|
|
|
|
. endif
|
|
|
|
.elif ${CONFIGURE_STYLE:L:Msetup}
|
2006-06-11 14:57:11 -04:00
|
|
|
MODRUBY_configure= \
|
|
|
|
cd ${WRKSRC}; ${SETENV} ${CONFIGURE_ENV} ${RUBY} setup.rb config \
|
|
|
|
--prefix=${PREFIX} ${CONFIGURE_ARGS};
|
|
|
|
. if !target(do-build)
|
|
|
|
do-build:
|
|
|
|
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${RUBY} setup.rb setup
|
|
|
|
. endif
|
|
|
|
. if !target(do-regress)
|
|
|
|
NO_REGRESS=Yes
|
|
|
|
. endif
|
|
|
|
. if !target(do-install)
|
|
|
|
do-install:
|
|
|
|
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${RUBY} setup.rb install \
|
|
|
|
--prefix=${DESTDIR}
|
|
|
|
. endif
|
|
|
|
.endif
|