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

%global rubyabi 1.9.1

Summary:       Kinder, gentler I/O for Ruby
Name:          rubygem-%{gem_name}
Version:       2.7.0
Release:       5%{?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
# Simple patch file to fix automated test file 
Source1:       no_ruby_strace_test_autopush.patch 
BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires:      ruby
Requires:      ruby(abi) = %{rubyabi}
Requires:      ruby(rubygems) 
BuildRequires: ruby 
BuildRequires: ruby(abi) = %{rubyabi}
BuildRequires: ruby(rubygems) 
BuildRequires: ruby-devel
BuildRequires: rubygems-devel
BuildRequires: ruby-irb
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}
cp -a .%{gem_dir}/* \
        %{buildroot}%{gem_dir}/
patch %{buildroot}%{gem_instdir}/test/test_autopush.rb %{SOURCE1}

# 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

install -d -m0755 %{buildroot}%{ruby_sitearch}
mv %{buildroot}%{gem_instdir}/lib/kgio_ext.so %{buildroot}%{gem_extdir}/lib/

%check
# Patch test_autopush.rb
cd %{buildroot}%{gem_instdir}
RUBYOPT="-Ilib -I%{buildroot}%{ruby_sitearch} -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
%{gem_extdir}
%dir %{gem_instdir}
%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 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

* Tue 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