summaryrefslogtreecommitdiffstats
path: root/rubygem-kgio.spec
blob: f41589d62baa4ec277fc154ee9ef93808036cb23 (plain)
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
%global gem_name kgio

Summary:       Kinder, gentler I/O for Ruby
Name:          rubygem-%{gem_name}
Version:       2.9.2
Release:       1%{?dist}
Group:         Development/Tools
License:       LGPLv2 or LGPLv3
# LICENSE file defines the licencing aspects of kgiox.
# No license info in source files. 
URL:           http://bogomips.org/kgio
Source0:       http://rubygems.org/downloads/%{gem_name}-%{version}.gem
# Minitest 5 support, not yet submitted upstream
Patch0:        rubygem-kgio-2.9.2-minitest.patch
# Skip tests that fail in mock
Patch1:        rubygem-kgio-2.9.2-skip-tests.patch
BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%if 0%{?fc19} || 0%{?fc20} || 0%{?el7}
Requires:      ruby(release)
%endif
%if 0%{?el5} || 0%{?el6}
Requires:      ruby(abi) = 1.8
%endif
%if 0%{?fc19} || 0%{?fc20} || 0%{?el5} || 0%{?el6} || 0%{?el7}
Requires:      rubygem(rack)
Requires:      rubygem(raindrops) >= 0.7
Requires:      rubygem(kgio) >= 2.6
%endif

BuildRequires: ruby-devel
BuildRequires: ruby-irb
BuildRequires: rubygems-devel
BuildRequires: rubygem(minitest)
%if 0%{?fc19} || 0%{?fc20} || 0%{?el5} || 0%{?el6} || 0%{?el7}
Provides:      rubygem(%{gem_name}) = %{version}
%endif
ExcludeArch:   ppc ppc64

%description
kgio provides non-blocking I/O methods for Ruby without raising
exceptions on EAGAIN and EINPROGRESS.  It is intended for use with the
Unicorn and Rainbows! Rack servers, but may be used by other
applications (that run on Unix-like platforms).

%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch

%description doc
Documentation for %{name}

%prep
gem unpack %{SOURCE0}

%setup -q -D -T -n  %{gem_name}-%{version}

gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec

# Adjusting minor permissions
chmod a+r ChangeLog
chmod a+r NEWS

# Minitest 5 support
# Not yet submitted upstream
%patch0 -p1
# Skip tests that fail in mock
%patch1 -p1

%build
gem build %{gem_name}.gemspec

%if 0%{?el6}
mkdir -p .%{gem_dir}
export CONFIGURE_ARGS="--with-cflags='%{optflags}' $CONFIGURE_ARGS"
gem install \
        -V \
        --local \
        --install-dir .%{gem_dir} \
        --bindir .%{_bindir} \
        --force \
        --rdoc \
        --backtrace \
        %{gem_name}-%{version}.gem
%else
%gem_install
%endif

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{gem_dir}
mkdir -p %{buildroot}%{gem_extdir}/lib
cp -a .%{gem_dir}/* %{buildroot}%{gem_dir}/

# Remove the binary extension sources and build leftovers.
rm -f %{buildroot}%{gem_instdir}/.document
rm -f %{buildroot}%{gem_instdir}/.gitignore
rm -f %{buildroot}%{gem_instdir}/.manifest
rm -f %{buildroot}%{gem_instdir}/.wrongdoc.yml
rm -f %{buildroot}%{gem_instdir}/pkg.mk
rm -f %{buildroot}%{gem_instdir}/setup.rb
rm -f %{buildroot}/%{gem_instdir}/kgio.gemspec
rm -f %{buildroot}/%{gem_instdir}/GNUmakefile
rm -f %{buildroot}/%{gem_instdir}/GIT-VERSION-FILE
rm -f %{buildroot}/%{gem_instdir}/GIT-VERSION-GEN
rm -rf %{buildroot}%{gem_instdir}/.yardoc
rm -rf %{buildroot}%{gem_instdir}/ext

# If there are C extensions, mv them to the extdir.
%if 0%{?el5} || 0%{?el6} || 0%{?el7}
  install -d -m0755 %{buildroot}%{gem_extdir}
  mv %{buildroot}%{gem_instdir}/lib/kgio_ext.so %{buildroot}%{gem_extdir}/lib/
%else
  mkdir -p %{buildroot}%{gem_extdir_mri}
  cp -pa .%{gem_extdir_mri}/* %{buildroot}%{gem_extdir_mri}/
%endif

%check
pushd .%{gem_instdir}
  %if 0%{?el6}
    # TODO: make tests work on EL6.
  %else
    make test
  %endif
popd

%clean
rm -rf %{buildroot}

%files doc
%doc %{gem_dir}/doc/%{gem_name}-%{version}
%doc %{gem_instdir}/TODO
%doc %{gem_instdir}/LATEST
%doc %{gem_instdir}/Rakefile
%doc %{gem_instdir}/ISSUES
%doc %{gem_instdir}/HACKING
%doc %{gem_instdir}/test

%files
%if 0%{?fedora} >= 19
%{gem_extdir_mri}
#%%{gem_extdir_mri} 	%%{_libdir}/gems/ruby/%%{gem_name}-%%{version} 
%endif

%if 0%{?el5} || 0%{?el6}
%{gem_extdir}
#%%{gem_extdir} 	%%{_libdir}/gems/exts/%%{gem_name}-%%{version}
%endif

%dir %{gem_instdir}/lib
%doc %{gem_instdir}/LICENSE
%doc %{gem_instdir}/COPYING
%doc %{gem_instdir}/README
%doc %{gem_instdir}/NEWS
%doc %{gem_instdir}/ChangeLog
%{gem_cache}
%{gem_spec} 
%{gem_instdir}/lib/kgio.rb

%changelog
* Tue May 13 2014 Ken Dreyer <ktdreyer@ktdreyer.com> - 2.9.2-1
- Update version 2.9.2 (RHBZ #1006808)
- Adjustments for https://fedoraproject.org/wiki/Changes/Ruby_2.1
- Simplify %%check to "make test"
- Make -doc subpackage noarch

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.8.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Sat Mar 23 2013 Guillermo Gómez <guillermo.gomez@gmail.com> - 2.8.0-2
- Fixes for Ruby 2.0.0 packaging guidelines

* Sun Feb 10 2013 Guillermo Gómez <guillermo.gomez@gmail.com> - 2.8.0-1
- Update version 2.8.0

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Fri Mar 23 2012 Guillermo Gómez <guillermo.gomez@gmail.com> - 2.7.3-1
- Update version 2.7.3

* Sun Feb 12 2012 Guillermo Gómez <guillermo.gomez@gmail.com> - 2.7.0-5
- Proper use of new macros for Ruby 1.9 packaging
- irb added as build require

* Sat Jan 07 2012 Guillermo Gómez <guillermo.gomez@gmail.com> - 2.7.0-4
- Requires fixed for Ruby 1.9

* Sun Jan 01 2012 Guillermo Gómez <guillermo.gomez@gmail.com> - 2.7.0-3
- Path to kgio_ext.so at spec file check section fixed
- Moved patching test file to install section
- Unused macro removed from spec file

* Sat Dec 31 2011 Guillermo Gómez <guillermo.gomez@gmail.com> - 2.7.0-2
- For now rdoc-generated files arch-dependent
- defattr at the beginning of files remove
- README, NEWS, ChangeLog location fixed
- Test suite enabled during build time
- kgio_ext.so placed under ruby_sitearch dir

* Fri Dec 30 2011 Guillermo <guillermo.gomez@gmail.com> - 2.7.0-1
- Initial package