]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # NOTE | |
3 | # - release notes: https://code.google.com/p/memcached/wiki/ReleaseNotes | |
4 | ||
5 | # Conditional build: | |
6 | %bcond_with repcached # repcached support, http://repcached.lab.klab.org/ | |
7 | ||
8 | Summary: A high-performance, distributed memory object caching system | |
9 | Summary(pl.UTF-8): Rozproszony, wysokiej wydajności system cache'owania obiektów | |
10 | Name: memcached | |
11 | Version: 1.4.15 | |
12 | Release: 1 | |
13 | License: BSD | |
14 | Group: Networking/Daemons | |
15 | Source0: http://memcached.googlecode.com/files/%{name}-%{version}.tar.gz | |
16 | # Source0-md5: 36ea966f5a29655be1746bf4949f7f69 | |
17 | Source1: %{name}.init | |
18 | Source2: %{name}.sysconfig | |
19 | Source3: %{name}.tmpfiles | |
20 | URL: http://memcached.org/ | |
21 | Patch0: repcached.patch | |
22 | BuildRequires: autoconf | |
23 | BuildRequires: automake | |
24 | BuildRequires: libevent-devel >= 1.1 | |
25 | BuildRequires: rpmbuild(macros) >= 1.268 | |
26 | BuildRequires: sed >= 4.0 | |
27 | Requires(post,preun): /sbin/chkconfig | |
28 | Requires(postun): /usr/sbin/groupdel | |
29 | Requires(postun): /usr/sbin/userdel | |
30 | Requires(pre): /bin/id | |
31 | Requires(pre): /usr/bin/getgid | |
32 | Requires(pre): /usr/sbin/groupadd | |
33 | Requires(pre): /usr/sbin/useradd | |
34 | Requires: rc-scripts >= 0.4.1.23 | |
35 | Provides: group(memcached) | |
36 | Provides: user(memcached) | |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
38 | ||
39 | %description | |
40 | A high-performance, distributed memory object caching system. | |
41 | ||
42 | %description -l pl.UTF-8 | |
43 | Rozproszony, wysokiej wydajności system cache'owania obiektów. | |
44 | ||
45 | %prep | |
46 | %setup -q | |
47 | %{?with_repcached:%patch0 -p1} | |
48 | ||
49 | sed -nie '1,/^$/p' ChangeLog | |
50 | ||
51 | %build | |
52 | %{__aclocal} | |
53 | %{__autoconf} | |
54 | %{__autoheader} | |
55 | %{__automake} | |
56 | %configure \ | |
57 | %{?with_repcached:--enable-replication} \ | |
58 | --disable-coverage | |
59 | %{__make} | |
60 | ||
61 | %install | |
62 | rm -rf $RPM_BUILD_ROOT | |
63 | install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/var/run/memcached} \ | |
64 | $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man1} \ | |
65 | $RPM_BUILD_ROOT%{systemdtmpfilesdir} | |
66 | ||
67 | install -p memcached $RPM_BUILD_ROOT%{_sbindir} | |
68 | cp -p doc/memcached.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
69 | ||
70 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} | |
71 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} | |
72 | ||
73 | install %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf | |
74 | ||
75 | %pre | |
76 | %groupadd -g 209 %{name} | |
77 | %useradd -u 209 -d /usr/share/empty -g %{name} -c "Memcached Daemon" %{name} | |
78 | ||
79 | %post | |
80 | /sbin/chkconfig --add %{name} | |
81 | %service %{name} restart | |
82 | ||
83 | %preun | |
84 | if [ "$1" = "0" ]; then | |
85 | %service -q %{name} stop | |
86 | /sbin/chkconfig --del %{name} | |
87 | fi | |
88 | ||
89 | %postun | |
90 | if [ "$1" = "0" ]; then | |
91 | %userremove %{name} | |
92 | %groupremove %{name} | |
93 | fi | |
94 | ||
95 | %clean | |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | ||
98 | %files | |
99 | %defattr(644,root,root,755) | |
100 | %doc AUTHORS README.md ChangeLog doc/*.txt | |
101 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} | |
102 | %attr(754,root,root) /etc/rc.d/init.d/%{name} | |
103 | %attr(755,root,root) %{_sbindir}/%{name} | |
104 | %{_mandir}/man1/memcached.1* | |
105 | %dir %attr(770,root,memcached) /var/run/memcached | |
106 | %{systemdtmpfilesdir}/%{name}.conf |