Revision 44be90c9
Added by Dominic Cleal over 8 years ago
foreman-installer/foreman-installer.spec | ||
---|---|---|
%if "%{?scl_ruby}" == "ruby193"
|
||
%global scl_prefix %{scl}-
|
||
%global scl_ruby /usr/bin/ruby193-ruby
|
||
%else
|
||
%global scl_ruby /usr/bin/ruby
|
||
%endif
|
||
|
||
# set and uncomment all three to set alpha tag
|
||
#global alphatag RC1
|
||
#global dotalphatag .%{alphatag}
|
||
... | ... | |
%build
|
||
#replace shebangs for SCL
|
||
%if %{?scl:1}%{!?scl:0}
|
||
sed -ri '1sX(/usr/bin/ruby|/usr/bin/env ruby)X%{scl_ruby}X' bin/foreman-installer
|
||
sed -ri '1sX(/usr/bin/ruby|/usr/bin/env ruby)X/usr/bin/%{?scl:%{scl_prefix}}rubyX' bin/foreman-installer
|
||
%endif
|
||
rake build \
|
||
VERSION=%{version} \
|
foreman-proxy/foreman-proxy.spec | ||
---|---|---|
%global homedir %{_datadir}/%{name}
|
||
%global confdir config
|
||
|
||
%if "%{?scl_ruby}" == "ruby193"
|
||
%global scl_prefix %{scl}-
|
||
%global scl_ruby /usr/bin/ruby193-ruby
|
||
%global scl_rake /usr/bin/ruby193-rake
|
||
%else
|
||
%global scl_ruby /usr/bin/ruby
|
||
%global scl_rake /usr/bin/rake
|
||
%endif
|
||
%global scl_ruby_bin /usr/bin/%{?scl:%{scl_prefix}}ruby
|
||
%global scl_rake /usr/bin/%{?scl:%{scl_prefix}}rake
|
||
|
||
# set and uncomment all three to set alpha tag
|
||
#global alphatag RC1
|
||
... | ... | |
--trace
|
||
|
||
#replace shebangs for SCL
|
||
%if %{?scl:1}%{!?scl:0}
|
||
%if 0%{?scl:1}
|
||
for f in bin/smart-proxy extra/query.rb extra/changelog extra/migrate_settings.rb; do
|
||
sed -ri '1sX(/usr/bin/ruby|/usr/bin/env ruby)X%{scl_ruby}X' $f
|
||
sed -ri '1sX(/usr/bin/ruby|/usr/bin/env ruby)X%{scl_ruby_bin}X' $f
|
||
done
|
||
sed -ri '1,$sX/usr/bin/rubyX%{scl_ruby}X' extra/spec/foreman-proxy.init
|
||
sed -ri '1,$sX/usr/bin/rubyX%{scl_ruby_bin}X' extra/spec/foreman-proxy.init
|
||
%endif
|
||
|
||
#replace default location of 'settings.d'
|
foreman/foreman.cron.d | ||
---|---|---|
# Get the node.rb / ENC script and store at /etc/puppet/node.rb:
|
||
# https://github.com/theforeman/puppet-foreman/blob/master/templates/external_node.rb.erb
|
||
# Send facts to Foreman, using the ENC script in a fact pushing only mode
|
||
#*/2 * * * * puppet /usr/bin/ruby193-ruby /etc/puppet/node.rb --push-facts >>/var/log/foreman/cron.log 2>&1
|
||
#*/2 * * * * puppet /usr/bin/tfm-ruby /etc/puppet/node.rb --push-facts >>/var/log/foreman/cron.log 2>&1
|
||
|
||
# Warning: ActiveRecord-based storeconfigs is deprecated from Foreman 1.1 and Puppet 3.0
|
||
# see http://projects.theforeman.org/wiki/foreman/ReleaseNotes#11-stable
|
foreman/foreman.spec | ||
---|---|---|
%global confdir extras/packaging/rpm/sources
|
||
%global foreman_rake %{_sbindir}/%{name}-rake
|
||
|
||
%if "%{?scl}" == "ruby193"
|
||
%global scl_prefix %{scl}-
|
||
%global scl_ruby /usr/bin/ruby193-ruby
|
||
%global scl_rake /usr/bin/ruby193-rake
|
||
### TODO temp disabled for SCL
|
||
%global nodoc 1
|
||
%else
|
||
%global scl_ruby /usr/bin/ruby
|
||
%global scl_rake /usr/bin/rake
|
||
%endif
|
||
# explicitly define, as we build on top of an scl, not inside with scl_package
|
||
%{?scl:%global scl_prefix %{scl}-}
|
||
%global scl_ruby_bin /usr/bin/%{?scl:%{scl_prefix}}ruby
|
||
%global scl_rake /usr/bin/%{?scl:%{scl_prefix}}rake
|
||
|
||
# set and uncomment all three to set alpha tag
|
||
#global alphatag RC1
|
||
... | ... | |
Requires: %{?scl_prefix_ruby}ruby(abi) = 1.9.1
|
||
%endif
|
||
%endif
|
||
Requires: %{scl_ruby}
|
||
Requires: %{?scl_prefix_ruby}rubygems
|
||
Requires: %{?scl_prefix_ruby}rubygem(rake) >= 0.8.3
|
||
Requires: %{?scl_prefix}rubygem(bundler_ext)
|
||
... | ... | |
# Build dependencies
|
||
BuildRequires: gettext
|
||
BuildRequires: asciidoc
|
||
BuildRequires: %{scl_ruby}
|
||
BuildRequires: %{scl_ruby_bin}
|
||
BuildRequires: %{?scl_prefix_ruby}rubygems
|
||
BuildRequires: %{?scl_prefix_ruby}rubygem(rake) >= 0.8.3
|
||
BuildRequires: %{?scl_prefix}rubygem(bundler_ext)
|
||
... | ... | |
# shebangs
|
||
for f in extras/rdoc/rdoc_prepare_script.rb \
|
||
script/rails script/performance/profiler script/performance/benchmarker script/foreman-config ; do
|
||
sed -ri '1sX(/usr/bin/ruby|/usr/bin/env ruby)X%{scl_ruby}X' $f
|
||
sed -ri '1sX(/usr/bin/ruby|/usr/bin/env ruby)X%{scl_ruby_bin}X' $f
|
||
done
|
||
sed -ri '1,$sX/usr/bin/rubyX%{scl_ruby}X' %{SOURCE1}
|
||
sed -ri '1,$sX/usr/bin/rubyX%{scl_ruby_bin}X' %{SOURCE1}
|
||
# script content
|
||
sed -ri 'sX/usr/bin/rakeX%{scl_rake}X' extras/dbmigrate script/foreman-rake
|
||
%endif
|
rubygem-archive-tar-minitar/rubygem-archive-tar-minitar.spec | ||
---|---|---|
xargs -n 1 sed -i -e '/^#!\/usr\/bin\/env ruby/d'
|
||
|
||
find %{buildroot}%{gem_instdir}/bin -type f | \
|
||
xargs -n 1 sed -i -e 's"^#!/usr/bin/env ruby"#!/usr/bin/%{?scl:%{scl_prefix_ruby}}ruby"'
|
||
xargs -n 1 sed -i -e 's"^#!/usr/bin/env ruby"#!/usr/bin/%{?scl:%{scl_prefix}}ruby"'
|
||
|
||
# require_gem is deprecated
|
||
# http://rubyforge.org/tracker/?func=detail&aid=22034&group_id=84&atid=409
|
rubygem-fastercsv/rubygem-fastercsv.spec | ||
---|---|---|
# Find files with a shebang that do not have executable permissions
|
||
for file in $(find $RPM_BUILD_ROOT%{gem_instdir} -type f ! -perm /a+x -name "*.rb"); do
|
||
if [ ! -z "`head -n 1 $file | grep \"^#!/\"`" ]; then
|
||
sed -e 's@/usr/local/bin/ruby@%{_bindir}/ruby@g' -i $file
|
||
sed -e 's@/usr/local/bin/ruby@/usr/bin/%{?scl:%{scl_prefix}}ruby@g' -i $file
|
||
chmod -v 755 $file
|
||
fi
|
||
done
|
rubygem-foreman-tasks/rubygem-foreman-tasks.spec | ||
---|---|---|
%{?scl:%scl_package rubygem-%{gem_name}}
|
||
%{!?scl:%global pkg_name %{name}}
|
||
|
||
%if "%{?scl}" == "ruby193"
|
||
%global scl_ruby /usr/bin/ruby193-ruby
|
||
%if 0%{?scl:1}
|
||
%global sysconfig_dir %{_root_sysconfdir}/sysconfig
|
||
%global bin_dir %{_root_bindir}
|
||
%else
|
||
%global scl_ruby /usr/bin/ruby
|
||
%global sysconfig_dir %{_sysconfdir}/sysconfig
|
||
%global bin_dir %{_bindir}
|
||
%endif
|
||
... | ... | |
%{?scl:"}
|
||
|
||
%build
|
||
sed -ri '1sX(/usr/bin/ruby|/usr/bin/env ruby)X%{scl_ruby}X' %{_builddir}/%{pkg_name}-%{version}/%{gem_instdir}/bin/%{service_name}
|
||
sed -ri '1sX(/usr/bin/ruby|/usr/bin/env ruby)X/usr/bin/%{?scl:%{scl_prefix}}rubyX' %{_builddir}/%{pkg_name}-%{version}/%{gem_instdir}/bin/%{service_name}
|
||
|
||
%install
|
||
mkdir -p %{buildroot}%{gem_dir}
|
rubygem-hammer_cli/rubygem-hammer_cli.spec | ||
---|---|---|
cp -pa .%{gem_dir}/* \
|
||
%{buildroot}%{gem_dir}/
|
||
|
||
sed -i '1s@/.*@/usr/bin/%{?scl_prefix_ruby}ruby@' .%{_root_bindir}/*
|
||
sed -i '1s@/.*@/usr/bin/%{?scl_prefix}ruby@' .%{_root_bindir}/*
|
||
mkdir -p %{buildroot}%{_root_bindir}
|
||
cp -pa .%{_root_bindir}/* \
|
||
%{buildroot}%{_root_bindir}/
|
Also available in: Unified diff
Rename scl_ruby variables to scl_ruby_bin, use tfm-ruby, tidy up and optimise