]> git.pld-linux.org Git - packages/redis.git/blob - redis.spec
- chkconfig, groups, etc
[packages/redis.git] / redis.spec
1 # TODO
2 # - register user/gid, pld initscript
3 # - Check for status of man pages http://code.google.com/p/redis/issues/detail?id=202
4 #
5 # Conditional build:
6 %bcond_without  tests           # build without tests
7
8 Summary:        A persistent key-value database
9 Name:           redis
10 Version:        2.0.2
11 Release:        0.2
12 License:        BSD
13 Group:          Applications/Databases
14 URL:            http://code.google.com/p/redis/
15 Source0:        http://redis.googlecode.com/files/%{name}-%{version}.tar.gz
16 # Source0-md5:  1658ab25161efcc0d0e98b4d1e38a985
17 Source1:        %{name}.logrotate
18 Source2:        %{name}.init
19 Patch0:         %{name}-redis.conf.patch
20 BuildRequires:  rpmbuild(macros) >= 1.202
21 BuildRequires:  sed >= 4.0
22 %{?with_tests:BuildRequires:    tcl}
23 Requires:       rc-scripts
24 Requires(post,preun):   /sbin/chkconfig
25 Requires(postun):       /usr/sbin/userdel
26 Requires(pre):  /bin/id
27 Requires(pre):  /usr/sbin/useradd
28 Requires(postun):       /usr/sbin/groupdel
29 Requires(pre):  /usr/bin/getgid
30 Requires(pre):  /usr/sbin/groupadd
31 Requires:       rc-scripts
32 Provides:       group(redis)
33 Provides:       user(redis)
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36 %description
37 Redis is an advanced key-value store. It is similar to memcached but
38 the data set is not volatile, and values can be strings, exactly like
39 in memcached, but also lists, sets, and ordered sets. All this data
40 types can be manipulated with atomic operations to push/pop elements,
41 add/remove elements, perform server side union, intersection,
42 difference between sets, and so forth. Redis supports different kind
43 of sorting abilities.
44
45 %prep
46 %setup -q
47 %patch0 -p1
48 # Remove integration tests
49 %{__sed} -i -e '/    execute_tests "integration\/replication"/d' tests/test_helper.tcl
50 %{__sed} -i -e '/    execute_tests "integration\/aof"/d' tests/test_helper.tcl
51
52 %build
53 %{__make} all \
54         DEBUG="" \
55         CC="%{__cc}" \
56         CFLAGS="%{rpmcflags} -std=c99"
57
58 %if %{with tests}
59 tclsh tests/test_helper.tcl
60 %endif
61
62 %install
63 rm -rf $RPM_BUILD_ROOT
64 # Install binaries
65 install -p -D %{name}-benchmark $RPM_BUILD_ROOT%{_bindir}/%{name}-benchmark
66 install -p -D %{name}-cli $RPM_BUILD_ROOT%{_bindir}/%{name}-cli
67 install -p -D %{name}-check-aof $RPM_BUILD_ROOT%{_bindir}/%{name}-check-aof
68 install -p -D %{name}-check-dump $RPM_BUILD_ROOT%{_bindir}/%{name}-check-dump
69 install -p -D %{name}-server $RPM_BUILD_ROOT%{_sbindir}/%{name}-server
70 # Install misc other
71 install -p -D %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
72 install -p -D %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
73 install -p -D %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
74 install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}
75 install -d $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}
76 install -d $RPM_BUILD_ROOT%{_localstatedir}/run/%{name}
77
78 %clean
79 rm -fr $RPM_BUILD_ROOT
80
81 %pre
82 %groupadd -g 256 redis
83 %useradd -u 256 -g redis -d %{_sharedstatedir}/redis -s /sbin/nologin -c 'Redis Server' redis
84
85 %post
86 /sbin/chkconfig --add redis
87 %service redis restart
88
89 %preun
90 if [ "$1" = 0 ]; then
91         %service redis stop
92         /sbin/chkconfig --del redis
93 fi
94
95 %postun
96 if [ "$1" = "0" ]; then
97         %userremove redis
98         %groupremove redis
99 fi
100
101 %files
102 %defattr(644,root,root,755)
103 %doc 00-RELEASENOTES BUGS COPYING Changelog README TODO doc/
104 %config(noreplace) %{_sysconfdir}/%{name}.conf
105 %attr(754,root,root) /etc/rc.d/init.d/%{name}
106 %attr(755,root,root) %{_bindir}/%{name}-*
107 %attr(755,root,root) %{_sbindir}/%{name}-*
108 %config(noreplace) /etc/logrotate.d/%{name}
109 %dir %attr(755,redis,root) %{_localstatedir}/lib/%{name}
110 %dir %attr(755,redis,root) %{_localstatedir}/log/%{name}
111 %dir %attr(755,redis,root) %{_localstatedir}/run/%{name}
This page took 0.100425 seconds and 4 git commands to generate.