summaryrefslogtreecommitdiffstats
path: root/libmemcached-awesome.spec
blob: adc0a30a87fc72ac3989b0ac01c820a4435c407c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# Fedora spec file for libmemcached-awesome from
#
# remirepo spec file for libmemcached-awesome
#
# Copyright (c) 2009-2021 Remi Collet
# License: CC-BY-SA
# https://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#

%bcond_without               tests

%global libname              libmemcached

%global gh_commit            0ff88be3322a493773956028d4022d995f3cb193
%global gh_short             %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner             awesomized
%global gh_project           libmemcached

%global upstream_version     1.1.0
#global upstream_prever      beta3

Name:      %{libname}-awesome
Summary:   Client library and command line tools for memcached server
Version:   %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
Release:   2%{?dist}
License:   BSD
URL:       https://github.com/%{gh_owner}/%{gh_project}
Source0:   https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz

Patch0:    %{name}-catch.patch
Patch1:    %{name}-aes.patch

BuildRequires: cmake >= 3.9
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: python3-sphinx
BuildRequires: cyrus-sasl-devel
BuildRequires: flex
BuildRequires: bison
BuildRequires: memcached
BuildRequires: systemtap-sdt-devel
BuildRequires: libevent-devel > 2
BuildRequires: openssl-devel

Provides:      bundled(bobjenkins-hash)
# package rename
Obsoletes:     %{libname}-libs         < 1.1
Provides:      %{libname}-libs         = %{version}-%{release}
Provides:      %{libname}-libs%{?_isa} = %{version}-%{release}


%description
%{name} is a C/C++ client library and tools for the memcached
server (https://memcached.org/). It has been designed to be light
on memory usage, and provide full access to server side methods.

This is a resurrection of the original work from Brian Aker at libmemcached.org.


%package devel
Summary:    Header files and development libraries for %{name}

Requires:   %{name}%{?_isa} = %{version}-%{release}
# package rename
Obsoletes:  %{libname}-devel         < 1.1
Provides:   %{libname}-devel         = %{version}-%{release}
Provides:   %{libname}-devel%{?_isa} = %{version}-%{release}

%description devel
This package contains the header files and development libraries
for %{name}. If you like to develop programs using %{name}, 
you will need to install %{name}-devel.

Documentation: https://awesomized.github.io/libmemcached


%package tools
Summary:    %{name} tools

Requires:   %{name}%{?_isa} = %{version}-%{release}
# package rename
Obsoletes:  %{libname}         < 1.1
Provides:   %{libname}         = %{version}-%{release}
Provides:   %{libname}%{?_isa} = %{version}-%{release}

%description tools
This package contains the %{libname}-awesome command line tools:

memaslap    Load testing and benchmarking a server
memcapable  Checking a Memcached server capibilities and compatibility
memcat      Copy the value of a key to standard output
memcp       Copy data to a server
memdump     Dumping your server
memerror    Translate an error code to a string
memexist    Check for the existance of a key
memflush    Flush the contents of your servers
memparse    Parse an option string
memping     Test to see if a server is available.
memrm       Remove a key(s) from the server
memslap     Generate testing loads on a memcached cluster
memstat     Dump the stats of your servers to standard output
memtouch    Touches a key


%prep
%setup -q -n %{gh_project}-%{gh_commit}
%patch0 -p1
%patch1 -p1

# drop test hanging in mock
# and requiring some memcached build options
rm test/tests/memcached/sasl.cpp


%build
%cmake \
  -DBUILD_TESTING:BOOL=ON \
  -DBUILD_DOCS_MAN:BOOL=ON \
  -DBUILD_DOCS_MANGZ:BOOL=OFF \
  -DENABLE_SASL:BOOL=ON \
  -DENABLE_DTRACE:BOOL=ON \
  -DENABLE_HASH_HSIEH:BOOL=ON \
  -DENABLE_HASH_FNV64:BOOL=ON \
  -DENABLE_HASH_MURMUR:BOOL=ON \
  -DENABLE_MEMASLAP:BOOL=ON

%cmake_build


%install
%cmake_install

mv %{buildroot}%{_datadir}/%{name}/example.cnf support

rm -r %{buildroot}%{_datadir}/doc/%{name}/


%check
%if %{with tests}
: Run test suite
%ctest
%else
: Skip test suite
%endif


%files tools
%{_bindir}/mem*
%{_mandir}/man1/mem*

%files
%license LICENSE
%{_libdir}/libhashkit.so.2*
%{_libdir}/libmemcached.so.11*
%{_libdir}/libmemcachedprotocol.so.0*
%{_libdir}/libmemcachedutil.so.2*

%files devel
%doc example
%doc *.md
%doc AUTHORS
%doc support/example.cnf
%{_includedir}/libmemcached
%{_includedir}/libmemcached-1.0
%{_includedir}/libhashkit
%{_includedir}/libhashkit-1.0
%{_includedir}/libmemcachedprotocol-0.0
%{_includedir}/libmemcachedutil-1.0
%{_libdir}/libhashkit.so
%{_libdir}/libmemcached.so
%{_libdir}/libmemcachedprotocol.so
%{_libdir}/libmemcachedutil.so
%{_libdir}/pkgconfig/libmemcached.pc
%{_libdir}/cmake/%{name}
%{_datadir}/aclocal/ax_libmemcached.m4
%{_mandir}/man3/libmemcached*
%{_mandir}/man3/libhashkit*
%{_mandir}/man3/memcached*
%{_mandir}/man3/hashkit*


%changelog
* Fri Jun 25 2021 Remi Collet <remi@remirepo.net> - 1.1.0-2
- remove internal AES implementation and use libcrypto
  https://github.com/awesomized/libmemcached/pull/114
- fix build ussing upstream patch to update catch version

* Thu Jun 24 2021 Remi Collet <remi@remirepo.net> - 1.1.0-1
- Initial RPM from libmemcached-awesome
  from old libmemcached spec file