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