]> git.pld-linux.org Git - SPECS.git/blob - ruby-redis.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / ruby-redis.spec
1 #
2 # Conditional build:
3 %bcond_with     tests           # build without tests
4
5 %define pkgname redis
6 Summary:        A Ruby client library for Redis
7 Name:           ruby-%{pkgname}
8 Version:        3.3.0
9 Release:        1
10 License:        MIT
11 Group:          Development/Languages
12 Source0:        https://rubygems.org/gems/%{pkgname}-%{version}.gem
13 # Source0-md5:  432fa72404066a33ed4189bbf05396c4
14 Source1:        redis-test.conf
15 Patch0:         tests-localhost.patch
16 Patch1:         rubygem-redis-3.2.2-minitest.patch
17 URL:            https://github.com/redis/redis-rb
18 BuildRequires:  rpm-rubyprov
19 BuildRequires:  rpmbuild(macros) >= 1.665
20 %if %{with tests}
21 BuildRequires:  redis-server
22 BuildRequires:  rubygem(minitest)
23 %endif
24 BuildArch:      noarch
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %description
28 A Ruby client that tries to match Redis' API one-to-one, while still
29 providing an idiomatic interface. It features thread-safety,
30 client-side sharding, pipelining, and an obsession for performance.
31
32 %package doc
33 Summary:        Documentation for %{name}
34 Group:          Documentation
35 Requires:       %{name} = %{version}-%{release}
36 BuildArch:      noarch
37
38 %description doc
39 Documentation for %{name}.
40
41 %prep
42 %setup -q -n %{pkgname}-%{version}
43 #%patch0 -p1
44 #%patch1 -p1
45
46 # Install our test.conf file. Upstream dynamically generates this with Rake.
47 # To avoid using rake, we use a static file.
48 cp -p %{SOURCE1} test/test.conf
49
50 %build
51 # write .gemspec
52 %__gem_helper spec
53
54 %if %{with tests}
55 port=6381
56
57 sed -i -e "/^PORT/ s/6381/$port/" test/helper.rb
58 sed -i -e "/^port/ s/6381/$port/" test/test.conf
59
60 ## Start a testing redis server instance
61 /usr/sbin/redis-server test/test.conf
62 sleep 1
63 cat test/db/stdout
64 kill -0 `cat test/db/redis.pid`
65 ## configure kill for redis-server
66 trap 'kill -INT `cat test/db/redis.pid`' EXIT QUIT INT
67
68 ## Set locale because two tests fail in mock.
69 ## https://github.com/redis/redis-rb/issues/345
70 export LC_ALL=en_US.UTF-8
71
72 ## Problems continue to surface with Minitest 5, so I've asked upstream how
73 ## they want to proceed. https://github.com/redis/redis-rb/issues/487
74 ruby -Ilib -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
75 %endif
76
77 %install
78 rm -rf $RPM_BUILD_ROOT
79 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir}}
80 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
81 cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
82
83 # install examples
84 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
85 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
86
87 %clean
88 rm -rf $RPM_BUILD_ROOT
89
90 %files
91 %defattr(644,root,root,755)
92 %doc README.md CHANGELOG.md LICENSE
93 %{ruby_vendorlibdir}/redis.rb
94 %{ruby_vendorlibdir}/redis
95 %{ruby_specdir}/%{pkgname}-%{version}.gemspec
96 %{_examplesdir}/%{name}-%{version}
This page took 0.772321 seconds and 3 git commands to generate.