From 9bb044a2c2897487e107db4cb97db5154d2d40e2 Mon Sep 17 00:00:00 2001 From: jlam Date: Wed, 12 Mar 2008 18:53:35 +0000 Subject: + For print-PLIST, don't output any files or directories in ${GEM_DOCDIR} as those are automatically listed by RUBYGEM_GENERATE_PLIST. + Clean up the intermediate build files in the "ext" directory of installed gem by removing everything that's not also in the unpacked gem. --- misc/rubygems/rubygem.mk | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/misc/rubygems/rubygem.mk b/misc/rubygems/rubygem.mk index 488ed2d834a..1a623602d61 100644 --- a/misc/rubygems/rubygem.mk +++ b/misc/rubygems/rubygem.mk @@ -1,4 +1,4 @@ -# $NetBSD: rubygem.mk,v 1.4 2008/03/12 16:59:13 jlam Exp $ +# $NetBSD: rubygem.mk,v 1.5 2008/03/12 18:53:35 jlam Exp $ # # This Makefile fragment is intended to be included by packages that build # and install Ruby gems. @@ -88,7 +88,7 @@ PLIST_SUBST+= GEM_DOCDIR=${GEM_DOCDIR:S|^${PREFIX}/||} PRINT_PLIST_AWK+= /^(@dirrm )?${GEM_LIBDIR:S|${PREFIX}/||:S|/|\\/|g}/ \ { gsub(/${GEM_LIBDIR:S|${PREFIX}/||:S|/|\\/|g}/, "$${GEM_LIBDIR}"); print; next; } PRINT_PLIST_AWK+= /^(@dirrm )?${GEM_DOCDIR:S|${PREFIX}/||:S|/|\\/|g}/ \ - { gsub(/${GEM_DOCDIR:S|${PREFIX}/||:S|/|\\/|g}/, "$${GEM_DOCDIR}"); print; next; } + { next; } PRINT_PLIST_AWK+= /^@dirrm ${GEM_HOME:S|${PREFIX}/||:S|/|\\/|g}(\/(gems|cache|doc|specifications))?$$/ \ { next; } PRINT_PLIST_AWK+= /^(@dirrm )?${GEM_HOME:S|${PREFIX}/||:S|/|\\/|g}/ \ @@ -155,6 +155,14 @@ do-gem-install: @${STEP_MSG} "Installing gem into buildroot" ${RUN} ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} \ ${RUBYGEM} install ${_RUBYGEM_OPTIONS} + @${STEP_MSG} "Cleaning up intermediate gem build files" + ${RUN} cd ${_RUBYGEM_BUILDROOT}${GEM_LIBDIR}/ext && ls | \ + while read file; do \ + if [ ! -f ${WRKSRC}/ext/$$file ]; then \ + echo "rm "${GEM_LIBDIR:T}"/ext/$$file"; \ + rm -f $$file; \ + fi; \ + done @${STEP_MSG} "Copying files into installation directory" ${RUN} cd ${_RUBYGEM_BUILDROOT}${PREFIX} && \ pax -rwpe . ${DESTDIR}${PREFIX} -- cgit v1.2.3