rubygem-sprockets/rubygem-sprockets.spec

117 lines
3.1 KiB
RPMSpec
Raw Permalink Normal View History

2021-06-25 11:26:27 +08:00
%global pkg_name %{name}
2020-08-21 10:01:50 +08:00
%global gem_name sprockets
2021-06-25 11:26:27 +08:00
Name: rubygem-%{gem_name}
2023-11-15 09:47:48 +08:00
Version: 4.2.1
2021-06-25 11:26:27 +08:00
Release: 1
Summary: Rack-based asset packaging system
Group: Development/Languages
License: MIT
URL: https://github.com/rails/sprockets
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
Source1: https://github.com/rails/%{gem_name}/archive/refs/tags/v%{version}.tar.gz
# start specfile generated dependencies
Requires: ruby(release)
Requires: ruby >= 1.9.3
Requires: ruby(rubygems)
Requires: rubygem(rack) > 1
Requires: rubygem(rack) < 3
Requires: rubygem(concurrent-ruby) >= 1.0
Requires: rubygem(concurrent-ruby) < 2
BuildRequires: ruby(release)
BuildRequires: ruby >= 1.9.3
BuildRequires: rubygems-devel
BuildRequires: rubygem(minitest)
BuildRequires: help2man
BuildRequires: rubygem(concurrent-ruby)
BuildRequires: rubygem(rake) rubygem(rack-test)
2023-11-15 09:47:48 +08:00
BuildRequires: rubygem(did_you_mean)
2021-06-25 11:26:27 +08:00
BuildArch: noarch
Provides: rubygem(%{gem_name}) = %{version}
# end specfile generated dependencies
Obsoletes: tfm-ror52-rubygem-%{gem_name} <= 3.7.2
2020-08-21 10:01:50 +08:00
%description
Sprockets is a Rack-based asset packaging system that concatenates and serves
JavaScript, CoffeeScript, CSS, LESS, Sass, and SCSS.
2021-06-25 11:26:27 +08:00
2020-08-24 15:41:51 +08:00
%package help
2021-06-25 11:26:27 +08:00
Summary: Documentation for %{pkg_name}
Group: Documentation
Requires: %{pkg_name} = %{version}-%{release}
BuildArch: noarch
2020-08-24 15:41:51 +08:00
%description help
2021-06-25 11:26:27 +08:00
Documentation for %{pkg_name}.
2020-08-21 10:01:50 +08:00
%prep
2021-06-25 11:26:27 +08:00
gem unpack %{SOURCE0}
%setup -q -D -T -n %{gem_name}-%{version}
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
2020-08-21 10:01:50 +08:00
%build
2021-06-25 11:26:27 +08:00
# Create the gem as gem install only works on a gem file
gem build %{gem_name}.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
2020-08-21 10:01:50 +08:00
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
2021-06-25 11:26:27 +08:00
2020-08-21 10:01:50 +08:00
mkdir -p %{buildroot}%{_bindir}
cp -a .%{_bindir}/* \
%{buildroot}%{_bindir}/
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
export GEM_PATH="%{buildroot}/%{gem_dir}:%{gem_dir}"
mkdir -p %{buildroot}%{_mandir}/man1
help2man --no-discard-stderr -N -s1 -o %{buildroot}%{_mandir}/man1/%{gem_name}.1 \
%{buildroot}/usr/share/gems/gems/%{gem_name}-%{version}/bin/%{gem_name}
%check
pushd .%{gem_instdir}
tar xzf %{SOURCE1}
cd %{gem_name}-%{version}
sed -i '/:Closure/ s/^/#/' lib/sprockets/autoload.rb
sed -i '/:Eco/ s/^/#/' lib/sprockets/autoload.rb
sed -i '/test "eco templates" do/,/^ end/ s/^/#/' test/test_environment.rb
sed -i '/:YUI/ s/^/#/' lib/sprockets/autoload.rb
touch Gemfile
2021-06-25 11:26:27 +08:00
RUBYOPT=-Ilib:test ruby -e 'Dir.glob "./test/**/test_*.rb"'
2020-08-21 10:01:50 +08:00
popd
%files
%dir %{gem_instdir}
%{_bindir}/sprockets
%{gem_instdir}/bin
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%{_mandir}/man1/%{gem_name}.1*
2020-08-24 15:41:51 +08:00
%files help
2020-08-21 10:01:50 +08:00
%doc %{gem_docdir}
%doc %{gem_instdir}/CHANGELOG.md
%doc %{gem_instdir}/README.md
2023-11-15 09:47:48 +08:00
%license %{gem_instdir}/MIT-LICENSE
2020-08-21 10:01:50 +08:00
2021-06-25 11:26:27 +08:00
2020-08-21 10:01:50 +08:00
%changelog
2023-11-15 09:47:48 +08:00
* Tue Nov 14 2023 Ge Wang <wang__ge@126.com> - 4.2.1-1
- update to version 4.2.1
2021-06-25 11:26:27 +08:00
* Fri Jun 25 2021 liqiuyu <liqiuyu@kylinos.cn> - 4.0.2-1
- update to 4.0.2
2020-08-24 15:41:51 +08:00
* Mon Aug 24 2020 liyanan <liyanan32@huawei.com> - 3.7.2-1
- package init