pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/misc/rubygems + Rename the metadata (gemspec) file to ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/41526c7cbb91
branches:  trunk
changeset: 539832:41526c7cbb91
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Fri Mar 14 14:18:21 2008 +0000

description:
+ Rename the metadata (gemspec) file to a more sensible name (*.gemspec).

+ Clean up additional unpacked bits (*.sig) files during extraction.

+ Fix the "cleanbuild" step:
  + In GEM_CLEANBUILD case, sanity check that the file doesn't exist
    in the unpacked gem before removing it from the installed gem.
  + Actually removes unwanted directories.

diffstat:

 misc/rubygems/rubygem.mk |  14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diffs (55 lines):

diff -r 13121df39b3b -r 41526c7cbb91 misc/rubygems/rubygem.mk
--- a/misc/rubygems/rubygem.mk  Fri Mar 14 14:05:27 2008 +0000
+++ b/misc/rubygems/rubygem.mk  Fri Mar 14 14:18:21 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: rubygem.mk,v 1.16 2008/03/13 22:20:04 jlam Exp $
+# $NetBSD: rubygem.mk,v 1.17 2008/03/14 14:18:21 jlam Exp $
 #
 # This Makefile fragment is intended to be included by packages that build
 # and install Ruby gems.
@@ -126,14 +126,17 @@
 ###    data.tar.gz     contains the actual files to build, install, etc.
 ###    metadata.gz     YAML specification file
 ###
+_GEMSPEC_FILE= ${WRKDIR}/${PKGBASE:S|^${RUBY_PKGPREFIX}-||}.gemspec
+
 .PHONY: gem-extract
 do-extract: gem-extract
 gem-extract:
        ${RUN} cd ${WRKDIR} && ${EXTRACTOR} -f tar ${_DISTDIR:Q}/${GEMFILE:Q}
        ${RUN} mkdir ${WRKSRC}
        ${RUN} cd ${WRKSRC} && ${EXTRACTOR} -f tar ${WRKDIR:Q}/data.tar.gz
-       ${RUN} cd ${WRKSRC} && ${EXTRACTOR} ${WRKDIR:Q}/metadata.gz
-       ${RUN} rm -f ${WRKDIR:Q}/data.tar.gz ${WRKDIR:Q}/metadata.gz
+       ${RUN} cd ${WRKDIR} && ${EXTRACTOR} metadata.gz && \
+               mv metadata ${_GEMSPEC_FILE}
+       ${RUN} cd ${WRKDIR} && rm -f data.tar.gz* metadata.gz*
 
 ###
 ### gem-build
@@ -147,7 +150,7 @@
 gem-build: gem-${GEM_BUILD}-build
 
 gem-gemspec-build:
-       ${RUN} cd ${WRKSRC} && ${RUBYGEM} build metadata
+       ${RUN} cd ${WRKSRC} && ${RUBYGEM} build ${_GEMSPEC_FILE}
 
 gem-rake-build:
        ${RUN} cd ${WRKSRC} && ${RAKE} gem
@@ -209,6 +212,7 @@
        ${RUN} cd ${_RUBYGEM_BUILDROOT}${GEM_LIBDIR} &&                 \
        ls ${GEM_CLEANBUILD} |                                          \
        while read file; do                                             \
+               [ ! -e ${WRKSRC:Q}"/$$file" ] || continue;              \
                if [ -d "$$file" ]; then                                \
                        echo "rmdir "${GEM_LIBDIR:T}"/$$file";          \
                        rmdir $$file;                                   \
@@ -223,7 +227,7 @@
                find ext -print | sort -r |                             \
                while read file; do                                     \
                        [ ! -e ${WRKSRC:Q}"/$$file" ] || continue;      \
-                       if [ -d ${WRKSRC:Q}"/$$file" ]; then            \
+                       if [ -d "$$file" ]; then                        \
                                echo "rmdir "${GEM_LIBDIR:T}"/$$file";  \
                                rmdir $$file;                           \
                        else                                            \



Home | Main Index | Thread Index | Old Index