summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstas <stas@FreeBSD.org>2006-10-09 13:17:16 +0000
committerstas <stas@FreeBSD.org>2006-10-09 13:17:16 +0000
commit0f72c368a4a0782b8c0ce7144d98310a72d9d42c (patch)
tree6cb64ea6ec42b3eff47fcdc75e0688412d80b933
parent2642d2c89fe0ea6fd990d7937973f2c730c80b83 (diff)
downloadFreeBSD-ports-0f72c368a4a0782b8c0ce7144d98310a72d9d42c.zip
FreeBSD-ports-0f72c368a4a0782b8c0ce7144d98310a72d9d42c.tar.gz
- Add runtime knob to allow libraries installation under user
privileges. When RB_INSTALL_USER environment variable is set, ruby will not pass '${_BINOWNGRP}' to install program, thus allowing an ordinal user to install gem or library (e.g. into home directory). - Eliminate extra whitespace - Bump portrevision. PR: ports/103801 (idea) Submitted by: Dimitri Aivaliotis <aglarond@gmail.com>
-rw-r--r--lang/ruby18/Makefile17
1 files changed, 12 insertions, 5 deletions
diff --git a/lang/ruby18/Makefile b/lang/ruby18/Makefile
index cd6ce6b..fa786e8 100644
--- a/lang/ruby18/Makefile
+++ b/lang/ruby18/Makefile
@@ -7,7 +7,7 @@
PORTNAME= ruby
PORTVERSION= ${RUBY_PORTVERSION}
-PORTREVISION= 1
+PORTREVISION= 2
PORTEPOCH= 1
CATEGORIES= lang ruby ipv6
MASTER_SITES= ${MASTER_SITE_RUBY}
@@ -123,6 +123,9 @@ COPYTREE_SHARE= ${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
${FIND} $$1/ -type d -exec ${CHMOD} 755 {} \; && \
${FIND} $$1/ -type f -exec ${CHMOD} ${SHAREMODE} {} \;' --
+# Macros to change variables in rbconfig.rb
+RB_SET_CONF_VAR=${SH} -c '${REINPLACE_CMD} -E -e "s,(CONFIG\[\"$$0\"\][[:space:]]*=[[:space:]]*)(\(?)(.*)(\)?),\1\2$$1\4," ${WRKSRC}/rbconfig.rb' --
+
post-extract:
${MV} ${WRKSRC}/ext/dl/h2rb ${WRKSRC}/bin/
@@ -156,10 +159,14 @@ pre-configure:
post-build:
#
-# Hack to allow modules to be installed into separate PREFIX
+# Hack to allow modules to be installed into separate PREFIX and/or under user
+# privilegies
#
- @${REINPLACE_CMD} -E -e \
- "s,(CONFIG\[\"prefix\"\][[:space:]]*=[[:space:]]*\()(.*),\1ENV\['PREFIX'\] || \2," ${WRKSRC}/rbconfig.rb
+ @${RB_SET_CONF_VAR} "prefix" "ENV['PREFIX'] || \3"
+ @${RB_SET_CONF_VAR} "INSTALL" "ENV['RB_USER_INSTALL'] ? '/usr/bin/install -c' : '/usr/bin/install -c ${_BINOWNGRP}'"
+ @${RB_SET_CONF_VAR} "INSTALL_PROGRAM" "ENV['RB_USER_INSTALL'] ? '${INSTALL} ${COPY} ${STRIP} -m ${BINMODE}' : '${INSTALL_PROGRAM}'"
+ @${RB_SET_CONF_VAR} "INSTALL_SCRIPT" "ENV['RB_USER_INSTALL'] ? '${INSTALL} ${COPY} -m ${BINMODE}' : '${INSTALL_SCRIPT}'"
+ @${RB_SET_CONF_VAR} "INSTALL_DATA" "ENV['RB_USER_INSTALL'] ? '${INSTALL} ${COPY} -m ${SHAREMODE}' : '${INSTALL_DATA}'"
pre-install:
${MKDIR} ${RUBY_DOCDIR} \
@@ -276,7 +283,7 @@ plist::
@${ECHO_CMD} "@exec env LC_TIME=C /bin/date > %D/%%RUBY_SITERIDIR%%/created.rid" >> pkg-plist
@${ECHO_CMD} "@unexec /bin/rm -f %D/%%RUBY_SITERIDIR%%/created.rid" \
>> pkg-plist
-
+
@${ECHO_CMD} "@dirrmtry %%RUBY_SITERIDIR%%" >> pkg-plist
@${ECHO_CMD} "@dirrmtry %%RUBY_RIDIR%%" >> pkg-plist
@${ECHO_CMD} "@dirrmtry share/ri/%%RUBY_VER%%" >> pkg-plist
OpenPOWER on IntegriCloud