pkgsrc/misc/rubygems/Makefile
joerg 852712577b Rename RUBY_VERSION_SUPPORTED into _RUBY_VERSIONS_ACCEPTED to follow the
naming scheme of the other multi-version packages. Add support for the
coorresponding RUBY_VERSIONS_INCOMPATIBLE list.
2016-09-08 15:19:16 +00:00

82 lines
2.4 KiB
Makefile

# $NetBSD: Makefile,v 1.60 2016/09/08 15:19:18 joerg Exp $
DISTNAME= rubygems-${RUBY_GEMS_PKGSRC_VERS}
CATEGORIES= misc ruby
MASTER_SITES= http://production.cf.rubygems.org/rubygems/
EXTRACT_SUFX= .tgz
MAINTAINER= taca@NetBSD.org
HOMEPAGE= https://rubygems.org/
COMMENT= Ruby standard for publishing and managing third party libraries
LICENSE= gnu-gpl-v2 OR ruby-license
CONFLICTS+= rubygems-[0-9]*
.include "../../mk/bsd.prefs.mk"
# Modern ruby bundles rubygems.
RUBY_VERSIONS_ACCEPTED= 18
NO_CONFIGURE= yes
NO_BUILD= yes
REPLACE_RUBY_DIRS= bin
REPLACE_RUBY_PAT= [a-z]*
GEM_DOCDIR= ${GEM_HOME}/doc/${DISTNAME}
REQD_DIRS= ${GEM_HOME:H}
REQD_DIRS+= ${GEM_HOME}
REQD_DIRS+= ${GEM_HOME}/cache
REQD_DIRS+= ${GEM_HOME}/doc
REQD_DIRS+= ${GEM_HOME}/gems
REQD_DIRS+= ${GEM_HOME}/specifications
SUBST_CLASSES+= conf
SUBST_STAGE.conf= pre-install
SUBST_FILES.conf= lib/rubygems/config_file.rb
SUBST_SED.conf= -e "s|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g"
SUBST_MESSAGE.conf= Fixing configuration files.
FILES_SUBST+= RUBYGEM_NAME=${RUBYGEM_NAME}
# Generate a dynamic PLIST for the rubygems documentation directory.
GENERATE_PLIST+= \
${ECHO} "@comment The following lines are automatically generated." && \
cd ${DESTDIR}${PREFIX} && \
if [ -d ${GEM_DOCDIR:S|${PREFIX}/||} ]; then \
${FIND} ${GEM_DOCDIR:S|${PREFIX}/||} \! -type d -print | \
${SORT}; \
else \
:; \
fi
# Force the Gem repository to be under ${DESTDIR}. This is harmless
# because this package depends on no other gems.
#
INSTALL_ENV+= GEM_HOME=${DESTDIR}${PREFIX}/${GEM_HOME}
INSTALL_ENV+= GEM_PATH=${DESTDIR}${PREFIX}/${GEM_HOME}
INSTALL_TARGET= install
INSTALL_TARGET+= --vendor --no-rdoc --no-ri
INSTALL_TARGET+= --destdir=${DESTDIR:Q}
# rubygem's setup.rb is not the typical setup.rb -- manually run the
# command to install.
#
do-install:
if [ -f ${DESTDIR}${PREFIX}/bin/${RUBYGEM_NAME} ]; then \
${MV} ${DESTDIR}${PREFIX}/bin/${RUBYGEM_NAME} \
${DESTDIR}${PREFIX}/bin/${RUBYGEM_NAME}.orig; \
fi
cd ${WRKSRC} && ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} \
${RUBY} setup.rb ${INSTALL_TARGET}
${MV} ${DESTDIR}${PREFIX}/bin/${RUBYGEM_NAME} \
${DESTDIR}${PREFIX}/bin/${RUBYGEM_NAME}.new
if [ -f ${DESTDIR}${PREFIX}/bin/${RUBYGEM_NAME}.orig ]; then \
${MV} ${DESTDIR}${PREFIX}/bin/${RUBYGEM_NAME}.orig \
${DESTDIR}${PREFIX}/bin/${RUBYGEM_NAME}; \
fi
.include "../../lang/ruby/modules.mk"
.include "../../mk/bsd.pkg.mk"