]> git.pld-linux.org Git - packages/redis.git/blame - redis.spec
remove install-redis-check-rdb-as-a-symlink-instead-of-dupl patch dropped from spec...
[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
e264e5f1 16Version: 6.2.5
e8c09b65 17Release: 1
9702f891
ER
18License: BSD
19Group: Applications/Databases
190145c5 20Source0: http://download.redis.io/releases/%{name}-%{version}.tar.gz
e264e5f1 21# Source0-md5: db8a2b45eafbf1ead4353044fb70f581
9702f891
ER
22Source1: %{name}.logrotate
23Source2: %{name}.init
1eb17a34 24Source3: %{name}.tmpfiles
12dbec18 25Patch0: %{name}.conf.patch
8a8bf4c5 26Patch1: %{name}-tcl.patch
e7e3392b 27Patch2: 0001-1st-man-pageis-for-redis-cli-redis-benchmark-redis-c.patch
ad526ad6 28URL: http://www.redis.io/
190145c5 29%{?with_perftools:BuildRequires: gperftools-devel}
3f86b561 30BuildRequires: jemalloc-static
63ba1b73
JP
31%ifarch %{arm}
32BuildRequires: libatomic-devel
33%endif
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}
58882d01 38Obsoletes: redis-doc
84e4e437 39Conflicts: logrotate < 3.8.0
a1bbaa95 40ExcludeArch: sparc sparc64 alpha
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
8a8bf4c5 78%patch1 -p1
e7e3392b 79%patch2 -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 84
f3aa83eb 85# randomize port number so concurrent builds doesn't break
fc0d370a 86port=$((21110 + ${RANDOM:-$$} % 1000))
f3aa83eb
ER
87sed -i -e "s/set ::port 21111/set ::port $port/" tests/test_helper.tcl
88
3f86b561
ER
89# use system jemalloc
90mv deps/jemalloc{,-local}
91install -d deps/jemalloc
92ln -s %{_libdir} deps/jemalloc/lib
93ln -s %{_includedir} deps/jemalloc/include
94
9702f891 95%build
7674df1b 96%define specflags -std=c99 -pedantic
8266d011 97%define _make_opts CC="%{__cc}" CFLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}" OPTIMIZATION="" DEBUG="" V=1 uname_M=%{_target_cpu}
8234af62 98
0d272681 99%{__make} -C src all
9702f891
ER
100
101%if %{with tests}
0d272681 102%{__make} test
9702f891
ER
103%endif
104
105%install
106rm -rf $RPM_BUILD_ROOT
1eb17a34
JR
107install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir}} \
108 $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d} \
109 $RPM_BUILD_ROOT%{_localstatedir}/{{lib,log,run}/%{name},log/archive/%{name}} \
e7e3392b
AG
110 $RPM_BUILD_ROOT%{systemdtmpfilesdir} \
111 $RPM_BUILD_ROOT%{_mandir}/man{1,5}
1eb17a34 112
09689a83 113%{__make} install \
7674df1b 114 INSTALL="install -p" \
09689a83
ER
115 PREFIX=$RPM_BUILD_ROOT%{_prefix}
116
117# Fix non-standard-executable-perm error
118chmod a+x $RPM_BUILD_ROOT%{_bindir}/%{name}-*
119
120# Ensure redis-server location doesn't change
3f86b561 121mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-server
58882d01 122mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-sentinel
7ca0dec6 123
9702f891 124# Install misc other
09689a83 125install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
f9adb8fa
ER
126cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
127cp -p %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}
58882d01 128cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
9702f891 129
e7e3392b
AG
130# man-pages
131for man in man/man1/*; do
132 install $man $RPM_BUILD_ROOT%{_mandir}/man1
133done
134for man in man/man5/*; do
135 install $man $RPM_BUILD_ROOT%{_mandir}/man5
136done
137
138# sentinel can be symlinked
139echo ".so man1/redis-server.1" > $RPM_BUILD_ROOT%{_mandir}/man1/redis-sentinel.1
140echo ".so man5/redis.conf.5" > $RPM_BUILD_ROOT%{_mandir}/man5/redis-sentinel.conf.5
141
9702f891 142%clean
ff1a4646 143rm -rf $RPM_BUILD_ROOT
9702f891 144
12dbec18 145%pre server
5d17b48f 146%groupadd -g 256 redis
c4a51acc
ER
147%useradd -u 256 -g redis -d %{_sharedstatedir}/redis -s /sbin/nologin -c 'Redis Server' redis
148
12dbec18 149%post server
c4a51acc
ER
150/sbin/chkconfig --add redis
151%service redis restart
9702f891 152
12dbec18 153%preun server
9702f891
ER
154if [ "$1" = 0 ]; then
155 %service redis stop
156 /sbin/chkconfig --del redis
157fi
158
12dbec18 159%postun server
c4a51acc
ER
160if [ "$1" = "0" ]; then
161 %userremove redis
162 %groupremove redis
163fi
164
9702f891
ER
165%files
166%defattr(644,root,root,755)
0d272681 167%doc 00-RELEASENOTES BUGS CONTRIBUTING COPYING INSTALL MANIFESTO README.md
12dbec18 168%attr(755,root,root) %{_bindir}/redis-benchmark
12dbec18 169%attr(755,root,root) %{_bindir}/redis-cli
e7e3392b
AG
170%{_mandir}/man1/redis-benchmark.1*
171%{_mandir}/man1/redis-cli.1*
12dbec18
ER
172
173%files server
174%defattr(644,root,root,755)
9702f891
ER
175%config(noreplace) %{_sysconfdir}/%{name}.conf
176%attr(754,root,root) /etc/rc.d/init.d/%{name}
31dd1a80 177%attr(755,root,root) %{_sbindir}/redis-sentinel
12dbec18 178%attr(755,root,root) %{_sbindir}/redis-server
5fddefbf
AG
179%attr(755,root,root) %{_bindir}/redis-check-aof
180%attr(755,root,root) %{_bindir}/redis-check-rdb
9702f891
ER
181%config(noreplace) /etc/logrotate.d/%{name}
182%dir %attr(755,redis,root) %{_localstatedir}/lib/%{name}
183%dir %attr(755,redis,root) %{_localstatedir}/log/%{name}
33ba1b5a 184%dir %attr(755,redis,root) %{_localstatedir}/log/archive/%{name}
9702f891 185%dir %attr(755,redis,root) %{_localstatedir}/run/%{name}
58882d01 186%{systemdtmpfilesdir}/%{name}.conf
e7e3392b
AG
187%{_mandir}/man1/redis-sentinel.1*
188%{_mandir}/man1/redis-server.1*
189%{_mandir}/man1/redis-check-aof.1*
190%{_mandir}/man1/redis-check-rdb.1*
191%{_mandir}/man5/redis.conf.5*
192%{_mandir}/man5/redis-sentinel.conf.5*
This page took 0.115908 seconds and 4 git commands to generate.