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