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