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