diff options
author | Akinori MUSHA <knu@FreeBSD.org> | 2001-05-06 16:48:04 +0000 |
---|---|---|
committer | Akinori MUSHA <knu@FreeBSD.org> | 2001-05-06 16:48:04 +0000 |
commit | 2bdef6aa8fbbe730ab798aaca65a0ac6033783a8 (patch) | |
tree | 87eca15e956223799c9c7dbd3b4ce57729bb0370 /lang/ruby18 | |
parent | Support installing multiple versions of ruby_s. (You'll have ruby16_s (diff) |
Let irb16 properly run on ruby16 and irb17 on ruby17.
Notes
Notes:
svn path=/head/; revision=42336
Diffstat (limited to 'lang/ruby18')
-rw-r--r-- | lang/ruby18/Makefile | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/lang/ruby18/Makefile b/lang/ruby18/Makefile index a3adc82061b9..1adead5674cf 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} |