]> git.pld-linux.org Git - packages/redis.git/blame - redis.spec
- updated to 4.0.11
[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:
6%bcond_without tests # build without tests
09689a83 7%bcond_without perftools # google perftools
09689a83
ER
8
9%ifnarch %{ix86} %{x8664} ppc
10# available only on selected architectures
11%undefine with_perftools
a5485691 12%endif
9702f891
ER
13
14Summary: A persistent key-value database
15Name: redis
0d272681 16Version: 4.0.11
e8c09b65 17Release: 1
9702f891
ER
18License: BSD
19Group: Applications/Databases
190145c5 20Source0: http://download.redis.io/releases/%{name}-%{version}.tar.gz
0d272681 21# Source0-md5: e62d3793f86a6a0021609c9f905cb960
9702f891
ER
22Source1: %{name}.logrotate
23Source2: %{name}.init
1eb17a34 24Source3: %{name}.tmpfiles
12dbec18 25Patch0: %{name}.conf.patch
8a8bf4c5 26Patch1: %{name}-tcl.patch
ad526ad6 27URL: http://www.redis.io/
190145c5 28%{?with_perftools:BuildRequires: gperftools-devel}
3f86b561 29BuildRequires: jemalloc-static
12dbec18 30BuildRequires: rpm >= 4.4.9-56
c4a51acc 31BuildRequires: rpmbuild(macros) >= 1.202
9702f891 32BuildRequires: sed >= 4.0
a5485691 33%{?with_tests:BuildRequires: tcl >= 8.5}
58882d01 34Obsoletes: redis-doc
84e4e437 35Conflicts: logrotate < 3.8.0
a1bbaa95 36ExcludeArch: sparc sparc64 alpha
9702f891
ER
37BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39%description
40Redis is an advanced key-value store. It is similar to memcached but
41the data set is not volatile, and values can be strings, exactly like
42in memcached, but also lists, sets, and ordered sets. All this data
43types can be manipulated with atomic operations to push/pop elements,
44add/remove elements, perform server side union, intersection,
45difference between sets, and so forth. Redis supports different kind
46of sorting abilities.
47
12dbec18
ER
48%package server
49Summary: Persistent key-value database with network interface
50Group: Applications/Databases
51Requires(post,preun): /sbin/chkconfig
52Requires(postun): /usr/sbin/groupdel
53Requires(postun): /usr/sbin/userdel
54Requires(pre): /bin/id
55Requires(pre): /usr/bin/getgid
56Requires(pre): /usr/sbin/groupadd
57Requires(pre): /usr/sbin/useradd
58Requires: rc-scripts
59Provides: group(redis)
60Provides: user(redis)
61
62%description server
63Redis is a key-value database in a similar vein to memcache but the
64dataset is non-volatile. Redis additionally provides native support
65for atomically manipulating and querying data structures such as lists
66and sets.
67
68The dataset is stored entirely in memory and periodically flushed to
69disk.
70
9702f891
ER
71%prep
72%setup -q
73%patch0 -p1
8a8bf4c5 74%patch1 -p1
9702f891 75
190145c5
JR
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
3f86b561 79
f3aa83eb 80# randomize port number so concurrent builds doesn't break
fc0d370a 81port=$((21110 + ${RANDOM:-$$} % 1000))
f3aa83eb
ER
82sed -i -e "s/set ::port 21111/set ::port $port/" tests/test_helper.tcl
83
3f86b561
ER
84# use system jemalloc
85mv deps/jemalloc{,-local}
86install -d deps/jemalloc
87ln -s %{_libdir} deps/jemalloc/lib
88ln -s %{_includedir} deps/jemalloc/include
89
9702f891 90%build
7674df1b
ER
91%define specflags -std=c99 -pedantic
92%define _make_opts CC="%{__cc}" CFLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}" OPTIMIZATION="" DEBUG="" V=1
8234af62 93
0d272681 94%{__make} -C src all
9702f891
ER
95
96%if %{with tests}
0d272681 97%{__make} test
9702f891
ER
98%endif
99
100%install
101rm -rf $RPM_BUILD_ROOT
1eb17a34
JR
102install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir}} \
103 $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d} \
104 $RPM_BUILD_ROOT%{_localstatedir}/{{lib,log,run}/%{name},log/archive/%{name}} \
58882d01 105 $RPM_BUILD_ROOT%{systemdtmpfilesdir}
1eb17a34 106
09689a83 107%{__make} install \
7674df1b 108 INSTALL="install -p" \
09689a83
ER
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
58882d01 116mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-sentinel
7ca0dec6 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}
58882d01 122cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{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)
0d272681 149%doc 00-RELEASENOTES BUGS CONTRIBUTING COPYING INSTALL MANIFESTO README.md
12dbec18
ER
150%attr(755,root,root) %{_bindir}/redis-benchmark
151%attr(755,root,root) %{_bindir}/redis-check-aof
0d272681 152%attr(755,root,root) %{_bindir}/redis-check-rdb
12dbec18
ER
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}
31dd1a80 159%attr(755,root,root) %{_sbindir}/redis-sentinel
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}
58882d01 166%{systemdtmpfilesdir}/%{name}.conf
This page took 0.126766 seconds and 4 git commands to generate.