summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorknu <knu@FreeBSD.org>2001-05-06 16:48:04 +0000
committerknu <knu@FreeBSD.org>2001-05-06 16:48:04 +0000
commit59bd98ed3c412fb269ff7705403b2b6548ba307e (patch)
tree17e30cc746ab044b75549926037fbdee3b340f10
parent8ec2e954500c77b3ae828ff330f09e379c1e4518 (diff)
downloadFreeBSD-ports-59bd98ed3c412fb269ff7705403b2b6548ba307e.zip
FreeBSD-ports-59bd98ed3c412fb269ff7705403b2b6548ba307e.tar.gz
Let irb16 properly run on ruby16 and irb17 on ruby17.
-rw-r--r--lang/ruby-devel/Makefile23
-rw-r--r--lang/ruby/Makefile23
-rw-r--r--lang/ruby16/Makefile23
-rw-r--r--lang/ruby18/Makefile23
4 files changed, 64 insertions, 28 deletions
diff --git a/lang/ruby-devel/Makefile b/lang/ruby-devel/Makefile
index a3adc82..1adead5 100644
--- a/lang/ruby-devel/Makefile
+++ b/lang/ruby-devel/Makefile
@@ -42,7 +42,8 @@ CONFIGURE_ARGS+= --program-suffix="${RUBY_SUFFIX}"
CONFIGURE_ARGS+= --enable-ipv6
.endif
-IRB= ${LOCALBASE}/bin/irb
+IRB_WITHOUT_SUFFIX= ${LOCALBASE}/bin/irb
+IRB_WITH_SUFFIX= ${IRB_WITHOUT_SUFFIX}${_RUBY_SUFFIX}
post-patch:
find ${WRKSRC} -name '*.orig' -delete
@@ -58,12 +59,22 @@ post-install:
strip ${RUBY}
.endif
.if empty(RUBY_SUFFIX)
- ${MV} -f ${RUBY} ${RUBY_WITH_SUFFIX}
- ${LN} -fs ${RUBY_WITH_SUFFIX} ${RUBY}
+ ${MV} -f ${RUBY_WITHOUT_SUFFIX} ${RUBY_WITH_SUFFIX}
+ ${LN} -fs ${RUBY_WITH_SUFFIX} ${RUBY_WITHOUT_SUFFIX}
${MV} ${PREFIX}/man/man1/ruby.1 ${PREFIX}/man/man1/ruby${_RUBY_SUFFIX}.1
.else
- ${LN} -fs ${RUBY} ${PREFIX}/bin/ruby
+ ${LN} -fs ${RUBY_WITH_SUFFIX} ${RUBY_WITHOUT_SUFFIX}
.endif
+ ${INSTALL_SCRIPT} ${IRB_WITHOUT_SUFFIX} ${IRB_WITH_SUFFIX}
+ ${RUBY} ${RUBY_FLAGS} -i -p \
+ -e 'if $$. == 1; ' \
+ -e ' if /^#!/; ' \
+ -e ' sub /^#!\s*\S*(\benv\s+)?\bruby/, "#!${RUBY_WITHOUT_SUFFIX}";' \
+ -e ' else;' \
+ -e ' $$_ = "#!${RUBY_WITHOUT_SUFFIX}\n" + $$_;' \
+ -e ' end;' \
+ -e 'end' \
+ ${IRB_WITHOUT_SUFFIX}
${RUBY} ${RUBY_FLAGS} -i -p \
-e 'if $$. == 1; ' \
-e ' if /^#!/; ' \
@@ -72,9 +83,7 @@ post-install:
-e ' $$_ = "#!${RUBY_WITH_SUFFIX}\n" + $$_;' \
-e ' end;' \
-e 'end' \
- ${IRB}
- ${MV} -f ${IRB} ${IRB}${_RUBY_SUFFIX}
- ${LN} -fs ${IRB}${_RUBY_SUFFIX} ${IRB}
+ ${IRB_WITH_SUFFIX}
.if !defined(NOPORTDOCS)
${MKDIR} ${RUBY_EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/sample/* ${RUBY_EXAMPLESDIR}
diff --git a/lang/ruby/Makefile b/lang/ruby/Makefile
index 14207cd..7fb01ab 100644
--- a/lang/ruby/Makefile
+++ b/lang/ruby/Makefile
@@ -41,7 +41,8 @@ CONFIGURE_ARGS+= --program-suffix="${RUBY_SUFFIX}"
CONFIGURE_ARGS+= --enable-ipv6
.endif
-IRB= ${LOCALBASE}/bin/irb
+IRB_WITHOUT_SUFFIX= ${LOCALBASE}/bin/irb
+IRB_WITH_SUFFIX= ${IRB_WITHOUT_SUFFIX}${_RUBY_SUFFIX}
post-patch:
find ${WRKSRC} -name '*.orig' -delete
@@ -57,12 +58,22 @@ post-install:
strip ${RUBY}
.endif
.if empty(RUBY_SUFFIX)
- ${MV} -f ${RUBY} ${RUBY_WITH_SUFFIX}
- ${LN} -fs ${RUBY_WITH_SUFFIX} ${RUBY}
+ ${MV} -f ${RUBY_WITHOUT_SUFFIX} ${RUBY_WITH_SUFFIX}
+ ${LN} -fs ${RUBY_WITH_SUFFIX} ${RUBY_WITHOUT_SUFFIX}
${MV} ${PREFIX}/man/man1/ruby.1 ${PREFIX}/man/man1/ruby${_RUBY_SUFFIX}.1
.else
- ${LN} -fs ${RUBY} ${PREFIX}/bin/ruby
+ ${LN} -fs ${RUBY_WITH_SUFFIX} ${RUBY_WITHOUT_SUFFIX}
.endif
+ ${INSTALL_SCRIPT} ${IRB_WITHOUT_SUFFIX} ${IRB_WITH_SUFFIX}
+ ${RUBY} ${RUBY_FLAGS} -i -p \
+ -e 'if $$. == 1; ' \
+ -e ' if /^#!/; ' \
+ -e ' sub /^#!\s*\S*(\benv\s+)?\bruby/, "#!${RUBY_WITHOUT_SUFFIX}";' \
+ -e ' else;' \
+ -e ' $$_ = "#!${RUBY_WITHOUT_SUFFIX}\n" + $$_;' \
+ -e ' end;' \
+ -e 'end' \
+ ${IRB_WITHOUT_SUFFIX}
${RUBY} ${RUBY_FLAGS} -i -p \
-e 'if $$. == 1; ' \
-e ' if /^#!/; ' \
@@ -71,9 +82,7 @@ post-install:
-e ' $$_ = "#!${RUBY_WITH_SUFFIX}\n" + $$_;' \
-e ' end;' \
-e 'end' \
- ${IRB}
- ${MV} -f ${IRB} ${IRB}${_RUBY_SUFFIX}
- ${LN} -fs ${IRB}${_RUBY_SUFFIX} ${IRB}
+ ${IRB_WITH_SUFFIX}
.if !defined(NOPORTDOCS)
${MKDIR} ${RUBY_EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/sample/* ${RUBY_EXAMPLESDIR}
diff --git a/lang/ruby16/Makefile b/lang/ruby16/Makefile
index 14207cd..7fb01ab 100644
--- a/lang/ruby16/Makefile
+++ b/lang/ruby16/Makefile
@@ -41,7 +41,8 @@ CONFIGURE_ARGS+= --program-suffix="${RUBY_SUFFIX}"
CONFIGURE_ARGS+= --enable-ipv6
.endif
-IRB= ${LOCALBASE}/bin/irb
+IRB_WITHOUT_SUFFIX= ${LOCALBASE}/bin/irb
+IRB_WITH_SUFFIX= ${IRB_WITHOUT_SUFFIX}${_RUBY_SUFFIX}
post-patch:
find ${WRKSRC} -name '*.orig' -delete
@@ -57,12 +58,22 @@ post-install:
strip ${RUBY}
.endif
.if empty(RUBY_SUFFIX)
- ${MV} -f ${RUBY} ${RUBY_WITH_SUFFIX}
- ${LN} -fs ${RUBY_WITH_SUFFIX} ${RUBY}
+ ${MV} -f ${RUBY_WITHOUT_SUFFIX} ${RUBY_WITH_SUFFIX}
+ ${LN} -fs ${RUBY_WITH_SUFFIX} ${RUBY_WITHOUT_SUFFIX}
${MV} ${PREFIX}/man/man1/ruby.1 ${PREFIX}/man/man1/ruby${_RUBY_SUFFIX}.1
.else
- ${LN} -fs ${RUBY} ${PREFIX}/bin/ruby
+ ${LN} -fs ${RUBY_WITH_SUFFIX} ${RUBY_WITHOUT_SUFFIX}
.endif
+ ${INSTALL_SCRIPT} ${IRB_WITHOUT_SUFFIX} ${IRB_WITH_SUFFIX}
+ ${RUBY} ${RUBY_FLAGS} -i -p \
+ -e 'if $$. == 1; ' \
+ -e ' if /^#!/; ' \
+ -e ' sub /^#!\s*\S*(\benv\s+)?\bruby/, "#!${RUBY_WITHOUT_SUFFIX}";' \
+ -e ' else;' \
+ -e ' $$_ = "#!${RUBY_WITHOUT_SUFFIX}\n" + $$_;' \
+ -e ' end;' \
+ -e 'end' \
+ ${IRB_WITHOUT_SUFFIX}
${RUBY} ${RUBY_FLAGS} -i -p \
-e 'if $$. == 1; ' \
-e ' if /^#!/; ' \
@@ -71,9 +82,7 @@ post-install:
-e ' $$_ = "#!${RUBY_WITH_SUFFIX}\n" + $$_;' \
-e ' end;' \
-e 'end' \
- ${IRB}
- ${MV} -f ${IRB} ${IRB}${_RUBY_SUFFIX}
- ${LN} -fs ${IRB}${_RUBY_SUFFIX} ${IRB}
+ ${IRB_WITH_SUFFIX}
.if !defined(NOPORTDOCS)
${MKDIR} ${RUBY_EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/sample/* ${RUBY_EXAMPLESDIR}
diff --git a/lang/ruby18/Makefile b/lang/ruby18/Makefile
index a3adc82..1adead5 100644
--- a/lang/ruby18/Makefile
+++ b/lang/ruby18/Makefile
@@ -42,7 +42,8 @@ CONFIGURE_ARGS+= --program-suffix="${RUBY_SUFFIX}"
CONFIGURE_ARGS+= --enable-ipv6
.endif
-IRB= ${LOCALBASE}/bin/irb
+IRB_WITHOUT_SUFFIX= ${LOCALBASE}/bin/irb
+IRB_WITH_SUFFIX= ${IRB_WITHOUT_SUFFIX}${_RUBY_SUFFIX}
post-patch:
find ${WRKSRC} -name '*.orig' -delete
@@ -58,12 +59,22 @@ post-install:
strip ${RUBY}
.endif
.if empty(RUBY_SUFFIX)
- ${MV} -f ${RUBY} ${RUBY_WITH_SUFFIX}
- ${LN} -fs ${RUBY_WITH_SUFFIX} ${RUBY}
+ ${MV} -f ${RUBY_WITHOUT_SUFFIX} ${RUBY_WITH_SUFFIX}
+ ${LN} -fs ${RUBY_WITH_SUFFIX} ${RUBY_WITHOUT_SUFFIX}
${MV} ${PREFIX}/man/man1/ruby.1 ${PREFIX}/man/man1/ruby${_RUBY_SUFFIX}.1
.else
- ${LN} -fs ${RUBY} ${PREFIX}/bin/ruby
+ ${LN} -fs ${RUBY_WITH_SUFFIX} ${RUBY_WITHOUT_SUFFIX}
.endif
+ ${INSTALL_SCRIPT} ${IRB_WITHOUT_SUFFIX} ${IRB_WITH_SUFFIX}
+ ${RUBY} ${RUBY_FLAGS} -i -p \
+ -e 'if $$. == 1; ' \
+ -e ' if /^#!/; ' \
+ -e ' sub /^#!\s*\S*(\benv\s+)?\bruby/, "#!${RUBY_WITHOUT_SUFFIX}";' \
+ -e ' else;' \
+ -e ' $$_ = "#!${RUBY_WITHOUT_SUFFIX}\n" + $$_;' \
+ -e ' end;' \
+ -e 'end' \
+ ${IRB_WITHOUT_SUFFIX}
${RUBY} ${RUBY_FLAGS} -i -p \
-e 'if $$. == 1; ' \
-e ' if /^#!/; ' \
@@ -72,9 +83,7 @@ post-install:
-e ' $$_ = "#!${RUBY_WITH_SUFFIX}\n" + $$_;' \
-e ' end;' \
-e 'end' \
- ${IRB}
- ${MV} -f ${IRB} ${IRB}${_RUBY_SUFFIX}
- ${LN} -fs ${IRB}${_RUBY_SUFFIX} ${IRB}
+ ${IRB_WITH_SUFFIX}
.if !defined(NOPORTDOCS)
${MKDIR} ${RUBY_EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/sample/* ${RUBY_EXAMPLESDIR}
OpenPOWER on IntegriCloud