2020-08-25 15:52:00 +08:00
|
|
|
%global gem_name jquery-rails
|
2021-03-15 19:51:20 +08:00
|
|
|
%global jquery1_expect_version 1.12.4
|
2020-08-25 15:52:00 +08:00
|
|
|
%global jquery1_version 1.12.4
|
2021-03-15 19:51:20 +08:00
|
|
|
%global jquery2_expect_version 2.2.4
|
2020-08-25 15:52:00 +08:00
|
|
|
%global jquery2_version 2.2.4
|
2022-07-04 15:02:12 +08:00
|
|
|
%global jquery3_expect_version 3.5.1
|
|
|
|
|
%global jquery3_version 3.6.0
|
2021-03-15 19:51:20 +08:00
|
|
|
#%%global unbundle_jquery1 1
|
|
|
|
|
#%%global unbundle_jquery2 1
|
|
|
|
|
%global unbundle_jquery3 1
|
2020-08-25 15:52:00 +08:00
|
|
|
Name: rubygem-%{gem_name}
|
2022-07-04 15:02:12 +08:00
|
|
|
Version: 4.4.0
|
|
|
|
|
Release: 1
|
2020-08-25 15:52:00 +08:00
|
|
|
Summary: Use jQuery with Rails 4+
|
|
|
|
|
License: MIT
|
|
|
|
|
URL: https://github.com/rails/jquery-rails
|
|
|
|
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
|
|
|
|
%{?unbundle_jquery1:Requires: jquery = %{jquery1_version}}
|
|
|
|
|
%{?unbundle_jquery2:Requires: jquery = %{jquery2_version}}
|
|
|
|
|
%{?unbundle_jquery3:Requires: jquery = %{jquery3_version}}
|
|
|
|
|
BuildRequires: ruby(release) rubygems-devel ruby web-assets-devel
|
|
|
|
|
%{?unbundle_jquery1:BuildRequires: jquery = %{jquery1_version}}
|
|
|
|
|
%{?unbundle_jquery2:BuildRequires: jquery = %{jquery2_version}}
|
|
|
|
|
%{?unbundle_jquery3:BuildRequires: jquery = %{jquery3_version}}
|
|
|
|
|
BuildRequires: rubygem(activesupport) rubygem(nokogiri) rubygem(rails-dom-testing)
|
|
|
|
|
Provides: bundled(jquery-usj) = 1.2.2
|
|
|
|
|
%{!?unbundle_jquery1:Provides: bundled(js-jquery) = %{jquery1_version}}
|
|
|
|
|
%{!?unbundle_jquery2:Provides: bundled(js-jquery) = %{jquery2_version}}
|
|
|
|
|
%{!?unbundle_jquery3:Provides: bundled(js-jquery) = %{jquery3_version}}
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
%description
|
|
|
|
|
This gem provides jQuery and the jQuery-ujs driver for your Rails 4+
|
|
|
|
|
application.
|
|
|
|
|
|
|
|
|
|
%package doc
|
|
|
|
|
Summary: Documentation for %{name}
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
%description doc
|
|
|
|
|
Documentation for %{name}.
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -c -T
|
|
|
|
|
%gem_install -n %{SOURCE0}
|
|
|
|
|
%{?unbundle_jquery1: rm .%{gem_instdir}/vendor/assets/javascripts/jquery.*}
|
|
|
|
|
%{?unbundle_jquery2: rm .%{gem_instdir}/vendor/assets/javascripts/jquery2.*}
|
|
|
|
|
%{?unbundle_jquery3: rm .%{gem_instdir}/vendor/assets/javascripts/jquery3.*}
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
mkdir -p %{buildroot}%{gem_dir}
|
|
|
|
|
cp -a .%{gem_dir}/* \
|
|
|
|
|
%{buildroot}%{gem_dir}/
|
|
|
|
|
%if 0%{?unbundle_jquery1}
|
|
|
|
|
for file in %{_jsdir}/jquery/1/*; do
|
|
|
|
|
ln -s -f $file -t %{buildroot}%{gem_instdir}/vendor/assets/javascripts/
|
|
|
|
|
done
|
|
|
|
|
%endif
|
|
|
|
|
%if 0%{?unbundle_jquery2}
|
|
|
|
|
for file in %{_jsdir}/jquery/2/*; do
|
|
|
|
|
ln -s -f $file %{buildroot}%{gem_instdir}/vendor/assets/javascripts/$(basename $file | sed 's/jquery/jquery2/')
|
|
|
|
|
done
|
|
|
|
|
%endif
|
|
|
|
|
%if 0%{?unbundle_jquery3}
|
|
|
|
|
for file in %{_jsdir}/jquery/3/*; do
|
|
|
|
|
ln -s -f $file %{buildroot}%{gem_instdir}/vendor/assets/javascripts/$(basename $file | sed 's/jquery/jquery3/')
|
|
|
|
|
done
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
pushd .%{gem_instdir}
|
|
|
|
|
ruby -Ilib -rjquery/rails/version -e '
|
|
|
|
|
exit \
|
2021-03-15 19:51:20 +08:00
|
|
|
Jquery::Rails::JQUERY_VERSION == "%{jquery1_expect_version}" && \
|
|
|
|
|
Jquery::Rails::JQUERY_2_VERSION == "%{jquery2_expect_version}" && \
|
|
|
|
|
Jquery::Rails::JQUERY_3_VERSION == "%{jquery3_expect_version}"
|
2020-08-25 15:52:00 +08:00
|
|
|
'
|
|
|
|
|
ruby -Itest -rostruct -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
|
|
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%dir %{gem_instdir}
|
|
|
|
|
%exclude %{gem_instdir}/.*
|
|
|
|
|
%license %{gem_instdir}/MIT-LICENSE
|
|
|
|
|
%{gem_libdir}
|
|
|
|
|
%{gem_instdir}/vendor
|
|
|
|
|
%exclude %{gem_cache}
|
|
|
|
|
%{gem_spec}
|
|
|
|
|
|
|
|
|
|
%files doc
|
|
|
|
|
%doc %{gem_docdir}
|
|
|
|
|
%doc %{gem_instdir}/CHANGELOG.md
|
|
|
|
|
%doc %{gem_instdir}/CONTRIBUTING.md
|
|
|
|
|
%doc %{gem_instdir}/VERSIONS.md
|
|
|
|
|
%{gem_instdir}/Gemfile
|
|
|
|
|
%doc %{gem_instdir}/README.md
|
|
|
|
|
%{gem_instdir}/Rakefile
|
|
|
|
|
%{gem_instdir}/jquery-rails.gemspec
|
|
|
|
|
%{gem_instdir}/test
|
|
|
|
|
|
|
|
|
|
%changelog
|
2022-07-04 15:02:12 +08:00
|
|
|
* Mon Jul 4 2022 liyanan <liyanan32@h-partners.com> - 4.4.0-1
|
|
|
|
|
- update to 4.4.0
|
|
|
|
|
|
2022-06-08 06:38:22 +00:00
|
|
|
* Sun Mar 15 2020 wangyue <wangyue92@huawei.com> - 4.2.2-2
|
2021-03-15 19:51:20 +08:00
|
|
|
- replace the dependence jquery{1,2} with jquery3
|
|
|
|
|
|
2020-08-25 15:52:00 +08:00
|
|
|
* Tue Aug 25 2020 huanghaitao <huanghaitao8@huawei.com> - 4.2.2-1
|
|
|
|
|
- package init
|