-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruby-redis.spec
More file actions
93 lines (75 loc) · 2.47 KB
/
ruby-redis.spec
File metadata and controls
93 lines (75 loc) · 2.47 KB
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
#
# Conditional build:
%bcond_without tests # build without tests
%define pkgname redis
Summary: A Ruby client that tries to match Redis' API one-to-one
Name: ruby-%{pkgname}
Version: 5.4.1
Release: 2
License: MIT
Group: Development/Languages
Source0: http://rubygems.org/downloads/%{pkgname}-%{version}.gem
# Source0-md5: 0104a574036021f2b86a343e4ea59ca7
URL: http://github.com/redis/redis-rb
BuildRequires: rpm-rubyprov
BuildRequires: rpmbuild(macros) >= 1.665
BuildRequires: ruby-devel
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
A Ruby client that tries to match Redis' API one-to-one.
%package rdoc
Summary: HTML documentation for %{name}
Summary(pl.UTF-8): Dokumentacja w formacie HTML dla %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
%description rdoc
HTML documentation for %{name}.
%description rdoc -l pl.UTF-8
Dokumentacja w formacie HTML dla %{name}.
%package ri
Summary: ri documentation for %{name}
Summary(pl.UTF-8): Dokumentacja w formacie ri dla %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
%description ri
ri documentation for %{name}.
%description ri -l pl.UTF-8
Dokumentacji w formacie ri dla %{name}.
%prep
%setup -q -n %{pkgname}-%{version}
%build
%__gem_helper spec
rdoc --ri --op ri lib
rdoc --op rdoc lib
rm ri/created.rid
rm ri/cache.ri
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{ruby_ridir},%{ruby_rdocdir},%{_examplesdir}/%{name}-%{version}}
cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
cp -a rdoc $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version}
# Examples
if [ -d examples ]; then
cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -type f -name "*.rb" | xargs sed -i -e '1s,/usr/bin/env ruby,%{__ruby},'
# Fix other possible shebangs
find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -type f | xargs grep -l "/usr/bin/env ruby" | xargs -r sed -i -e '1s,/usr/bin/env ruby,%{__ruby},'
fi
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc README.md
%{ruby_vendorlibdir}/redis
%{ruby_vendorlibdir}/redis.rb
%{ruby_specdir}/%{pkgname}-%{version}.gemspec
%{_examplesdir}/%{name}-%{version}
%files rdoc
%defattr(644,root,root,755)
%{ruby_rdocdir}/%{name}-%{version}
%files ri
%defattr(644,root,root,755)
%{ruby_ridir}/Redis