aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/bsd.ruby.mk
diff options
context:
space:
mode:
authorstas <stas@FreeBSD.org>2009-02-14 06:48:51 +0800
committerstas <stas@FreeBSD.org>2009-02-14 06:48:51 +0800
commit6e67b52312b4634f893b5757cddc2dcb8a0751f3 (patch)
tree2e0fc9c48a6d324832d211420aa1d8f15db99875 /Mk/bsd.ruby.mk
parent0b6b48ba5f913950d0653bbd7b9943ff924e892f (diff)
downloadfreebsd-ports-gnome-6e67b52312b4634f893b5757cddc2dcb8a0751f3.tar.gz
freebsd-ports-gnome-6e67b52312b4634f893b5757cddc2dcb8a0751f3.tar.zst
freebsd-ports-gnome-6e67b52312b4634f893b5757cddc2dcb8a0751f3.zip
- Add a new knob RUBYGEM_AUTOPLIST, which allows the pakcking list
for most (all?) rubygem ports to be generated automatically.
Diffstat (limited to 'Mk/bsd.ruby.mk')
-rw-r--r--Mk/bsd.ruby.mk31
1 files changed, 27 insertions, 4 deletions
diff --git a/Mk/bsd.ruby.mk b/Mk/bsd.ruby.mk
index 302ed5bdea5a..0f62559b40e2 100644
--- a/Mk/bsd.ruby.mk
+++ b/Mk/bsd.ruby.mk
@@ -393,10 +393,10 @@ DOC_DIR= ${GEMS_BASE_DIR}/doc
CACHE_DIR= ${GEMS_BASE_DIR}/cache
SPEC_DIR= ${GEMS_BASE_DIR}/specifications
GEM_NAME?= ${PORTNAME}-${PORTVERSION}
-GEM_LIB_DIR= ${GEMS_DIR}/${GEM_NAME}
-GEM_DOC_DIR= ${DOC_DIR}/${GEM_NAME}
-GEM_SPEC= ${SPEC_DIR}/${GEM_NAME}.gemspec
-GEM_CACHE= ${CACHE_DIR}/${GEM_NAME}.gem
+GEM_LIB_DIR?= ${GEMS_DIR}/${GEM_NAME}
+GEM_DOC_DIR?= ${DOC_DIR}/${GEM_NAME}
+GEM_SPEC?= ${SPEC_DIR}/${GEM_NAME}.gemspec
+GEM_CACHE?= ${CACHE_DIR}/${GEM_NAME}.gem
PLIST_SUB+= PORTVERSION="${PORTVERSION}" \
REV="${RUBY_GEM}" \
@@ -426,6 +426,29 @@ do-install:
${SETENV} ${GEM_ENV} ${RUBYGEMBIN} install -l --no-update-sources --no-ri --install-dir ${PREFIX}/lib/ruby/gems/${RUBY_VER} ${DISTDIR}/${DIST_SUBDIR}/${_D} -- --build-args ${CONFIGURE_ARGS}
.endfor
+. if defined(RUBYGEM_AUTOPLIST)
+. if !target(post-install-script)
+post-install-script:
+ @${ECHO} ${GEM_CACHE} >> ${TMPPLIST}
+ @${ECHO} ${GEM_SPEC} >> ${TMPPLIST}
+ @${FIND} -ds ${PREFIX}/${GEM_DOC_DIR} -type f -print | ${SED} -E -e \
+ 's,^${PREFIX}/?,,' >> ${TMPPLIST}
+ @${FIND} -ds ${PREFIX}/${GEM_DOC_DIR} -type d -print | ${SED} -E -e \
+ 's,^${PREFIX}/?,@dirrm ,' >> ${TMPPLIST}
+ @${FIND} -ds ${PREFIX}/${GEM_LIB_DIR} -type f -print | ${SED} -E -e \
+ 's,^${PREFIX}/?,,' >> ${TMPPLIST}
+ @${FIND} -ds ${PREFIX}/${GEM_LIB_DIR} -type d -print | ${SED} -E -e \
+ 's,^${PREFIX}/?,@dirrm ,' >> ${TMPPLIST}
+ @${ECHO_CMD} "@unexec rmdir %D/${GEMS_DIR} 2>/dev/null || true" >> ${TMPPLIST}
+ @${ECHO_CMD} "@unexec rmdir %D/${DOC_DIR} 2>/dev/null || true" >> ${TMPPLIST}
+ @${ECHO_CMD} "@unexec rmdir %D/${CACHE_DIR} 2>/dev/null || true" >> ${TMPPLIST}
+ @${ECHO_CMD} "@unexec rmdir %D/${SPEC_DIR} 2>/dev/null || true" >> ${TMPPLIST}
+ @${ECHO_CMD} "@unexec rmdir %D/${GEMS_BASE_DIR} 2>/dev/null || true" >> ${TMPPLIST}
+ @${ECHO_CMD} "@unexec rmdir %D/lib/ruby/gems 2>/dev/null || true" >> ${TMPPLIST}
+ @${ECHO_CMD} "@unexec rmdir %D/lib/ruby 2>/dev/null || true" >> ${TMPPLIST}
+. endif
+. endif
+
.endif # USE_RUBYGEMS
#