pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/ruby Fix gem handling.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5421338b8f1c
branches:  trunk
changeset: 621346:5421338b8f1c
user:      taca <taca%pkgsrc.org@localhost>
date:      Sun Jul 07 15:16:38 2013 +0000

description:
Fix gem handling.

o Don't assume _DISTDIR end with '/' (by DESTDIR).
o A small clean up to GEM_CLEANBUILD handling.

A few clean up.

diffstat:

 lang/ruby/gem.mk |  25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diffs (64 lines):

diff -r 8481d0eac7be -r 5421338b8f1c lang/ruby/gem.mk
--- a/lang/ruby/gem.mk  Sun Jul 07 15:12:56 2013 +0000
+++ b/lang/ruby/gem.mk  Sun Jul 07 15:16:38 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: gem.mk,v 1.20 2013/04/08 11:17:15 rodent Exp $
+# $NetBSD: gem.mk,v 1.21 2013/07/07 15:16:38 taca Exp $
 #
 # This Makefile fragment is intended to be included by packages that build
 # and install Ruby gems.
@@ -140,6 +140,8 @@
 .endif
 
 # print-PLIST support
+PRINT_PLIST_AWK+=      /${GEM_NAME}\.info$$/ \
+                       { gsub(/${GEM_NAME}\.info/, "$${GEM_NAME}.info"); }
 PRINT_PLIST_AWK+=      /${GEM_NAME}\.(gem|gemspec)$$/ \
                        { gsub(/${GEM_NAME}\.gem/, "$${GEM_NAME}.gem"); }
 PRINT_PLIST_AWK+=      /${GEM_NAME:S/./[.]/g}[.](gem|gemspec)$$/ \
@@ -226,9 +228,9 @@
 
 # Directory for the Gem to install
 GEM_NAME?=     ${DISTNAME}
-GEM_LIBDIR=    ${GEM_HOME}/gems/${GEM_NAME}
+GEM_CACHEDIR=  ${GEM_HOME}/cache
 GEM_DOCDIR=    ${GEM_HOME}/doc/${GEM_NAME}
-GEM_CACHEDIR=  ${GEM_HOME}/cache
+GEM_LIBDIR=    ${GEM_HOME}/gems/${GEM_NAME}
 
 # Installed gems have wrapper scripts that call the right interpreter,
 # regardless of the #! line at the head of a script, so we can skip
@@ -262,10 +264,10 @@
 gem-extract: fake-home
 .  for _gem_ in ${DISTFILES:M*.gem}
        ${RUN} cd ${WRKDIR} && ${SETENV} ${MAKE_ENV} ${RUBYGEM_ENV} \
-               ${RUBYGEM} unpack ${_DISTDIR:Q}${_gem_:Q}
+               ${RUBYGEM} unpack ${_DISTDIR:Q}/${_gem_:Q}
        ${RUN} cd ${WRKDIR} && \
                ${SETENV} ${MAKE_ENV} TZ=UTC ${RUBYGEM_ENV} \
-               ${RUBYGEM} spec --ruby ${_DISTDIR:Q}${_gem_:Q} > ${_gem_}spec
+               ${RUBYGEM} spec --ruby ${_DISTDIR:Q}/${_gem_:Q} > ${_gem_}spec
 .  endfor
 .endif
 
@@ -360,12 +362,15 @@
                ${GEM_CLEANBUILD:@.p.@./${.p.}) ;;@}                    \
                *)      continue ;;                                     \
                esac;                                                   \
-               [ ! -e ${WRKSRC:Q}"/$$file" ] || continue;              \
-               if [ -d "$$file" ]; then                                \
-                       ${ECHO} "rmdir "${GEM_NAME}"/$$file";           \
+               if [ -e ${WRKSRC:Q}"/$$file" ]; then                    \
+                       && continue;                                    \
+               elif [ -d "$$file" ]; then                              \
+                       rfile=`echo $$file | ${SED} -e 's|^\./||'`;     \
+                       ${ECHO} "rmdir "${GEM_NAME}"/$$rfile";          \
                        rmdir $$file;                                   \
-               else                                                    \
-                       ${ECHO} "rm "${GEM_NAME}"/$$file";              \
+               elif [ -f "$$file" ]; then                              \
+                       rfile=`echo $$file | ${SED} -e 's|^\./||'`;     \
+                       ${ECHO} "rm "${GEM_NAME}"/$$rfile";             \
                        rm -f $$file;                                   \
                fi;                                                     \
        done



Home | Main Index | Thread Index | Old Index