Marcus Rueckert
7623bcfe5d
- rails.macros: add macro to fix ruby shebang line - rails.macros: always use ./bin/* stubs for calling binaries - do not try to delete git files in the rails macros OBS-URL: https://build.opensuse.org/request/show/679061 OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby/ruby-common?expand=0&rev=103
38 lines
901 B
Plaintext
38 lines
901 B
Plaintext
%rails_save_gemfile() \
|
|
cp Gemfile{,.upstream} \
|
|
mv Gemfile.lock{,.upstream} \
|
|
%{nil}
|
|
|
|
%rails_regen_gemfile_lock() \
|
|
./bin/bundle exec ./bin/rails --version \
|
|
diff -urN Gemfile.lock{.upstream,} ||: \
|
|
%{nil}
|
|
|
|
%rails_write_appinfo() \
|
|
echo -e "---\\\n:ruby_abi: %{rb_build_abi}\\\n" > .appinfo.yml \
|
|
%{nil}
|
|
|
|
%rails_fix_ruby_shebang() \
|
|
for S in $(grep -l '#!.*ruby' %* ) ; do \
|
|
SB="${S}.backup" \
|
|
cp ${S} ${SB} \
|
|
perl -p -i -e 's|#!/usr/bin/env ruby|#!%{_bindir}/ruby.%{rb_suffix}|g' $S \
|
|
diff -urN ${SB} ${S} || : \
|
|
rm ${SB} \
|
|
done \
|
|
%{nil}
|
|
|
|
%rails_fix_ruby_suffix() \
|
|
for S in $(grep -r -l '@RUBY_SUFFIX@' ${RPM_SOURCE_DIR}/ | grep -v '\.spec$') ; do \
|
|
SB="${S}.backup" \
|
|
cp ${S} ${SB} \
|
|
perl -p -i -e 's|\\\@RUBY_SUFFIX\\\@|%{rb_suffix}|g' "${S}" \
|
|
diff -urN ${SB} ${S} || : \
|
|
rm ${SB} \
|
|
done \
|
|
%{nil}
|
|
|
|
%ruby_fix_shebang() \
|
|
%{nil} \
|
|
%{nil}
|