-
Notifications
You must be signed in to change notification settings - Fork 0
/
rubygem-simple_form.spec
112 lines (85 loc) · 2.87 KB
/
rubygem-simple_form.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
%global gem_name simple_form
Name: rubygem-%{gem_name}
Version: 2.0.3
Release: 1%{?dist}
Summary: Flexible and powerful components to create forms
Group: Development/Languages
License: MIT
URL: https://github.com/plataformatec/%{gem_name}
Source0: http://rubygems.org/downloads/%{gem_name}-%{version}.gem
Provides: rubygem(%{gem_name}) = %{version}
BuildArch: noarch
BuildRequires: rubygems-devel
# Test suite needs the following dependencies
BuildRequires: rubygem(mocha)
BuildRequires: rubygem(minitest)
BuildRequires: rubygem(railties)
BuildRequires: rubygem(tzinfo)
%if 0%{?fedora} > 16
Requires: ruby(abi) = 1.9.1
%else
Requires: ruby(abi) = 1.8
%endif
Requires: rubygems
Requires: rubygem(activemodel) >= 3.0
Requires: rubygem(actionpack) >= 3.0
%description
SimpleForm aims to be as flexible as possible while helping you with powerful
components to create your forms. The basic goal of SimpleForm is to not touch
your way of defining the layout, letting you find the better design for your
eyes.
%package doc
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Summary: Documentation for %{name}
%description doc
This package contains documentation %{name}
%prep
gem unpack %{SOURCE0}
%setup -q -D -T -n %{gem_name}-%{version}
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%build
mkdir -p .%{gem_dir}
# Create the gem as gem install only works on a gem file
LANG=en_US.utf8 gem build %{gem_name}.gemspec
# gem install compiles any C extensions and installs into a directory
# We set that to be a local directory so that we can move it into the
# buildroot in %%install
gem install -V \
--local \
--install-dir ./%{gem_dir} \
--bindir ./%{_bindir} \
--force \
--rdoc \
%{gem_name}-%{version}.gem
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/
# Removing file which is not under source control. For further details check out:
# https://github.com/plataformatec/simple_form/issues/673
rm %{buildroot}%{gem_instdir}/test/form_builder/general_test.rb.orig
%check
# Get rid of Bundler.
sed -i "/require 'bundler\/setup'/d" test/test_helper.rb
# The following test cases require rubygem-country_select which is not packaged
# for Fedora, so commenting it out
sed -i "/require 'country_select'/d" test/test_helper.rb
sed -i '103,106 s|^|#|' test/form_builder/general_test.rb
sed -i '113,116 s|^|#|' test/form_builder/general_test.rb
sed -i '5,17 s|^|#|' test/inputs/priority_input_test.rb
sed -i '38,42 s|^|#|' test/inputs/priority_input_test.rb
find ./test -name *_test.rb | xargs testrb -Itest
%files
%dir %{gem_instdir}
%{gem_libdir}
%doc %{gem_instdir}/MIT-LICENSE
%doc %{gem_instdir}/README.md
%exclude %{gem_cache}
%{gem_spec}
%files doc
%{gem_instdir}/test
%doc %{gem_instdir}/CHANGELOG.md
%doc %{gem_docdir}
%changelog
* Fri Sep 21 2012 Imre Farkas <[email protected]> - 2.0.3-1
- Initial package