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