summaryrefslogtreecommitdiffstats
path: root/libmemcached-last.spec
diff options
context:
space:
mode:
Diffstat (limited to 'libmemcached-last.spec')
-rw-r--r--libmemcached-last.spec139
1 files changed, 69 insertions, 70 deletions
diff --git a/libmemcached-last.spec b/libmemcached-last.spec
index 0c1f03e..7b5caa4 100644
--- a/libmemcached-last.spec
+++ b/libmemcached-last.spec
@@ -3,65 +3,61 @@
#
# Fedora spec file for libmemcached
#
-# Copyright (c) 2009-2019 Remi Collet
+# Copyright (c) 2009-2020 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
# Lot of tests are broken making test suite unusable
-%global with_tests %{?_witht_tests:1}%{!?_with_tests:0}
-%global with_sasl 1
+%bcond_with tests
+
%global libname libmemcached
# libmemcached >= 1.0.16 have soname 11
-%if 0%{?rhel} == 6 || 0%{?rhel} == 7
+%if 0%{?rhel} == 7
%global move_to_opt 1
Name: %{libname}-opt
%global _prefix /opt/%{libname}
%global __arch_install_post /bin/true
%else
-%global move_to_opt 1
+%global move_to_opt 0
Name: %{libname}
%endif
+%global gh_commit e95ca0e7956f0d54b318284167a39aa3fd74c89c
+%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
+%global gh_owner m6w6
+%global gh_project libmemcached
+
+%global upstream_version 1.1.0
+%global upstream_prever beta1
Summary: Client library and command line tools for memcached server
-Version: 1.0.18
-Release: 2%{?dist}
+Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
+Release: 1%{?dist}
License: BSD
-URL: http://libmemcached.org/
-# Original sources:
-# http://launchpad.net/libmemcached/1.0/%%{version}/+download/libmemcached-%%{version}.tar.gz
-# The source tarball must be repackaged to remove the Hsieh hash
-# code, since the license is non-free. When upgrading, download the new
-# source tarball, and run "./strip-hsieh.sh <version>" to produce the
-# "-exhsieh" tarball.
-Source0: %{libname}-%{version}-exhsieh.tar.gz
+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
BuildRequires: gcc
BuildRequires: gcc-c++
-%if %{with_sasl}
-BuildRequires: cyrus-sasl-devel
+%if 0%{?rhel} == 7
+BuildRequires: cmake3 >= 3.9
+%else
+BuildRequires: cmake >= 3.9
%endif
+BuildRequires: cyrus-sasl-devel
BuildRequires: flex
BuildRequires: bison
BuildRequires: python-sphinx
BuildRequires: memcached
BuildRequires: systemtap-sdt-devel
-
-%if 0%{?rhel} == 6
-BuildRequires: libevent2-devel
-%else
BuildRequires: libevent-devel > 2
-%endif
Provides: bundled(bobjenkins-hash)
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
-Patch0: libmemcached-fix-linking-with-libpthread.patch
-# Fix: ISO C++ forbids comparison between pointer and integer [-fpermissive]
-Patch1: %{libname}-build.patch
%description
libmemcached is a C/C++ client library and tools for the memcached server
@@ -90,9 +86,7 @@ memtouch Touches a key
Summary: Header files and development libraries for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: pkgconfig
-%if %{with_sasl}
Requires: cyrus-sasl-devel%{?_isa}
-%endif
%description devel
This package contains the header files and development libraries
@@ -119,55 +113,49 @@ This package is designed to be installed beside %{libname}.
%prep
-%setup -q -n %{libname}-%{version}
-%patch0 -p1 -b .link
-%patch1 -p1 -b .build
-
-mkdir examples
-cp -p tests/*.{cc,h} examples/
+%setup -q -n %{gh_project}-%{gh_commit}
%build
-# option --with-memcached=false to disable server binary check (as we don't run test)
-%configure \
-%if %{with_tests}
- --with-memcached=%{_bindir}/memcached \
+%if 0%{?rhel} == 7
+%cmake3 \
%else
- --with-memcached=false \
+%cmake \
%endif
-%if %{with_sasl}
- --enable-sasl \
+ -DBUILD_TESTING:BOOL=ON \
+ -DBUILD_DOCS_MAN:BOOL=ON \
+ -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 \
+ -S .
+
+%if 0%{?cmake_build:1}
+%cmake_build
%else
- --disable-sasl \
+make %{?_smp_mflags}
%endif
- --enable-libmemcachedprotocol \
- --enable-memaslap \
- --enable-dtrace \
- --disable-static
-
-%if 0%{?fedora} < 14 && 0%{?rhel} < 7
-# for warning: unknown option after '#pragma GCC diagnostic' kind
-sed -e 's/-Werror//' -i Makefile
-%endif
-
-make %{_smp_mflags} V=1
%install
-make install DESTDIR="%{buildroot}" AM_INSTALL_PROGRAM_FLAGS=""
+%if 0%{?cmake_install:1}
+%cmake_install
+%else
+make install DESTDIR=%{buildroot}
+%endif
-# Hack: when sphinx-build too old (fedora < 14 and rhel < 7)
-# install upstream provided man pages
-if [ ! -d %{buildroot}%{_mandir}/man1 ]; then
- install -d %{buildroot}%{_mandir}/man1
- install -p -m 644 man/*1 %{buildroot}%{_mandir}/man1
- install -d %{buildroot}%{_mandir}/man3
- install -p -m 644 man/*3 %{buildroot}%{_mandir}/man3
-fi
+# See https://github.com/m6w6/libmemcached/issues/97
+mkdir -p %{buildroot}%{_libdir}/cmake
+mv %{buildroot}%{_datadir}/libmemcached/cmake %{buildroot}%{_libdir}/cmake/libmemcached
+mv %{buildroot}%{_datadir}/libmemcached/example.cnf support
+
+rm -r %{buildroot}%{_datadir}/doc/libmemcached/
%check
-%if %{with_tests}
+%if %{with tests}
: Run test suite
make test
%else
@@ -187,13 +175,12 @@ make test
%dir %{_mandir}/man1
%endif
%{_bindir}/mem*
-%exclude %{_libdir}/lib*.la
%{_mandir}/man1/mem*
%files libs
%{!?_licensedir:%global license %%doc}
-%doc AUTHORS README THANKS TODO ChangeLog
-%license COPYING
+%doc ChangeLog-*.md
+%license LICENSE
%if %{move_to_opt}
%dir %{_prefix}
%dir %{_datadir}
@@ -206,24 +193,28 @@ make test
%{_libdir}/libmemcachedutil.so.2*
%files devel
-%doc examples
+%doc example
+%doc BUGS.md CONTRIBUTING.md README.md
+%doc support/example.cnf
%if %{move_to_opt}
%dir %{_includedir}
%dir %{_datadir}/aclocal
%dir %{_mandir}/man3
%dir %{_libdir}/pkgconfig
+%dir %{_libdir}/cmake
%endif
%{_includedir}/libmemcached
-%{_includedir}/libmemcached-1.0
+%{_includedir}/libmemcached-1*
%{_includedir}/libhashkit
-%{_includedir}/libhashkit-1.0
-%{_includedir}/libmemcachedprotocol-0.0
-%{_includedir}/libmemcachedutil-1.0
+%{_includedir}/libhashkit-1*
+%{_includedir}/libmemcachedprotocol-0*
+%{_includedir}/libmemcachedutil-1*
%{_libdir}/libhashkit.so
%{_libdir}/libmemcached.so
%{_libdir}/libmemcachedprotocol.so
%{_libdir}/libmemcachedutil.so
%{_libdir}/pkgconfig/libmemcached.pc
+%{_libdir}/cmake/libmemcached
%{_datadir}/aclocal/ax_libmemcached.m4
%{_mandir}/man3/libmemcached*
%{_mandir}/man3/libhashkit*
@@ -231,6 +222,14 @@ make test
%{_mandir}/man3/hashkit*
%changelog
+* Tue Dec 22 2020 Remi Collet <remi@remirepo.net> - 1.1.0~beta1-1
+- update to 1.1.0-beta1
+- sources from https://github.com/m6w6/libmemcached
+- open https://github.com/m6w6/libmemcached/issues/97 cmake files path
+- open https://github.com/m6w6/libmemcached/issues/98 soname
+- open https://github.com/m6w6/libmemcached/issues/99 build warning
+- open https://github.com/m6w6/libmemcached/issues/100 headers path
+
* Fri Jan 11 2019 Remi Collet <remi@remirepo.net> - 1.0.18-2
- improve dependency filtering