]> git.pld-linux.org Git - packages/memcached.git/blob - memcached.spec
b3b627227e0e3113324ed86ae793b32600433578
[packages/memcached.git] / memcached.spec
1 # NOTE
2 # - release notes: https://github.com/memcached/memcached/wiki/ReleaseNotes
3 # TODO
4 # - fix x32 build failure:
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=]
10
11 # Conditional build:
12 %bcond_with             repcached               # repcached support, http://repcached.lab.klab.org/
13
14 Summary:        A high-performance, distributed memory object caching system
15 Summary(pl.UTF-8):      Rozproszony, wysokiej wydajności system cache'owania obiektów
16 Name:           memcached
17 Version:        1.4.33
18 Release:        2
19 License:        BSD
20 Group:          Networking/Daemons
21 Source0:        http://www.memcached.org/files/%{name}-%{version}.tar.gz
22 # Source0-md5:  2d7f6476283cd36e21e521d901d37a8f
23 Source1:        %{name}.init
24 Source2:        %{name}.sysconfig
25 Source3:        %{name}.tmpfiles
26 URL:            http://memcached.org/
27 Patch0:         repcached.patch
28 BuildRequires:  autoconf
29 BuildRequires:  automake
30 BuildRequires:  libevent-devel >= 1.1
31 BuildRequires:  rpmbuild(macros) >= 1.268
32 BuildRequires:  sed >= 4.0
33 Requires(post,preun):   /sbin/chkconfig
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
40 Requires:       rc-scripts >= 0.4.1.23
41 Provides:       group(memcached)
42 Provides:       user(memcached)
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %define         _bindir %{_sbindir}
46
47 %description
48 A high-performance, distributed memory object caching system.
49
50 %description -l pl.UTF-8
51 Rozproszony, wysokiej wydajności system cache'owania obiektów.
52
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
62 %prep
63 %setup -q
64 %{?with_repcached:%patch0 -p1}
65
66 sed -nie '1,/^$/p' ChangeLog
67
68 %ifarch x32
69 %{__sed} -i -e 's/-Werror//' configure.ac
70 %endif
71
72 %build
73 %{__aclocal}
74 %{__autoconf}
75 %{__autoheader}
76 %{__automake}
77 %configure \
78         %{?with_repcached:--enable-replication} \
79         --disable-coverage
80 %{__make}
81
82 %install
83 rm -rf $RPM_BUILD_ROOT
84 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/var/run/memcached} \
85         $RPM_BUILD_ROOT%{systemdtmpfilesdir}
86
87 %{__make} install \
88         INSTALL="%{__install} -p" \
89         DESTDIR=$RPM_BUILD_ROOT
90
91 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
92 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
93 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
94
95 %pre
96 %groupadd -g 209 %{name}
97 %useradd -u 209 -d /usr/share/empty -g %{name} -c "Memcached Daemon" %{name}
98
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
109 %postun
110 if [ "$1" = "0" ]; then
111         %userremove %{name}
112         %groupremove %{name}
113 fi
114
115 %clean
116 rm -rf $RPM_BUILD_ROOT
117
118 %files
119 %defattr(644,root,root,755)
120 %doc AUTHORS README.md ChangeLog doc/*.txt
121 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
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
126 %{systemdtmpfilesdir}/%{name}.conf
127
128 %files devel
129 %defattr(644,root,root,755)
130 %{_includedir}/%{name}
This page took 0.047738 seconds and 2 git commands to generate.