-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrubygem-importmap-rails.spec
87 lines (69 loc) · 2.11 KB
/
rubygem-importmap-rails.spec
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
# Generated from importmap-rails-1.0.3.gem by gem2rpm -*- rpm-spec -*-
%global gem_name importmap-rails
Name: rubygem-%{gem_name}
Version: 1.0.3
Release: 1%{?dist}
Summary: Manage modern JavaScript in Rails without transpiling or bundling
License: MIT
URL: https://github.com/rails/importmap-rails
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# To get the test suite:
# git clone https://github.com/rails/importmap-rails.git --no-checkout
# git -C importmap-rails archive -v -o importmap-rails-1.0.3-tests.txz v1.0.3 test/
Source1: %{gem_name}-%{version}%{?prerelease}-tests.txz
BuildRequires: ruby
BuildRequires: ruby(release)
# Used for sample app
BuildRequires: rubygem(bundler)
BuildRequires: rubygem(rails)
BuildRequires: rubygem(sqlite3)
BuildRequires: rubygems-devel
BuildArch: noarch
# Bundles ES Module Shims
# app/assets/javascripts/es-module-shims.js
Provides: bundled(es-module-shims) = 1.4.1
%description
Use ESM with importmap to manage modern JavaScript in Rails without
transpiling or bundling.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
%setup -q -n %{gem_name}-%{version} -b1
%build
gem build ../%{gem_name}-%{version}.gemspec
%gem_install
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
%check
pushd .%{gem_instdir}
ln -s %{_builddir}/test
echo 'gem "rails"' >> Gemfile
echo 'gem "sqlite3"' >> Gemfile
# Test requires network access
mv test/packager_integration_test.rb{,.disable}
export BUNDLE_GEMFILE="$(pwd)/Gemfile"
# Tests require building rails app (currently fails)
echo > test/dummy/config/initializers/assets.rb
mv test/importmap_test.rb{,.disable}
ruby -Ilib:test -rbundler -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
popd
%files
%dir %{gem_instdir}
%license %{gem_instdir}/MIT-LICENSE
%{gem_instdir}/app
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/README.md
%{gem_instdir}/Rakefile
%changelog
* Thu Jan 13 2022 Pavel Valena <[email protected]> - 1.0.3-1
- Initial package