]> git.pld-linux.org Git - packages/redis.git/blob - redis.spec
- add logrotate logdir
[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 install -d $RPM_BUILD_ROOT%{_sysconfdir}
102 %{__make} install \
103         PREFIX=$RPM_BUILD_ROOT%{_prefix}
104
105 # Fix non-standard-executable-perm error
106 chmod a+x $RPM_BUILD_ROOT%{_bindir}/%{name}-*
107
108 # Ensure redis-server location doesn't change
109 install -d $RPM_BUILD_ROOT%{_sbindir}
110 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-server
111
112 # Install misc other
113 install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d}
114 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
115 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
116 cp -p %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}
117 install -d $RPM_BUILD_ROOT%{_localstatedir}/{{lib,log,run}/%{name},log/archive/%{name}}
118
119 %clean
120 rm -rf $RPM_BUILD_ROOT
121
122 %pre server
123 %groupadd -g 256 redis
124 %useradd -u 256 -g redis -d %{_sharedstatedir}/redis -s /sbin/nologin -c 'Redis Server' redis
125
126 %post server
127 /sbin/chkconfig --add redis
128 %service redis restart
129
130 %preun server
131 if [ "$1" = 0 ]; then
132         %service redis stop
133         /sbin/chkconfig --del redis
134 fi
135
136 %postun server
137 if [ "$1" = "0" ]; then
138         %userremove redis
139         %groupremove redis
140 fi
141
142 %files
143 %defattr(644,root,root,755)
144 %doc COPYING 00-RELEASENOTES BUGS Changelog README TODO
145 %attr(755,root,root) %{_bindir}/redis-benchmark
146 %attr(755,root,root) %{_bindir}/redis-check-aof
147 %attr(755,root,root) %{_bindir}/redis-check-dump
148 %attr(755,root,root) %{_bindir}/redis-cli
149
150 %files server
151 %defattr(644,root,root,755)
152 %config(noreplace) %{_sysconfdir}/%{name}.conf
153 %attr(754,root,root) /etc/rc.d/init.d/%{name}
154 %attr(755,root,root) %{_sbindir}/redis-server
155 %config(noreplace) /etc/logrotate.d/%{name}
156 %dir %attr(755,redis,root) %{_localstatedir}/lib/%{name}
157 %dir %attr(755,redis,root) %{_localstatedir}/log/%{name}
158 %dir %{_localstatedir}/log/archive/%{name}
159 %dir %attr(755,redis,root) %{_localstatedir}/run/%{name}
This page took 0.041656 seconds and 4 git commands to generate.