Skip to content

Commit

Permalink
Drop hardcoded rack package requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
hennevogel authored and danidoni committed Mar 15, 2022
1 parent 5da7743 commit 4d078f9
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions dist/obs-bundled-gems.spec
Expand Up @@ -40,12 +40,10 @@ BuildRequires: mysql-devel
BuildRequires: nodejs
BuildRequires: python-devel
%if 0%{?suse_version}
%define __obs_ruby_version 3.1.1
%define __obs_ruby_interpreter /usr/bin/ruby.ruby3.1
BuildRequires: ruby3.1-devel
BuildRequires: openldap2-devel
%else
%define __obs_ruby_version 2.6.0
%define __obs_ruby_interpreter /usr/bin/ruby
BuildRequires: ruby-devel
BuildRequires: rubygem-bundler
Expand All @@ -59,8 +57,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
This package bundles all the gems required by the Open Build Service
to make it easier to deploy the obs-server package.

%define rack_version 2.2.3

%package -n obs-api-deps
Summary: Holding dependencies required to run the OBS frontend
Group: Productivity/Networking/Web/Utilities
Expand All @@ -75,7 +71,7 @@ Requires: obs-bundled-gems = %{version}
Requires: sphinx >= 2.2.11
Requires: perl(GD)
%if 0%{?suse_version}
Requires: rubygem(ruby:%{__obs_ruby_version}:rack:%{rack_version})
Requires: rubygem(ruby:3.1.0:rack)
%else
Requires: rubygem-bundler
Requires: rubygem-rake
Expand Down Expand Up @@ -125,9 +121,6 @@ bundle config force_ruby_platform true
bundle --local --path %{buildroot}%_libdir/obs-api/
popd

# test that the rake and rack macros is still matching our Gemfile
test -f %{buildroot}%_libdir/obs-api/ruby/%{__obs_ruby_version}/gems/rack-%{rack_version}/rack.gemspec

pushd %{_sourcedir}/open-build-service-*/dist
# run gem clean up script
chmod 755 gem_build_cleanup.sh
Expand Down Expand Up @@ -155,7 +148,7 @@ find %{buildroot}%_libdir/obs-api -name .gitignore | xargs rm -rf

# fix interpreter in installed binaries
for bin in %{buildroot}%_libdir/obs-api/ruby/*/bin/*; do
sed -i -e 's,/usr/bin/env ruby.ruby2.5,%{__obs_ruby_interpreter},' $bin
sed -i -e 's,/usr/bin/env ruby.ruby3.1,%{__obs_ruby_interpreter},' $bin
done

# remove exec bit from all other files still containing /usr/bin/env - mostly helper scripts
Expand Down

0 comments on commit 4d078f9

Please sign in to comment.