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