]> git.pld-linux.org Git - packages/redis.git/blob - redis.spec
cleanup ac bcond
[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 # use system jemalloc
81 mv deps/jemalloc{,-local}
82 install -d deps/jemalloc
83 ln -s %{_libdir} deps/jemalloc/lib
84 ln -s %{_includedir} deps/jemalloc/include
85
86 %build
87 %define specflags -std=c99 -pedantic
88 %define _make_opts CC="%{__cc}" CFLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}" OPTIMIZATION="" DEBUG="" V=1
89
90 %{__make} -j1 -C src all
91
92 %if %{with tests}
93 %{__make} test
94 %endif
95
96 %install
97 rm -rf $RPM_BUILD_ROOT
98 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir}} \
99         $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d} \
100         $RPM_BUILD_ROOT%{_localstatedir}/{{lib,log,run}/%{name},log/archive/%{name}} \
101         $RPM_BUILD_ROOT%{systemdtmpfilesdir}
102
103 %{__make} install \
104         INSTALL="install -p" \
105         PREFIX=$RPM_BUILD_ROOT%{_prefix}
106
107 # Fix non-standard-executable-perm error
108 chmod a+x $RPM_BUILD_ROOT%{_bindir}/%{name}-*
109
110 # Ensure redis-server location doesn't change
111 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-server
112 mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-sentinel
113
114 # Install misc other
115 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
116 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
117 cp -p %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}
118 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
119
120 %clean
121 rm -rf $RPM_BUILD_ROOT
122
123 %pre server
124 %groupadd -g 256 redis
125 %useradd -u 256 -g redis -d %{_sharedstatedir}/redis -s /sbin/nologin -c 'Redis Server' redis
126
127 %post server
128 /sbin/chkconfig --add redis
129 %service redis restart
130
131 %preun server
132 if [ "$1" = 0 ]; then
133         %service redis stop
134         /sbin/chkconfig --del redis
135 fi
136
137 %postun server
138 if [ "$1" = "0" ]; then
139         %userremove redis
140         %groupremove redis
141 fi
142
143 %files
144 %defattr(644,root,root,755)
145 %doc COPYING 00-RELEASENOTES BUGS README
146 %attr(755,root,root) %{_bindir}/redis-benchmark
147 %attr(755,root,root) %{_bindir}/redis-check-aof
148 %attr(755,root,root) %{_bindir}/redis-check-dump
149 %attr(755,root,root) %{_bindir}/redis-cli
150
151 %files server
152 %defattr(644,root,root,755)
153 %config(noreplace) %{_sysconfdir}/%{name}.conf
154 %attr(754,root,root) /etc/rc.d/init.d/%{name}
155 %attr(755,root,root) %{_sbindir}/redis-sentinel
156 %attr(755,root,root) %{_sbindir}/redis-server
157 %config(noreplace) /etc/logrotate.d/%{name}
158 %dir %attr(755,redis,root) %{_localstatedir}/lib/%{name}
159 %dir %attr(755,redis,root) %{_localstatedir}/log/%{name}
160 %dir %attr(755,redis,root) %{_localstatedir}/log/archive/%{name}
161 %dir %attr(755,redis,root) %{_localstatedir}/run/%{name}
162 %{systemdtmpfilesdir}/%{name}.conf
This page took 0.051923 seconds and 4 git commands to generate.