diff options
author | jlam <jlam> | 2008-03-18 03:50:35 +0000 |
---|---|---|
committer | jlam <jlam> | 2008-03-18 03:50:35 +0000 |
commit | 1863999cd9c699a787ee2373c2de22dedb2f9097 (patch) | |
tree | 28cbe6c5f5febf023262b9e394e37df56dcdba44 /misc/rubygems | |
parent | f5dc9ec8ba173e420aeade352167cd7d683270dd (diff) | |
download | pkgsrc-1863999cd9c699a787ee2373c2de22dedb2f9097.tar.gz |
Unify the two clauses in _gem-install-cleanbuild that removed the
intermediate build files. GEM_CLEANBUILD now defaults to "ext/*".
Diffstat (limited to 'misc/rubygems')
-rw-r--r-- | misc/rubygems/rubygem.mk | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/misc/rubygems/rubygem.mk b/misc/rubygems/rubygem.mk index 3309f04353a..9907206d7df 100644 --- a/misc/rubygems/rubygem.mk +++ b/misc/rubygems/rubygem.mk @@ -1,4 +1,4 @@ -# $NetBSD: rubygem.mk,v 1.22 2008/03/18 01:40:48 jlam Exp $ +# $NetBSD: rubygem.mk,v 1.23 2008/03/18 03:50:35 jlam Exp $ # # This Makefile fragment is intended to be included by packages that build # and install Ruby gems. @@ -13,7 +13,9 @@ # # GEM_CLEANBUILD # A list of shell globs representing files to remove from the -# gem installed in the buildroot. The default is an empty list. +# gem installed in the buildroot. The file is removed if the +# path matches the glob and is not in ${WRKSRC}. The default +# is "ext/*" # # Example: # @@ -197,10 +199,16 @@ RUBYGEM_GENERATE_PLIST= \ ${SORT} && \ ${FIND} ${GEM_DOCDIR:S|${PREFIX}/||} -type d -print | \ ${SORT} -r | ${SED} -e "s,^,@dirrm ," ); - + +GEM_CLEANBUILD?= ext/* +.if !empty(GEM_CLEANBUILD:M/*) || !empty(GEM_CLEANBUILD:M*../*) +PKG_FAIL_REASON= "GEM_CLEANBUILD must be relative to "${GEM_LIBDIR:Q}"." +.endif _GEM_INSTALL_TARGETS= _gem-install-buildroot +.if !empty(GEM_CLEANBUILD) _GEM_INSTALL_TARGETS+= _gem-install-cleanbuild +.endif _GEM_INSTALL_TARGETS+= _gem-install-copy .PHONY: gem-install ${_GEM_INSTALL_TARGETS} @@ -214,17 +222,16 @@ _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 - +.if !empty(GEM_CLEANBUILD) _gem-install-cleanbuild: @${STEP_MSG} "Cleaning intermediate gem build files" -.if !empty(GEM_CLEANBUILD) ${RUN} cd ${_RUBYGEM_BUILDROOT}${GEM_LIBDIR} && \ - ls ${GEM_CLEANBUILD} | \ + find . -print | sort -r | \ while read file; do \ + case $$file in \ + ${GEM_CLEANBUILD:@.p.@./${.p.}) ;;@} \ + *) continue ;; \ + esac; \ [ ! -e ${WRKSRC:Q}"/$$file" ] || continue; \ if [ -d "$$file" ]; then \ echo "rmdir "${GEM_LIBDIR:T}"/$$file"; \ @@ -235,20 +242,6 @@ _gem-install-cleanbuild: fi; \ done .endif - ${RUN} if [ -d ${_RUBYGEM_BUILDROOT}${GEM_LIBDIR}/ext ]; then \ - cd ${_RUBYGEM_BUILDROOT}${GEM_LIBDIR} && \ - find ext -print | sort -r | \ - while read file; do \ - [ ! -e ${WRKSRC:Q}"/$$file" ] || continue; \ - if [ -d "$$file" ]; then \ - echo "rmdir "${GEM_LIBDIR:T}"/$$file"; \ - rmdir $$file; \ - else \ - echo "rm "${GEM_LIBDIR:T}"/$$file"; \ - rm -f $$file; \ - fi; \ - done; \ - fi _gem-install-copy: @${STEP_MSG} "Copying gem into installation directory" |