Add RUBY_SHEBANG_FILES, in which you can list files which shebang

lines need to be fixed.
This commit is contained in:
Akinori MUSHA 2000-09-30 17:34:44 +00:00
parent 83fa54885b
commit f5507f4941
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=33268

View File

@ -26,6 +26,7 @@ Ruby_Include_MAINTAINER= knu@FreeBSD.org
# RUBY_SETUP - Set to the alternative name of setup.rb (default: setup.rb).
# USE_RUBY_AMSTD - Says that the port uses amstd for building and running.
# USE_RUBY_RD - Says that the port uses rd to generate documents.
# RUBY_SHEBANG_FILES - Specify the files which shebang lines you want to fix.
#
# [variables that each port should not define]
#
@ -114,6 +115,19 @@ PLIST_SUB+= RUBY_VERSION="${RUBY_VERSION}" \
RUBY_NAME="${RUBY_NAME}" \
${PLIST_RUBY_DIRS:S,DIR="${LOCALBASE}/,DIR=",}
# fix shebang lines
.if defined(RUBY_SHEBANG_FILES) && !empty(RUBY_SHEBANG_FILES)
USE_RUBY= yes
post-patch: ruby-shebang-patch
ruby-shebang-patch:
@for f in ${RUBY_SHEBANG_FILES}; do \
${ECHO_MSG} "===> Fixing the #! line of $$f"; \
${RUBY} -i -pe '$$. == 1 and sub /^#!\s*\S*(\benv\s+)?\bruby/, "#!${RUBY}"' $$f; \
done
.endif
# extconf.rb
.if defined(USE_RUBY_EXTCONF)
USE_RUBY= yes