blob: e98aded320044459be619d1d0cac39f08e36d735 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
# Generated from rackup-2.2.1.gem by gem2rpm -*- rpm-spec -*-
%global gem_name rackup
Name: rubygem-%{gem_name}
Version: 2.2.1
Release: 2%{?dist}
Summary: A general server command for Rack applications
License: MIT
URL: https://github.com/rack/rackup
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# git clone https://github.com/rack/rackup.git && cd rackup
# git archive -v -o rackup-2.2.1-tests.tar.gz v2.2.1 test/
Source1: %{gem_name}-%{version}-tests.tar.gz
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby >= 2.5
BuildRequires: rubygem(minitest)
BuildRequires: rubygem(rack)
BuildRequires: rubygem(webrick)
BuildArch: noarch
%description
A general server command for Rack applications.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
%setup -q -n %{gem_name}-%{version} -b 1
%build
# Create the gem as gem install only works on a gem file
gem build ../%{gem_name}-%{version}.gemspec
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
# by default, so that we can move it into the buildroot in %%install
%gem_install
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
mkdir -p %{buildroot}%{_bindir}
cp -a .%{_bindir}/* \
%{buildroot}%{_bindir}/
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
find %{buildroot}%{gem_instdir}/bin -type f | \
xargs sed -i 's|^#!/usr/bin/env ruby$|#!/usr/bin/ruby|'
%check
( cd .%{gem_instdir}
cp -a %{builddir}/test .
# Avoid minitest-global_expectations in exchange of lot of deprecation warnings.
# https://github.com/rack/rack/pull/1394
mkdir -p test/minitest/global_expectations
echo 'require "minitest/autorun"' > test/minitest/global_expectations/autorun.rb
ruby -Ilib:test -e 'Dir.glob "./test/**/spec_*.rb", &method(:require)'
)
%files
%dir %{gem_instdir}
%{_bindir}/rackup
%{gem_instdir}/bin
%{gem_libdir}
%license %{gem_instdir}/license.md
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/readme.md
%doc %{gem_instdir}/releases.md
%doc %{gem_instdir}/security.md
%changelog
* Fri Jan 17 2025 Vít Ondruch <vondruch@redhat.com> - 2.2.1-2
- Add missing `BR: rubygem(minitest)`
* Mon Jan 13 2025 Vít Ondruch <vondruch@redhat.com> - 2.2.1-1
- Initial package
|