2020-08-28 14:14:59 +08:00
|
|
|
%global gem_name actioncable
|
2022-03-04 15:03:06 +08:00
|
|
|
%global recompile_js 1
|
|
|
|
|
|
|
|
|
|
Name: rubygem-%{gem_name}
|
2023-08-18 14:33:53 +08:00
|
|
|
Version: 7.0.7
|
2022-03-04 15:03:06 +08:00
|
|
|
Release: 1
|
|
|
|
|
Summary: WebSocket framework for Rails
|
|
|
|
|
License: MIT
|
|
|
|
|
URL: http://rubyonrails.org
|
|
|
|
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
2023-01-19 15:43:11 +08:00
|
|
|
# The gem doesn't ship with the test suite, you may check it out like so
|
|
|
|
|
# git clone https://github.com/rails/rails.git
|
|
|
|
|
# cd rails/actioncable && git archive -v -o actioncable-7.0.4-tests.txz v7.0.4 test/
|
2022-03-04 15:03:06 +08:00
|
|
|
Source1: %{gem_name}-%{version}-tests.txz
|
2023-01-19 15:43:11 +08:00
|
|
|
# The source code of pregenerated JS files is not packaged.
|
|
|
|
|
# You may get them like so
|
|
|
|
|
# git clone https://github.com/rails/rails.git
|
|
|
|
|
# cd rails/actioncable && git archive -v -o actioncable-7.0.4-app.txz v7.0.4 app/
|
2022-03-04 15:03:06 +08:00
|
|
|
Source2: %{gem_name}-%{version}-app.txz
|
2023-01-19 15:43:11 +08:00
|
|
|
# Recompile with script extracted from
|
|
|
|
|
# https://github.com/rails/rails/blob/71d406697266fc2525706361b86aeb85183fe4c7/actioncable/Rakefile
|
2022-03-04 15:03:06 +08:00
|
|
|
Source3: recompile_js.rb
|
2023-01-19 15:43:11 +08:00
|
|
|
# The tools are needed for the test suite, are however unpackaged in gem file.
|
|
|
|
|
# You may get them like so
|
|
|
|
|
# git clone https://github.com/rails/rails.git --no-checkout
|
|
|
|
|
# cd rails && git archive -v -o rails-7.0.4-tools.txz v7.0.4 tools/
|
2022-03-04 15:03:06 +08:00
|
|
|
Source4: rails-%{version}-tools.txz
|
|
|
|
|
|
|
|
|
|
BuildRequires: ruby(release)
|
|
|
|
|
BuildRequires: rubygems-devel > 1.3.1
|
|
|
|
|
BuildRequires: ruby >= 2.2.2
|
|
|
|
|
BuildRequires: rubygem(actionpack) = %{version}
|
|
|
|
|
BuildRequires: rubygem(mocha)
|
|
|
|
|
BuildRequires: rubygem(nio4r)
|
|
|
|
|
BuildRequires: rubygem(puma)
|
|
|
|
|
BuildRequires: %{_bindir}/redis-server
|
|
|
|
|
BuildRequires: rubygem(redis)
|
|
|
|
|
BuildRequires: rubygem(hiredis) >= 0.6.3
|
|
|
|
|
BuildRequires: rubygem(websocket-driver)
|
2021-12-20 14:05:28 +00:00
|
|
|
%if 0%{?recompile_js} > 0
|
2022-03-04 15:03:06 +08:00
|
|
|
BuildRequires: rubygem(coffee-script)
|
|
|
|
|
BuildRequires: rubygem(sprockets)
|
|
|
|
|
BuildRequires: nodejs
|
2021-12-20 14:05:28 +00:00
|
|
|
%endif
|
2022-03-04 15:03:06 +08:00
|
|
|
BuildArch: noarch
|
|
|
|
|
|
2020-08-28 14:14:59 +08:00
|
|
|
%description
|
|
|
|
|
Structure many real-time application concerns into channels over a single
|
|
|
|
|
WebSocket connection.
|
|
|
|
|
|
2022-03-04 15:03:06 +08:00
|
|
|
%package doc
|
|
|
|
|
Summary: Documentation for %{name}
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
|
|
%description doc
|
2021-12-20 14:05:28 +00:00
|
|
|
Documentation for %{name}.
|
2020-08-28 14:14:59 +08:00
|
|
|
|
|
|
|
|
%prep
|
2022-03-04 15:03:06 +08:00
|
|
|
%setup -q -n %{gem_name}-%{version}%{?prerelease} -b1 -a2 -b4
|
2020-08-28 14:14:59 +08:00
|
|
|
|
|
|
|
|
%build
|
2021-12-20 14:05:28 +00:00
|
|
|
%if 0%{?recompile_js} > 0
|
2022-03-04 15:03:06 +08:00
|
|
|
cp -a %{SOURCE3} .
|
2021-12-20 14:05:28 +00:00
|
|
|
rm -rf lib/assets/compiled
|
|
|
|
|
RUBYOPT=-Ilib ruby recompile_js.rb
|
|
|
|
|
%endif
|
2022-03-04 15:03:06 +08:00
|
|
|
|
|
|
|
|
gem build ../%{gem_name}-%{version}%{?prerelease}.gemspec
|
2020-08-28 14:14:59 +08:00
|
|
|
%gem_install
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
mkdir -p %{buildroot}%{gem_dir}
|
|
|
|
|
cp -a .%{gem_dir}/* \
|
|
|
|
|
%{buildroot}%{gem_dir}/
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
pushd .%{gem_instdir}
|
2022-03-04 15:03:06 +08:00
|
|
|
ln -s %{_builddir}/tools ..
|
|
|
|
|
mv %{_builddir}/test .
|
2020-08-28 14:14:59 +08:00
|
|
|
mv test/client_test.rb{,.disable}
|
|
|
|
|
mv test/subscription_adapter/postgresql_test.rb{,.disable}
|
|
|
|
|
REDIS_DIR=$(mktemp -d)
|
|
|
|
|
redis-server --dir $REDIS_DIR --pidfile $REDIS_DIR/redis.pid --daemonize yes
|
2023-01-19 15:43:11 +08:00
|
|
|
ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
|
2022-03-04 15:03:06 +08:00
|
|
|
kill -INT $(cat $REDIS_DIR/redis.pid)
|
2020-08-28 14:14:59 +08:00
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%dir %{gem_instdir}
|
|
|
|
|
%license %{gem_instdir}/MIT-LICENSE
|
|
|
|
|
%{gem_libdir}
|
|
|
|
|
%exclude %{gem_cache}
|
|
|
|
|
%{gem_spec}
|
2022-03-04 15:03:06 +08:00
|
|
|
%{gem_instdir}/app
|
2020-08-28 14:14:59 +08:00
|
|
|
|
|
|
|
|
%files doc
|
|
|
|
|
%doc %{gem_docdir}
|
|
|
|
|
%doc %{gem_instdir}/CHANGELOG.md
|
|
|
|
|
%doc %{gem_instdir}/README.md
|
|
|
|
|
|
|
|
|
|
%changelog
|
2023-08-18 14:33:53 +08:00
|
|
|
* Thu Aug 17 2023 xu_ping <707078654@qq.com> - 7.0.7-1
|
|
|
|
|
- Upgrade to version 7.0.7
|
|
|
|
|
|
2023-01-19 15:43:11 +08:00
|
|
|
* Thu Jan 19 2023 wangkai <wangkai385@h-partners.com> - 7.0.4-1
|
|
|
|
|
- Upgrade to version 7.0.4
|
|
|
|
|
|
2022-06-08 14:31:59 +08:00
|
|
|
* Wed May 04 2022 wangkerong <wangkerong@h-partners.com> - 6.1.4.1-1
|
2022-03-04 15:03:06 +08:00
|
|
|
- Upgrade to 6.1.4.1
|
|
|
|
|
|
2021-02-08 17:12:18 +08:00
|
|
|
* Mon Feb 8 2021 sunguoshuai <sunguoshuai@huawei.com> - 5.2.4.4-1
|
|
|
|
|
- Upgrade to 5.2.4.4
|
|
|
|
|
|
2020-08-28 14:14:59 +08:00
|
|
|
* Thu Aug 20 2020 shenleizhao <shenleizhao@huawei.com> - 5.2.3-1
|
|
|
|
|
- package init
|