pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/misc/rubygems + Modify gem-rake-build to find the gene...
details: https://anonhg.NetBSD.org/pkgsrc/rev/4a7836b48a4a
branches: trunk
changeset: 539810:4a7836b48a4a
user: jlam <jlam%pkgsrc.org@localhost>
date: Thu Mar 13 22:20:04 2008 +0000
description:
+ 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/).
diffstat:
misc/rubygems/rubygem.mk | 31 +++++++++++++++++++++++++++++--
1 files changed, 29 insertions(+), 2 deletions(-)
diffs (61 lines):
diff -r 93973cf5771d -r 4a7836b48a4a misc/rubygems/rubygem.mk
--- a/misc/rubygems/rubygem.mk Thu Mar 13 22:04:07 2008 +0000
+++ b/misc/rubygems/rubygem.mk Thu Mar 13 22:20:04 2008 +0000
@@ -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-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 @@
${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 | \
Home |
Main Index |
Thread Index |
Old Index