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