]>
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 |
70b0f7ee | 18 | Release: 1 |
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 | ||
45 | %description | |
46 | A high-performance, distributed memory object caching system. | |
47 | ||
1e501250 JR |
48 | %description -l pl.UTF-8 |
49 | Rozproszony, wysokiej wydajności system cache'owania obiektów. | |
56126164 MM |
50 | |
51 | %prep | |
52 | %setup -q | |
df9e54d9 | 53 | %{?with_repcached:%patch0 -p1} |
56126164 | 54 | |
f1cd2118 ER |
55 | sed -nie '1,/^$/p' ChangeLog |
56 | ||
70b0f7ee ER |
57 | %ifarch x32 |
58 | %{__sed} -i -e 's/-Werror//' configure.ac | |
59 | %endif | |
60 | ||
56126164 MM |
61 | %build |
62 | %{__aclocal} | |
63 | %{__autoconf} | |
64 | %{__autoheader} | |
65 | %{__automake} | |
1856e00f | 66 | %configure \ |
e355c174 | 67 | %{?with_repcached:--enable-replication} \ |
1856e00f | 68 | --disable-coverage |
56126164 MM |
69 | %{__make} |
70 | ||
71 | %install | |
72 | rm -rf $RPM_BUILD_ROOT | |
df9e54d9 | 73 | install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/var/run/memcached} \ |
d168c3ca | 74 | $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man1} \ |
f1cd2118 | 75 | $RPM_BUILD_ROOT%{systemdtmpfilesdir} |
3a964b8a | 76 | |
e355c174 | 77 | install -p memcached $RPM_BUILD_ROOT%{_sbindir} |
df9e54d9 | 78 | cp -p doc/memcached.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
56126164 | 79 | |
e355c174 | 80 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
df9e54d9 | 81 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} |
3a964b8a | 82 | |
f1cd2118 | 83 | install %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf |
d168c3ca | 84 | |
371f8914 ER |
85 | %pre |
86 | %groupadd -g 209 %{name} | |
68d94add | 87 | %useradd -u 209 -d /usr/share/empty -g %{name} -c "Memcached Daemon" %{name} |
371f8914 | 88 | |
3a964b8a AM |
89 | %post |
90 | /sbin/chkconfig --add %{name} | |
91 | %service %{name} restart | |
92 | ||
93 | %preun | |
94 | if [ "$1" = "0" ]; then | |
95 | %service -q %{name} stop | |
96 | /sbin/chkconfig --del %{name} | |
97 | fi | |
98 | ||
371f8914 ER |
99 | %postun |
100 | if [ "$1" = "0" ]; then | |
101 | %userremove %{name} | |
102 | %groupremove %{name} | |
103 | fi | |
104 | ||
56126164 MM |
105 | %clean |
106 | rm -rf $RPM_BUILD_ROOT | |
107 | ||
108 | %files | |
109 | %defattr(644,root,root,755) | |
f1cd2118 | 110 | %doc AUTHORS README.md ChangeLog doc/*.txt |
3a964b8a | 111 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} |
371f8914 ER |
112 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
113 | %attr(755,root,root) %{_sbindir}/%{name} | |
114 | %{_mandir}/man1/memcached.1* | |
115 | %dir %attr(770,root,memcached) /var/run/memcached | |
f1cd2118 | 116 | %{systemdtmpfilesdir}/%{name}.conf |