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