]> git.pld-linux.org Git - packages/redis.git/blob - redis.spec
remove install-redis-check-rdb-as-a-symlink-instead-of-dupl patch dropped from spec...
[packages/redis.git] / redis.spec
1 # TODO
2 # - Check for status of man pages http://code.google.com/p/redis/issues/detail?id=202
3 # - use shared jemalloc?
4 #
5 # Conditional build:
6 %bcond_without  tests           # build without tests
7 %bcond_without  perftools       # google perftools
8
9 %ifnarch %{ix86} %{x8664} ppc
10 # available only on selected architectures
11 %undefine       with_perftools
12 %endif
13
14 Summary:        A persistent key-value database
15 Name:           redis
16 Version:        6.2.5
17 Release:        1
18 License:        BSD
19 Group:          Applications/Databases
20 Source0:        http://download.redis.io/releases/%{name}-%{version}.tar.gz
21 # Source0-md5:  db8a2b45eafbf1ead4353044fb70f581
22 Source1:        %{name}.logrotate
23 Source2:        %{name}.init
24 Source3:        %{name}.tmpfiles
25 Patch0:         %{name}.conf.patch
26 Patch1:         %{name}-tcl.patch
27 Patch2:         0001-1st-man-pageis-for-redis-cli-redis-benchmark-redis-c.patch
28 URL:            http://www.redis.io/
29 %{?with_perftools:BuildRequires:    gperftools-devel}
30 BuildRequires:  jemalloc-static
31 %ifarch %{arm}
32 BuildRequires:  libatomic-devel
33 %endif
34 BuildRequires:  rpm >= 4.4.9-56
35 BuildRequires:  rpmbuild(macros) >= 1.202
36 BuildRequires:  sed >= 4.0
37 %{?with_tests:BuildRequires:    tcl >= 8.5}
38 Obsoletes:      redis-doc
39 Conflicts:      logrotate < 3.8.0
40 ExcludeArch:    sparc sparc64 alpha
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %description
44 Redis is an advanced key-value store. It is similar to memcached but
45 the data set is not volatile, and values can be strings, exactly like
46 in memcached, but also lists, sets, and ordered sets. All this data
47 types can be manipulated with atomic operations to push/pop elements,
48 add/remove elements, perform server side union, intersection,
49 difference between sets, and so forth. Redis supports different kind
50 of sorting abilities.
51
52 %package server
53 Summary:        Persistent key-value database with network interface
54 Group:          Applications/Databases
55 Requires(post,preun):   /sbin/chkconfig
56 Requires(postun):       /usr/sbin/groupdel
57 Requires(postun):       /usr/sbin/userdel
58 Requires(pre):  /bin/id
59 Requires(pre):  /usr/bin/getgid
60 Requires(pre):  /usr/sbin/groupadd
61 Requires(pre):  /usr/sbin/useradd
62 Requires:       rc-scripts
63 Provides:       group(redis)
64 Provides:       user(redis)
65
66 %description server
67 Redis is a key-value database in a similar vein to memcache but the
68 dataset is non-volatile. Redis additionally provides native support
69 for atomically manipulating and querying data structures such as lists
70 and sets.
71
72 The dataset is stored entirely in memory and periodically flushed to
73 disk.
74
75 %prep
76 %setup -q
77 %patch0 -p1
78 %patch1 -p1
79 %patch2 -p1
80
81 # Remove integration tests
82 %{__sed} -i -e '/    integration\/replication/d' tests/test_helper.tcl
83 %{__sed} -i -e '/    unit\/memefficiency/d' tests/test_helper.tcl
84
85 # randomize port number so concurrent builds doesn't break
86 port=$((21110 + ${RANDOM:-$$} % 1000))
87 sed -i -e "s/set ::port 21111/set ::port $port/" tests/test_helper.tcl
88
89 # use system jemalloc
90 mv deps/jemalloc{,-local}
91 install -d deps/jemalloc
92 ln -s %{_libdir} deps/jemalloc/lib
93 ln -s %{_includedir} deps/jemalloc/include
94
95 %build
96 %define specflags -std=c99 -pedantic
97 %define _make_opts CC="%{__cc}" CFLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}" OPTIMIZATION="" DEBUG="" V=1 uname_M=%{_target_cpu}
98
99 %{__make} -C src all
100
101 %if %{with tests}
102 %{__make} test
103 %endif
104
105 %install
106 rm -rf $RPM_BUILD_ROOT
107 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir}} \
108         $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d} \
109         $RPM_BUILD_ROOT%{_localstatedir}/{{lib,log,run}/%{name},log/archive/%{name}} \
110         $RPM_BUILD_ROOT%{systemdtmpfilesdir} \
111         $RPM_BUILD_ROOT%{_mandir}/man{1,5}
112
113 %{__make} install \
114         INSTALL="install -p" \
115         PREFIX=$RPM_BUILD_ROOT%{_prefix}
116
117 # Fix non-standard-executable-perm error
118 chmod a+x $RPM_BUILD_ROOT%{_bindir}/%{name}-*
119
120 # Ensure redis-server location doesn't change
121 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-server
122 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-sentinel
123
124 # Install misc other
125 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
126 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
127 cp -p %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}
128 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
129
130 # man-pages
131 for man in man/man1/*; do
132         install $man $RPM_BUILD_ROOT%{_mandir}/man1
133 done
134 for man in man/man5/*; do
135         install $man $RPM_BUILD_ROOT%{_mandir}/man5
136 done
137
138 # sentinel can be symlinked
139 echo ".so man1/redis-server.1" > $RPM_BUILD_ROOT%{_mandir}/man1/redis-sentinel.1
140 echo ".so man5/redis.conf.5" > $RPM_BUILD_ROOT%{_mandir}/man5/redis-sentinel.conf.5
141
142 %clean
143 rm -rf $RPM_BUILD_ROOT
144
145 %pre server
146 %groupadd -g 256 redis
147 %useradd -u 256 -g redis -d %{_sharedstatedir}/redis -s /sbin/nologin -c 'Redis Server' redis
148
149 %post server
150 /sbin/chkconfig --add redis
151 %service redis restart
152
153 %preun server
154 if [ "$1" = 0 ]; then
155         %service redis stop
156         /sbin/chkconfig --del redis
157 fi
158
159 %postun server
160 if [ "$1" = "0" ]; then
161         %userremove redis
162         %groupremove redis
163 fi
164
165 %files
166 %defattr(644,root,root,755)
167 %doc 00-RELEASENOTES BUGS CONTRIBUTING COPYING INSTALL MANIFESTO README.md
168 %attr(755,root,root) %{_bindir}/redis-benchmark
169 %attr(755,root,root) %{_bindir}/redis-cli
170 %{_mandir}/man1/redis-benchmark.1*
171 %{_mandir}/man1/redis-cli.1*
172
173 %files server
174 %defattr(644,root,root,755)
175 %config(noreplace) %{_sysconfdir}/%{name}.conf
176 %attr(754,root,root) /etc/rc.d/init.d/%{name}
177 %attr(755,root,root) %{_sbindir}/redis-sentinel
178 %attr(755,root,root) %{_sbindir}/redis-server
179 %attr(755,root,root) %{_bindir}/redis-check-aof
180 %attr(755,root,root) %{_bindir}/redis-check-rdb
181 %config(noreplace) /etc/logrotate.d/%{name}
182 %dir %attr(755,redis,root) %{_localstatedir}/lib/%{name}
183 %dir %attr(755,redis,root) %{_localstatedir}/log/%{name}
184 %dir %attr(755,redis,root) %{_localstatedir}/log/archive/%{name}
185 %dir %attr(755,redis,root) %{_localstatedir}/run/%{name}
186 %{systemdtmpfilesdir}/%{name}.conf
187 %{_mandir}/man1/redis-sentinel.1*
188 %{_mandir}/man1/redis-server.1*
189 %{_mandir}/man1/redis-check-aof.1*
190 %{_mandir}/man1/redis-check-rdb.1*
191 %{_mandir}/man5/redis.conf.5*
192 %{_mandir}/man5/redis-sentinel.conf.5*
This page took 0.073997 seconds and 3 git commands to generate.