summaryrefslogtreecommitdiffstats
path: root/rubygem-actioncable.spec
diff options
context:
space:
mode:
authorVít Ondruch <vondruch@redhat.com>2016-07-11 15:57:58 +0200
committerVít Ondruch <vondruch@redhat.com>2016-07-11 16:08:11 +0200
commit8fdc29a98fda684e4b6676bdc99e26a9e701029a (patch)
tree1107bc835e96d4ec1e187feea2959deb46528e48 /rubygem-actioncable.spec
parentda306498ddabd13e91edb653205ffe7fade5f48b (diff)
downloadrubygem-actioncable-8fdc29a98fda684e4b6676bdc99e26a9e701029a.tar.gz
rubygem-actioncable-8fdc29a98fda684e4b6676bdc99e26a9e701029a.tar.xz
rubygem-actioncable-8fdc29a98fda684e4b6676bdc99e26a9e701029a.zip
Recompile the pregenerated code.
Diffstat (limited to 'rubygem-actioncable.spec')
-rw-r--r--rubygem-actioncable.spec26
1 files changed, 25 insertions, 1 deletions
diff --git a/rubygem-actioncable.spec b/rubygem-actioncable.spec
index 7b00078..5fcb4b9 100644
--- a/rubygem-actioncable.spec
+++ b/rubygem-actioncable.spec
@@ -1,6 +1,10 @@
# Generated from actioncable-5.0.0.rc2.gem by gem2rpm -*- rpm-spec -*-
%global gem_name actioncable
+# Disabling JS recompilation might significantly reduce the amount of
+# build dependencies.
+%global recompile_js 1
+
Name: rubygem-%{gem_name}
Version: 5.0.0
Release: 1%{?dist}
@@ -12,6 +16,10 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# git clone https://github.com/rails/rails.git && cd rails/actioncable
# git checkout v5.0.0 && tar czvf actioncable-5.0.0-tests.tgz test/
Source1: %{gem_name}-%{version}-tests.tgz
+# The source code of pregenerated JS files.
+# git clone https://github.com/rails/rails.git && cd rails/actioncable
+# git checkout v5.0.0 && tar czvf actioncable-5.0.0-app.tgz app/ Rakefile
+Source2: %{gem_name}-%{version}-app.tgz
BuildRequires: ruby(release)
BuildRequires: rubygems-devel > 1.3.1
BuildRequires: ruby >= 2.2.2
@@ -21,6 +29,12 @@ BuildRequires: rubygem(nio4r)
BuildRequires: %{_bindir}/redis-server
BuildRequires: rubygem(redis)
BuildRequires: rubygem(websocket-driver)
+%if 0%{?recompile_js} > 0
+BuildRequires: rubygem(coffee-script)
+BuildRequires: rubygem(rake)
+BuildRequires: rubygem(sprockets)
+BuildRequires: %{_bindir}/node
+%endif
BuildArch: noarch
%description
@@ -40,11 +54,21 @@ Documentation for %{name}.
%prep
gem unpack %{SOURCE0}
-%setup -q -D -T -n %{gem_name}-%{version}
+%setup -q -D -T -n %{gem_name}-%{version} -a 2
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%build
+%if 0%{?recompile_js} > 0
+# Recompile the embedded JS file from CoffeeScript sources.
+#
+# This is practice suggested by packaging guidelines:
+# https://fedoraproject.org/wiki/Packaging:Guidelines#Use_of_pregenerated_code
+
+rm -rf lib/assets/compiled
+RUBYOPT=-Ilib rake assets:compile
+%endif
+
# Create the gem as gem install only works on a gem file
gem build %{gem_name}.gemspec