]> git.pld-linux.org Git - packages/redis.git/blob - redis.spec
- up to 2.4.2, -doc package gone
[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.4.2
22 Release:        1
23 License:        BSD
24 Group:          Applications/Databases
25 URL:            http://www.redis.io/
26 Source0:        http://redis.googlecode.com/files/%{name}-%{version}.tar.gz
27 # Source0-md5:  c4b0b5e4953a11a503cb54cf6b09670e
28 Source1:        %{name}.logrotate
29 Source2:        %{name}.init
30 Patch0:         %{name}.conf.patch
31 %{?with_perftools:BuildRequires:    google-perftools-devel}
32 BuildRequires:  jemalloc-static
33 BuildRequires:  rpm >= 4.4.9-56
34 BuildRequires:  rpmbuild(macros) >= 1.202
35 BuildRequires:  sed >= 4.0
36 %{?with_tests:BuildRequires:    tcl >= 8.5}
37 ExcludeArch:    sparc sparc64 alpha
38 Obsoletes:      %{name}-doc
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 # Remove integration tests
77 %{__sed} -i -e '/    execute_tests "integration\/replication"/d' tests/test_helper.tcl
78 %{__sed} -i -e '/    execute_tests "integration\/aof"/d' tests/test_helper.tcl
79
80 # use unversioned tclsh
81 %{__sed} -i -e 's,tclsh8.5,tclsh', ./runtest tests/test_helper.tcl
82
83 # use system jemalloc
84 mv deps/jemalloc{,-local}
85 install -d deps/jemalloc
86 ln -s %{_libdir} deps/jemalloc/lib
87 ln -s %{_includedir} deps/jemalloc/include
88
89 %build
90 %{__make} all \
91         CC="%{__cc}" \
92         CFLAGS="%{rpmcflags} -std=c99" \
93         DEBUG="" \
94
95 %if %{with tests}
96 tclsh tests/test_helper.tcl
97 %endif
98
99 %install
100 rm -rf $RPM_BUILD_ROOT
101 %{__make} install \
102         PREFIX=$RPM_BUILD_ROOT%{_prefix}
103
104 # Fix non-standard-executable-perm error
105 chmod a+x $RPM_BUILD_ROOT%{_bindir}/%{name}-*
106
107 # Ensure redis-server location doesn't change
108 install -d $RPM_BUILD_ROOT%{_sbindir}
109 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-server
110
111 # Install misc other
112 install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d}
113 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
114 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
115 install -p -D %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
116 install -d $RPM_BUILD_ROOT%{_localstatedir}/{lib,log,run}/%{name}
117
118 %clean
119 rm -rf $RPM_BUILD_ROOT
120
121 %pre server
122 %groupadd -g 256 redis
123 %useradd -u 256 -g redis -d %{_sharedstatedir}/redis -s /sbin/nologin -c 'Redis Server' redis
124
125 %post server
126 /sbin/chkconfig --add redis
127 %service redis restart
128
129 %preun server
130 if [ "$1" = 0 ]; then
131         %service redis stop
132         /sbin/chkconfig --del redis
133 fi
134
135 %postun server
136 if [ "$1" = "0" ]; then
137         %userremove redis
138         %groupremove redis
139 fi
140
141 %files
142 %defattr(644,root,root,755)
143 %doc COPYING 00-RELEASENOTES BUGS Changelog README TODO
144 %attr(755,root,root) %{_bindir}/redis-benchmark
145 %attr(755,root,root) %{_bindir}/redis-check-aof
146 %attr(755,root,root) %{_bindir}/redis-check-dump
147 %attr(755,root,root) %{_bindir}/redis-cli
148
149 %files server
150 %defattr(644,root,root,755)
151 %config(noreplace) %{_sysconfdir}/%{name}.conf
152 %attr(754,root,root) /etc/rc.d/init.d/%{name}
153 %attr(755,root,root) %{_sbindir}/redis-server
154 %config(noreplace) /etc/logrotate.d/%{name}
155 %dir %attr(755,redis,root) %{_localstatedir}/lib/%{name}
156 %dir %attr(755,redis,root) %{_localstatedir}/log/%{name}
157 %dir %attr(755,redis,root) %{_localstatedir}/run/%{name}
This page took 0.285382 seconds and 4 git commands to generate.