diff options
author | jlam <jlam> | 2008-03-13 22:20:04 +0000 |
---|---|---|
committer | jlam <jlam> | 2008-03-13 22:20:04 +0000 |
commit | 4dae3d70adac26789ba5c8b735e46161cee34e90 (patch) | |
tree | 942cda44641f2ec991f8716aef15c57893339d0a | |
parent | de4f2869269db7caf0319a344bcda20ccc7d3197 (diff) | |
download | pkgsrc-4dae3d70adac26789ba5c8b735e46161cee34e90.tar.gz |
+ Modify gem-rake-build to find the generated .gem file in the event
that the Rakefile creates it in a non-standard place.
+ Create a new variable GEM_CLEANBUILD which is a list of globs for
files to remove from the gem installed in the buildroot in the
_gem-install-cleanbuild target. This allows for packages with a
non-standard gem directory structure (one that has the .c files
under ext/).
-rw-r--r-- | misc/rubygems/rubygem.mk | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/misc/rubygems/rubygem.mk b/misc/rubygems/rubygem.mk index a1a816b4f81..73c488c0345 100644 --- a/misc/rubygems/rubygem.mk +++ b/misc/rubygems/rubygem.mk @@ -1,4 +1,4 @@ -# $NetBSD: rubygem.mk,v 1.15 2008/03/13 18:29:20 jlam Exp $ +# $NetBSD: rubygem.mk,v 1.16 2008/03/13 22:20:04 jlam Exp $ # # This Makefile fragment is intended to be included by packages that build # and install Ruby gems. @@ -11,6 +11,10 @@ # Possible: gemspec, rake # Default: rake # +# GEM_CLEANBUILD +# A list of shell globs representing files to remove from the +# gem installed in the buildroot. +# # GEM_NAME # The name of the gem to install. The default value is ${DISTNAME}. # @@ -147,7 +151,12 @@ gem-gemspec-build: gem-rake-build: ${RUN} cd ${WRKSRC} && ${RAKE} gem - ${RUN} cd ${WRKSRC} && ln -fs pkg/${GEMFILE} . + ${RUN} cd ${WRKSRC} && rm -f ${GEMFILE} + ${RUN} cd ${WRKSRC} && find . -name ${GEMFILE} -print | \ + while read file; do \ + ln -fs "$$file" ${GEMFILE}; \ + exit 0; \ + done ### ### gem-install @@ -189,8 +198,26 @@ _gem-install-buildroot: ${RUN} ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} \ ${RUBYGEM} install ${_RUBYGEM_OPTIONS} +GEM_CLEANBUILD?= # empty +.if !empty(GEM_CLEANBUILD:M/*) || !empty(GEM_CLEANBUILD:M*../*) +PKG_FAIL_REASON= "GEM_CLEANBUILD must be relative to "${GEM_LIBDIR:Q}"." +.endif + _gem-install-cleanbuild: @${STEP_MSG} "Cleaning intermediate gem build files" +.if !empty(GEM_CLEANBUILD) + ${RUN} cd ${_RUBYGEM_BUILDROOT}${GEM_LIBDIR} && \ + ls ${GEM_CLEANBUILD} | \ + while read file; do \ + if [ -d "$$file" ]; then \ + echo "rmdir "${GEM_LIBDIR:T}"/$$file"; \ + rmdir $$file; \ + else \ + echo "rm "${GEM_LIBDIR:T}"/$$file"; \ + rm -f $$file; \ + fi; \ + done +.endif ${RUN} if [ -d ${_RUBYGEM_BUILDROOT}${GEM_LIBDIR}/ext ]; then \ cd ${_RUBYGEM_BUILDROOT}${GEM_LIBDIR} && \ find ext -print | sort -r | \ |