diff options
author | Akinori MUSHA <knu@FreeBSD.org> | 2001-05-05 23:08:50 +0000 |
---|---|---|
committer | Akinori MUSHA <knu@FreeBSD.org> | 2001-05-05 23:08:50 +0000 |
commit | d7bf89e72ef7e61f01e87a45c92912255ed0b2e2 (patch) | |
tree | 743ce3dfac8279dfb6db83848a0be3e5f74fe456 /lang | |
parent | Add a new variable RUBY_WITH_SUFFIX. (diff) |
Install "irb" as "irb16" and make "irb" a symlink to it.
Diffstat (limited to 'lang')
-rw-r--r-- | lang/ruby/Makefile | 19 | ||||
-rw-r--r-- | lang/ruby/pkg-plist | 1 | ||||
-rw-r--r-- | lang/ruby16/Makefile | 19 | ||||
-rw-r--r-- | lang/ruby16/pkg-plist | 1 |
4 files changed, 34 insertions, 6 deletions
diff --git a/lang/ruby/Makefile b/lang/ruby/Makefile index ecab583f3506..14207cde815c 100644 --- a/lang/ruby/Makefile +++ b/lang/ruby/Makefile @@ -7,7 +7,7 @@ PORTNAME= ruby PORTVERSION= ${RUBY_PORTVERSION} -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= lang ruby ipv6 MASTER_SITES= ${MASTER_SITE_RUBY} MASTER_SITE_SUBDIR= ${RUBY_VER} @@ -41,6 +41,8 @@ CONFIGURE_ARGS+= --program-suffix="${RUBY_SUFFIX}" CONFIGURE_ARGS+= --enable-ipv6 .endif +IRB= ${LOCALBASE}/bin/irb + post-patch: find ${WRKSRC} -name '*.orig' -delete .for d in Win32API @@ -55,12 +57,23 @@ post-install: strip ${RUBY} .endif .if empty(RUBY_SUFFIX) - ${MV} -f ${RUBY} ${RUBY}${_RUBY_SUFFIX} - ${LN} -fs ${RUBY}${_RUBY_SUFFIX} ${RUBY} + ${MV} -f ${RUBY} ${RUBY_WITH_SUFFIX} + ${LN} -fs ${RUBY_WITH_SUFFIX} ${RUBY} ${MV} ${PREFIX}/man/man1/ruby.1 ${PREFIX}/man/man1/ruby${_RUBY_SUFFIX}.1 .else ${LN} -fs ${RUBY} ${PREFIX}/bin/ruby .endif + ${RUBY} ${RUBY_FLAGS} -i -p \ + -e 'if $$. == 1; ' \ + -e ' if /^#!/; ' \ + -e ' sub /^#!\s*\S*(\benv\s+)?\bruby/, "#!${RUBY_WITH_SUFFIX}";' \ + -e ' else;' \ + -e ' $$_ = "#!${RUBY_WITH_SUFFIX}\n" + $$_;' \ + -e ' end;' \ + -e 'end' \ + ${IRB} + ${MV} -f ${IRB} ${IRB}${_RUBY_SUFFIX} + ${LN} -fs ${IRB}${_RUBY_SUFFIX} ${IRB} .if !defined(NOPORTDOCS) ${MKDIR} ${RUBY_EXAMPLESDIR} ${INSTALL_DATA} ${WRKSRC}/sample/* ${RUBY_EXAMPLESDIR} diff --git a/lang/ruby/pkg-plist b/lang/ruby/pkg-plist index 79801fe1946c..0912019d6a9f 100644 --- a/lang/ruby/pkg-plist +++ b/lang/ruby/pkg-plist @@ -1,4 +1,5 @@ bin/irb +bin/irb%%_RUBY_SUFFIX%% bin/ruby bin/ruby%%_RUBY_SUFFIX%% lib/lib%%RUBY_NAME%%.so diff --git a/lang/ruby16/Makefile b/lang/ruby16/Makefile index ecab583f3506..14207cde815c 100644 --- a/lang/ruby16/Makefile +++ b/lang/ruby16/Makefile @@ -7,7 +7,7 @@ PORTNAME= ruby PORTVERSION= ${RUBY_PORTVERSION} -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= lang ruby ipv6 MASTER_SITES= ${MASTER_SITE_RUBY} MASTER_SITE_SUBDIR= ${RUBY_VER} @@ -41,6 +41,8 @@ CONFIGURE_ARGS+= --program-suffix="${RUBY_SUFFIX}" CONFIGURE_ARGS+= --enable-ipv6 .endif +IRB= ${LOCALBASE}/bin/irb + post-patch: find ${WRKSRC} -name '*.orig' -delete .for d in Win32API @@ -55,12 +57,23 @@ post-install: strip ${RUBY} .endif .if empty(RUBY_SUFFIX) - ${MV} -f ${RUBY} ${RUBY}${_RUBY_SUFFIX} - ${LN} -fs ${RUBY}${_RUBY_SUFFIX} ${RUBY} + ${MV} -f ${RUBY} ${RUBY_WITH_SUFFIX} + ${LN} -fs ${RUBY_WITH_SUFFIX} ${RUBY} ${MV} ${PREFIX}/man/man1/ruby.1 ${PREFIX}/man/man1/ruby${_RUBY_SUFFIX}.1 .else ${LN} -fs ${RUBY} ${PREFIX}/bin/ruby .endif + ${RUBY} ${RUBY_FLAGS} -i -p \ + -e 'if $$. == 1; ' \ + -e ' if /^#!/; ' \ + -e ' sub /^#!\s*\S*(\benv\s+)?\bruby/, "#!${RUBY_WITH_SUFFIX}";' \ + -e ' else;' \ + -e ' $$_ = "#!${RUBY_WITH_SUFFIX}\n" + $$_;' \ + -e ' end;' \ + -e 'end' \ + ${IRB} + ${MV} -f ${IRB} ${IRB}${_RUBY_SUFFIX} + ${LN} -fs ${IRB}${_RUBY_SUFFIX} ${IRB} .if !defined(NOPORTDOCS) ${MKDIR} ${RUBY_EXAMPLESDIR} ${INSTALL_DATA} ${WRKSRC}/sample/* ${RUBY_EXAMPLESDIR} diff --git a/lang/ruby16/pkg-plist b/lang/ruby16/pkg-plist index 79801fe1946c..0912019d6a9f 100644 --- a/lang/ruby16/pkg-plist +++ b/lang/ruby16/pkg-plist @@ -1,4 +1,5 @@ bin/irb +bin/irb%%_RUBY_SUFFIX%% bin/ruby bin/ruby%%_RUBY_SUFFIX%% lib/lib%%RUBY_NAME%%.so |