]> git.pld-linux.org Git - packages/redis.git/blame - redis.spec
enable systemd and tls
[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
7672de0d 8%bcond_without systemd # systemd support
09689a83
ER
9
10%ifnarch %{ix86} %{x8664} ppc
11# available only on selected architectures
12%undefine with_perftools
a5485691 13%endif
9702f891
ER
14
15Summary: A persistent key-value database
16Name: redis
e264e5f1 17Version: 6.2.5
e8c09b65 18Release: 1
9702f891
ER
19License: BSD
20Group: Applications/Databases
190145c5 21Source0: http://download.redis.io/releases/%{name}-%{version}.tar.gz
e264e5f1 22# Source0-md5: db8a2b45eafbf1ead4353044fb70f581
9702f891
ER
23Source1: %{name}.logrotate
24Source2: %{name}.init
1eb17a34 25Source3: %{name}.tmpfiles
12dbec18 26Patch0: %{name}.conf.patch
8a8bf4c5 27Patch1: %{name}-tcl.patch
e7e3392b 28Patch2: 0001-1st-man-pageis-for-redis-cli-redis-benchmark-redis-c.patch
34f87d6a 29Patch3: arm-arch-check.patch
ad526ad6 30URL: http://www.redis.io/
190145c5 31%{?with_perftools:BuildRequires: gperftools-devel}
3f86b561 32BuildRequires: jemalloc-static
63ba1b73
JP
33%ifarch %{arm}
34BuildRequires: libatomic-devel
35%endif
7672de0d
JP
36BuildRequires: openssl-devel
37BuildRequires: pkgconfig
12dbec18 38BuildRequires: rpm >= 4.4.9-56
c4a51acc 39BuildRequires: rpmbuild(macros) >= 1.202
9702f891 40BuildRequires: sed >= 4.0
7672de0d 41%{?with_systemd:BuildRequires: systemd-devel}
a5485691 42%{?with_tests:BuildRequires: tcl >= 8.5}
58882d01 43Obsoletes: redis-doc
84e4e437 44Conflicts: logrotate < 3.8.0
a1bbaa95 45ExcludeArch: sparc sparc64 alpha
9702f891
ER
46BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48%description
49Redis is an advanced key-value store. It is similar to memcached but
50the data set is not volatile, and values can be strings, exactly like
51in memcached, but also lists, sets, and ordered sets. All this data
52types can be manipulated with atomic operations to push/pop elements,
53add/remove elements, perform server side union, intersection,
54difference between sets, and so forth. Redis supports different kind
55of sorting abilities.
56
12dbec18
ER
57%package server
58Summary: Persistent key-value database with network interface
59Group: Applications/Databases
60Requires(post,preun): /sbin/chkconfig
61Requires(postun): /usr/sbin/groupdel
62Requires(postun): /usr/sbin/userdel
63Requires(pre): /bin/id
64Requires(pre): /usr/bin/getgid
65Requires(pre): /usr/sbin/groupadd
66Requires(pre): /usr/sbin/useradd
67Requires: rc-scripts
68Provides: group(redis)
69Provides: user(redis)
70
71%description server
72Redis is a key-value database in a similar vein to memcache but the
73dataset is non-volatile. Redis additionally provides native support
74for atomically manipulating and querying data structures such as lists
75and sets.
76
77The dataset is stored entirely in memory and periodically flushed to
78disk.
79
9702f891
ER
80%prep
81%setup -q
82%patch0 -p1
8a8bf4c5 83%patch1 -p1
e7e3392b 84%patch2 -p1
34f87d6a 85%patch3 -p1
9702f891 86
190145c5
JR
87# Remove integration tests
88%{__sed} -i -e '/ integration\/replication/d' tests/test_helper.tcl
89%{__sed} -i -e '/ unit\/memefficiency/d' tests/test_helper.tcl
3f86b561 90
f3aa83eb 91# randomize port number so concurrent builds doesn't break
fc0d370a 92port=$((21110 + ${RANDOM:-$$} % 1000))
f3aa83eb
ER
93sed -i -e "s/set ::port 21111/set ::port $port/" tests/test_helper.tcl
94
3f86b561
ER
95# use system jemalloc
96mv deps/jemalloc{,-local}
97install -d deps/jemalloc
98ln -s %{_libdir} deps/jemalloc/lib
99ln -s %{_includedir} deps/jemalloc/include
100
9702f891 101%build
7674df1b 102%define specflags -std=c99 -pedantic
7672de0d
JP
103%define _make_opts \\\
104 CC="%{__cc}" \\\
105 CFLAGS="%{rpmcflags}" \\\
106 LDFLAGS="%{rpmldflags}" \\\
107 OPTIMIZATION="" \\\
108 DEBUG="" \\\
109 BUILD_TLS=yes \\\
110 USE_SYSTEMD=%{?with_systemd:yes}%{!?with_systemd:no} \\\
111 V=1 \\\
112 uname_M=%{_target_cpu}
8234af62 113
0d272681 114%{__make} -C src all
9702f891
ER
115
116%if %{with tests}
0d272681 117%{__make} test
9702f891
ER
118%endif
119
120%install
121rm -rf $RPM_BUILD_ROOT
1eb17a34
JR
122install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir}} \
123 $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d} \
124 $RPM_BUILD_ROOT%{_localstatedir}/{{lib,log,run}/%{name},log/archive/%{name}} \
e7e3392b
AG
125 $RPM_BUILD_ROOT%{systemdtmpfilesdir} \
126 $RPM_BUILD_ROOT%{_mandir}/man{1,5}
1eb17a34 127
09689a83 128%{__make} install \
7674df1b 129 INSTALL="install -p" \
09689a83
ER
130 PREFIX=$RPM_BUILD_ROOT%{_prefix}
131
132# Fix non-standard-executable-perm error
133chmod a+x $RPM_BUILD_ROOT%{_bindir}/%{name}-*
134
135# Ensure redis-server location doesn't change
3f86b561 136mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-server
58882d01 137mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/%{name}-sentinel
7ca0dec6 138
9702f891 139# Install misc other
09689a83 140install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
f9adb8fa
ER
141cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
142cp -p %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}
58882d01 143cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
9702f891 144
e7e3392b
AG
145# man-pages
146for man in man/man1/*; do
147 install $man $RPM_BUILD_ROOT%{_mandir}/man1
148done
149for man in man/man5/*; do
150 install $man $RPM_BUILD_ROOT%{_mandir}/man5
151done
152
153# sentinel can be symlinked
154echo ".so man1/redis-server.1" > $RPM_BUILD_ROOT%{_mandir}/man1/redis-sentinel.1
155echo ".so man5/redis.conf.5" > $RPM_BUILD_ROOT%{_mandir}/man5/redis-sentinel.conf.5
156
9702f891 157%clean
ff1a4646 158rm -rf $RPM_BUILD_ROOT
9702f891 159
12dbec18 160%pre server
5d17b48f 161%groupadd -g 256 redis
c4a51acc
ER
162%useradd -u 256 -g redis -d %{_sharedstatedir}/redis -s /sbin/nologin -c 'Redis Server' redis
163
12dbec18 164%post server
c4a51acc
ER
165/sbin/chkconfig --add redis
166%service redis restart
9702f891 167
12dbec18 168%preun server
9702f891
ER
169if [ "$1" = 0 ]; then
170 %service redis stop
171 /sbin/chkconfig --del redis
172fi
173
12dbec18 174%postun server
c4a51acc
ER
175if [ "$1" = "0" ]; then
176 %userremove redis
177 %groupremove redis
178fi
179
9702f891
ER
180%files
181%defattr(644,root,root,755)
0d272681 182%doc 00-RELEASENOTES BUGS CONTRIBUTING COPYING INSTALL MANIFESTO README.md
12dbec18 183%attr(755,root,root) %{_bindir}/redis-benchmark
12dbec18 184%attr(755,root,root) %{_bindir}/redis-cli
e7e3392b
AG
185%{_mandir}/man1/redis-benchmark.1*
186%{_mandir}/man1/redis-cli.1*
12dbec18
ER
187
188%files server
189%defattr(644,root,root,755)
9702f891
ER
190%config(noreplace) %{_sysconfdir}/%{name}.conf
191%attr(754,root,root) /etc/rc.d/init.d/%{name}
31dd1a80 192%attr(755,root,root) %{_sbindir}/redis-sentinel
12dbec18 193%attr(755,root,root) %{_sbindir}/redis-server
5fddefbf
AG
194%attr(755,root,root) %{_bindir}/redis-check-aof
195%attr(755,root,root) %{_bindir}/redis-check-rdb
9702f891
ER
196%config(noreplace) /etc/logrotate.d/%{name}
197%dir %attr(755,redis,root) %{_localstatedir}/lib/%{name}
198%dir %attr(755,redis,root) %{_localstatedir}/log/%{name}
33ba1b5a 199%dir %attr(755,redis,root) %{_localstatedir}/log/archive/%{name}
9702f891 200%dir %attr(755,redis,root) %{_localstatedir}/run/%{name}
58882d01 201%{systemdtmpfilesdir}/%{name}.conf
e7e3392b
AG
202%{_mandir}/man1/redis-sentinel.1*
203%{_mandir}/man1/redis-server.1*
204%{_mandir}/man1/redis-check-aof.1*
205%{_mandir}/man1/redis-check-rdb.1*
206%{_mandir}/man5/redis.conf.5*
207%{_mandir}/man5/redis-sentinel.conf.5*
This page took 0.195473 seconds and 4 git commands to generate.