]> git.pld-linux.org Git - packages/redis.git/blob - redis.spec
- alpha broken, exclude
[packages/redis.git] / redis.spec
1 # TODO
2 # - Check for status of man pages http://code.google.com/p/redis/issues/detail?id=202
3 #
4 # Conditional build:
5 %if "%{pld_release}" == "ac"
6 %bcond_with             tests           # build without tests
7 %bcond_with             perftools       # google perftools
8 %else
9 %bcond_without  tests           # build without tests
10 %bcond_without  perftools       # google perftools
11 %endif
12
13 %ifnarch %{ix86} %{x8664} ppc
14 # available only on selected architectures
15 %undefine       with_perftools
16 %endif
17
18 Summary:        A persistent key-value database
19 Name:           redis
20 Version:        2.2.14
21 Release:        1
22 License:        BSD
23 Group:          Applications/Databases
24 URL:            http://www.redis.io/
25 Source0:        http://redis.googlecode.com/files/%{name}-%{version}.tar.gz
26 # Source0-md5:  3605e3d4c9465fdfefa2e96f3a408ef5
27 Source1:        %{name}.logrotate
28 Source2:        %{name}.init
29 Patch0:         %{name}.conf.patch
30 %{?with_perftools:BuildRequires:    google-perftools-devel}
31 BuildRequires:  rpm >= 4.4.9-56
32 BuildRequires:  rpmbuild(macros) >= 1.202
33 BuildRequires:  sed >= 4.0
34 %{?with_tests:BuildRequires:    tcl >= 8.5}
35 ExcludeArch:    sparc sparc64 alpha
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38 %description
39 Redis is an advanced key-value store. It is similar to memcached but
40 the data set is not volatile, and values can be strings, exactly like
41 in memcached, but also lists, sets, and ordered sets. All this data
42 types can be manipulated with atomic operations to push/pop elements,
43 add/remove elements, perform server side union, intersection,
44 difference between sets, and so forth. Redis supports different kind
45 of sorting abilities.
46
47 %package server
48 Summary:        Persistent key-value database with network interface
49 Group:          Applications/Databases
50 Requires(post,preun):   /sbin/chkconfig
51 Requires(postun):       /usr/sbin/groupdel
52 Requires(postun):       /usr/sbin/userdel
53 Requires(pre):  /bin/id
54 Requires(pre):  /usr/bin/getgid
55 Requires(pre):  /usr/sbin/groupadd
56 Requires(pre):  /usr/sbin/useradd
57 Requires:       rc-scripts
58 Provides:       group(redis)
59 Provides:       user(redis)
60
61 %description server
62 Redis is a key-value database in a similar vein to memcache but the
63 dataset is non-volatile. Redis additionally provides native support
64 for atomically manipulating and querying data structures such as lists
65 and sets.
66
67 The dataset is stored entirely in memory and periodically flushed to
68 disk.
69
70 %package doc
71 Summary:        documentation for redis
72 Group:          Documentation
73
74 %description doc
75 HTML Documentation for Redis.
76
77 %prep
78 %setup -q
79 %patch0 -p1
80 # Remove integration tests
81 %{__sed} -i -e '/    execute_tests "integration\/replication"/d' tests/test_helper.tcl
82 %{__sed} -i -e '/    execute_tests "integration\/aof"/d' tests/test_helper.tcl
83
84 %build
85 %{__make} all \
86         CC="%{__cc}" \
87         CFLAGS="%{rpmcflags} -std=c99" \
88         DEBUG="" \
89 %if %{with perftools}
90         USE_TCMALLOC=yes \
91 %endif
92
93 %if %{with tests}
94 tclsh tests/test_helper.tcl
95 %endif
96
97 %install
98 rm -rf $RPM_BUILD_ROOT
99 %{__make} install \
100         PREFIX=$RPM_BUILD_ROOT%{_prefix}
101
102 # Fix non-standard-executable-perm error
103 chmod a+x $RPM_BUILD_ROOT%{_bindir}/%{name}-*
104
105 # Ensure redis-server location doesn't change
106 install -d $RPM_BUILD_ROOT%{_sbindir}
107 mv $RPM_BUILD_ROOT%{_bindir}/%{name}-server $RPM_BUILD_ROOT%{_sbindir}/%{name}-server
108
109 # Install misc other
110 install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d}
111 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
112 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
113 install -p -D %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
114 install -d $RPM_BUILD_ROOT%{_localstatedir}/{lib,log,run}/%{name}
115
116 %clean
117 rm -rf $RPM_BUILD_ROOT
118
119 %pre server
120 %groupadd -g 256 redis
121 %useradd -u 256 -g redis -d %{_sharedstatedir}/redis -s /sbin/nologin -c 'Redis Server' redis
122
123 %post server
124 /sbin/chkconfig --add redis
125 %service redis restart
126
127 %preun server
128 if [ "$1" = 0 ]; then
129         %service redis stop
130         /sbin/chkconfig --del redis
131 fi
132
133 %postun server
134 if [ "$1" = "0" ]; then
135         %userremove redis
136         %groupremove redis
137 fi
138
139 %files
140 %defattr(644,root,root,755)
141 %doc COPYING 00-RELEASENOTES BUGS Changelog README TODO
142 %attr(755,root,root) %{_bindir}/redis-benchmark
143 %attr(755,root,root) %{_bindir}/redis-check-aof
144 %attr(755,root,root) %{_bindir}/redis-check-dump
145 %attr(755,root,root) %{_bindir}/redis-cli
146
147 %files server
148 %defattr(644,root,root,755)
149 %config(noreplace) %{_sysconfdir}/%{name}.conf
150 %attr(754,root,root) /etc/rc.d/init.d/%{name}
151 %attr(755,root,root) %{_sbindir}/redis-server
152 %config(noreplace) /etc/logrotate.d/%{name}
153 %dir %attr(755,redis,root) %{_localstatedir}/lib/%{name}
154 %dir %attr(755,redis,root) %{_localstatedir}/log/%{name}
155 %dir %attr(755,redis,root) %{_localstatedir}/run/%{name}
156
157 %files doc
158 %defattr(644,root,root,755)
159 %doc doc/*
This page took 0.079493 seconds and 4 git commands to generate.