]>
Commit | Line | Data |
---|---|---|
f1cd2118 | 1 | # NOTE |
e63ff5d7 | 2 | # - release notes: https://github.com/memcached/memcached/wiki/ReleaseNotes |
3980cd45 ER |
3 | # TODO |
4 | # - fix x32 build failure: | |
70b0f7ee ER |
5 | #crawler.c: In function 'crawler_metadump_eval': |
6 | #crawler.c:229:13: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'time_t {aka long long int}' [-Wformat=] | |
7 | # "key=%s exp=%ld la=%llu cas=%llu fetch=%s\n", | |
8 | # ^ | |
9 | #crawler.c:229:13: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'time_t {aka long long int}' [-Wformat=] | |
f1cd2118 | 10 | |
e355c174 ER |
11 | # Conditional build: |
12 | %bcond_with repcached # repcached support, http://repcached.lab.klab.org/ | |
13 | ||
56126164 | 14 | Summary: A high-performance, distributed memory object caching system |
ee5b4f18 | 15 | Summary(pl.UTF-8): Rozproszony, wysokiej wydajności system cache'owania obiektów |
56126164 | 16 | Name: memcached |
e63ff5d7 | 17 | Version: 1.4.33 |
040242e9 | 18 | Release: 2 |
ba4bd57b | 19 | License: BSD |
56126164 | 20 | Group: Networking/Daemons |
5628a203 | 21 | Source0: http://www.memcached.org/files/%{name}-%{version}.tar.gz |
e63ff5d7 | 22 | # Source0-md5: 2d7f6476283cd36e21e521d901d37a8f |
3a964b8a AM |
23 | Source1: %{name}.init |
24 | Source2: %{name}.sysconfig | |
d168c3ca | 25 | Source3: %{name}.tmpfiles |
b63b53d3 | 26 | URL: http://memcached.org/ |
e355c174 | 27 | Patch0: repcached.patch |
aebd8fee | 28 | BuildRequires: autoconf |
56126164 | 29 | BuildRequires: automake |
e4a0c888 | 30 | BuildRequires: libevent-devel >= 1.1 |
3a5da022 | 31 | BuildRequires: rpmbuild(macros) >= 1.268 |
f1cd2118 | 32 | BuildRequires: sed >= 4.0 |
3a5da022 | 33 | Requires(post,preun): /sbin/chkconfig |
371f8914 ER |
34 | Requires(postun): /usr/sbin/groupdel |
35 | Requires(postun): /usr/sbin/userdel | |
36 | Requires(pre): /bin/id | |
37 | Requires(pre): /usr/bin/getgid | |
38 | Requires(pre): /usr/sbin/groupadd | |
39 | Requires(pre): /usr/sbin/useradd | |
ab340080 | 40 | Requires: rc-scripts >= 0.4.1.23 |
371f8914 ER |
41 | Provides: group(memcached) |
42 | Provides: user(memcached) | |
56126164 MM |
43 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
44 | ||
947a497d ER |
45 | %define _bindir %{_sbindir} |
46 | ||
56126164 MM |
47 | %description |
48 | A high-performance, distributed memory object caching system. | |
49 | ||
1e501250 JR |
50 | %description -l pl.UTF-8 |
51 | Rozproszony, wysokiej wydajności system cache'owania obiektów. | |
56126164 | 52 | |
947a497d ER |
53 | %package devel |
54 | Summary: Files needed for development using memcached protocol | |
55 | Group: Development/Libraries | |
56 | # does not require base | |
57 | ||
58 | %description devel | |
59 | Install memcached-devel if you are developing C/C++ applications that | |
60 | require access to the memcached binary include files. | |
61 | ||
56126164 MM |
62 | %prep |
63 | %setup -q | |
df9e54d9 | 64 | %{?with_repcached:%patch0 -p1} |
56126164 | 65 | |
f1cd2118 ER |
66 | sed -nie '1,/^$/p' ChangeLog |
67 | ||
70b0f7ee ER |
68 | %ifarch x32 |
69 | %{__sed} -i -e 's/-Werror//' configure.ac | |
70 | %endif | |
71 | ||
56126164 MM |
72 | %build |
73 | %{__aclocal} | |
74 | %{__autoconf} | |
75 | %{__autoheader} | |
76 | %{__automake} | |
1856e00f | 77 | %configure \ |
e355c174 | 78 | %{?with_repcached:--enable-replication} \ |
1856e00f | 79 | --disable-coverage |
56126164 MM |
80 | %{__make} |
81 | ||
82 | %install | |
83 | rm -rf $RPM_BUILD_ROOT | |
df9e54d9 | 84 | install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/var/run/memcached} \ |
f1cd2118 | 85 | $RPM_BUILD_ROOT%{systemdtmpfilesdir} |
3a964b8a | 86 | |
947a497d ER |
87 | %{__make} install \ |
88 | INSTALL="%{__install} -p" \ | |
89 | DESTDIR=$RPM_BUILD_ROOT | |
56126164 | 90 | |
e355c174 | 91 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
df9e54d9 | 92 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} |
947a497d | 93 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf |
d168c3ca | 94 | |
371f8914 ER |
95 | %pre |
96 | %groupadd -g 209 %{name} | |
68d94add | 97 | %useradd -u 209 -d /usr/share/empty -g %{name} -c "Memcached Daemon" %{name} |
371f8914 | 98 | |
3a964b8a AM |
99 | %post |
100 | /sbin/chkconfig --add %{name} | |
101 | %service %{name} restart | |
102 | ||
103 | %preun | |
104 | if [ "$1" = "0" ]; then | |
105 | %service -q %{name} stop | |
106 | /sbin/chkconfig --del %{name} | |
107 | fi | |
108 | ||
371f8914 ER |
109 | %postun |
110 | if [ "$1" = "0" ]; then | |
111 | %userremove %{name} | |
112 | %groupremove %{name} | |
113 | fi | |
114 | ||
56126164 MM |
115 | %clean |
116 | rm -rf $RPM_BUILD_ROOT | |
117 | ||
118 | %files | |
119 | %defattr(644,root,root,755) | |
f1cd2118 | 120 | %doc AUTHORS README.md ChangeLog doc/*.txt |
3a964b8a | 121 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} |
371f8914 ER |
122 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
123 | %attr(755,root,root) %{_sbindir}/%{name} | |
124 | %{_mandir}/man1/memcached.1* | |
125 | %dir %attr(770,root,memcached) /var/run/memcached | |
f1cd2118 | 126 | %{systemdtmpfilesdir}/%{name}.conf |
947a497d ER |
127 | |
128 | %files devel | |
129 | %defattr(644,root,root,755) | |
130 | %{_includedir}/%{name} |