summaryrefslogtreecommitdiffstats
path: root/rubygem-kgio.spec
blob: aac0afb8d2c6a837ef9145db857cc9b9dbfefe3f (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
%global gem_name kgio

%global rubyabi 1.9.1

%if 0%{?fedora} >= 17
  %global rubyabi 1.9.1
%endif

%if 0%{?fedora} >= 19
  %global rubyabi 2.0.0
%endif

Summary:       Kinder, gentler I/O for Ruby
Name:          rubygem-%{gem_name}
Version:       2.8.0
Release:       3%{?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
BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%if 0%{?fedora} >= 19
Requires:       ruby(release)
%endif

%if 0%{?fedora} >= 17 && 0%{?fedora} < 19
Requires:      ruby(abi) = %{rubyabi}
Requires:      ruby(rubygems) 
%endif

BuildRequires: ruby-devel
BuildRequires: ruby-irb
BuildRequires: rubygems-devel
BuildRequires: rubygem(minitest)
Provides:      rubygem(%{gem_name}) = %{version}
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}

%description doc
Documentation for %{name}

%prep
%setup -q -c -T
mkdir -p .%{gem_dir}
export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
gem install \
        -V \
        --local \
        --install-dir .%{gem_dir} \
	--force \
	--rdoc \
	%{SOURCE0}

# Adjusting minor permissions
chmod a+r .%{gem_instdir}/ChangeLog
chmod a+r .%{gem_instdir}/NEWS

%build

%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.
# You must replace REQUIRE_PATHS according to your gem specifics.
%if 0%{?fedora} >= 17 && 0%{?fedora} < 19
install -d -m0755 %{buildroot}%{gem_extdir}
mv %{buildroot}%{gem_instdir}/lib/kgio_ext.so %{buildroot}%{gem_extdir}/lib/
%endif

%if 0%{?fedora} >= 19
install -d m0755 %{buildroot}%{gem_extdir_mri}/lib
mv %{buildroot}%{gem_instdir}/lib/kgio_ext.so %{buildroot}%{gem_extdir_mri}/lib/
%endif

%check
cd %{buildroot}%{gem_instdir}
RUBYOPT="-Ilib -I%{buildroot}%{gem_extdir}/lib -Itest" testrb test/test_*

%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%{?fedora} >= 17 && 0%{?fedora} < 19
%{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
* 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