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