diff --git a/libmemcached-1.0.18.tar.gz b/libmemcached-1.0.18.tar.gz new file mode 100644 index 0000000..a45d1b6 Binary files /dev/null and b/libmemcached-1.0.18.tar.gz differ diff --git a/libmemcached-build.patch b/libmemcached-build.patch new file mode 100644 index 0000000..df58c9f --- /dev/null +++ b/libmemcached-build.patch @@ -0,0 +1,21 @@ +diff -up ./clients/memflush.cc.old ./clients/memflush.cc +--- ./clients/memflush.cc.old 2017-02-12 10:12:59.615209225 +0100 ++++ ./clients/memflush.cc 2017-02-12 10:13:39.998382783 +0100 +@@ -39,7 +39,7 @@ int main(int argc, char *argv[]) + { + options_parse(argc, argv); + +- if (opt_servers == false) ++ if (!opt_servers) + { + char *temp; + +@@ -48,7 +48,7 @@ int main(int argc, char *argv[]) + opt_servers= strdup(temp); + } + +- if (opt_servers == false) ++ if (!opt_servers) + { + std::cerr << "No Servers provided" << std::endl; + exit(EXIT_FAILURE); diff --git a/libmemcached-fix-linking-with-libpthread.patch b/libmemcached-fix-linking-with-libpthread.patch new file mode 100644 index 0000000..e5e21c4 --- /dev/null +++ b/libmemcached-fix-linking-with-libpthread.patch @@ -0,0 +1,19 @@ +diff -up libmemcached-1.0.16/build-aux/ltmain.sh.orig libmemcached-1.0.16/build-aux/ltmain.sh +--- libmemcached-1.0.16/build-aux/ltmain.sh.orig 2013-12-03 16:36:53.222107642 +0100 ++++ libmemcached-1.0.16/build-aux/ltmain.sh 2013-12-03 16:37:35.770132249 +0100 +@@ -5664,6 +5664,15 @@ func_mode_link () + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac ++ # As we are forced to pass -nostdlib to g++ during linking, the option ++ # -pthread{,s} is not in effect; add the -lpthread to $deplist ++ # explicitly to link correctly. ++ if test "$tagname" = CXX -a x"$with_gcc" = xyes; then ++ case "$arg" in ++ -pthread*) func_append deplibs " -lpthread" ;; ++ esac ++ fi ++ + continue + ;; + diff --git a/libmemcached.spec b/libmemcached.spec new file mode 100644 index 0000000..cea8410 --- /dev/null +++ b/libmemcached.spec @@ -0,0 +1,102 @@ +Name: libmemcached +Summary: Client library and command line tools for memcached server +Version: 1.0.18 +Release: 16 +License: BSD +URL: http://libmemcached.org/ +#origin source:https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz +#remove hsieh.cc which license of it is not free +Source0: libmemcached-1.0.18.tar.gz + +BuildRequires: gcc-c++ cyrus-sasl-devel flex bison python-sphinx memcached +BuildRequires: systemtap-sdt-devel libevent-devel + +Provides: bundled(bobjenkins-hash) +Provides: libmemcached-libs +Obsoletes: libmemcached-libs < %{version}-%{release} + +#Patch0001: libmemcached-fix-linking-with-libpthread.patch +Patch0002: libmemcached-build.patch + + +%description +Memcached is an in-memory key-value store for small arbitrary data +(strings, objects) from results of database calls, API calls, or +page rendering. libmemcached is a C/C++ client library and tools +for the memcached server (http://memcached.org/). + +%package devel +Summary: Header files and development libraries for libmemcached +Requires: libmemcached = %{version}-%{release} +Requires: pkgconfig cyrus-sasl-devel + +%description devel +This package contains the header files and development libraries +for libmemcached. If you like to develop programs using libmemcached, +you will need to install libmemcached-devel. + +%package help +Summary: Help document for the libmemcached package +Buildarch: noarch + +%description help +Help document for the libmemcached package. + +%prep +%autosetup -n libmemcached-%{version} -p1 + +mkdir examples +cp -p tests/*.{cc,h} examples/ + +%build +%configure \ + --with-memcached=%{_bindir}/memcached \ + --enable-sasl --enable-libmemcachedprotocol \ + --enable-memaslap --enable-dtrace --disable-static + +%make_build V=1 + + +%install +%make_install + +if [ ! -d %{buildroot}%{_mandir}/man1 ]; then + install -D -p -m 644 man/*1 %{buildroot}%{_mandir}/man1 + install -D -p -m 644 man/*3 %{buildroot}%{_mandir}/man3 +fi + + +%check +%if %{?_with_tests:1}%{!?_with_check:0} +make test +%endif + +%files +%{_bindir}/mem* +%exclude %{_libdir}/lib*.la +%doc COPYING COPYING AUTHORS README THANKS TODO ChangeLog +%{_libdir}/libhashkit.so.2* +%{_libdir}/libmemcached.so.11* +%{_libdir}/libmemcachedprotocol.so.0* +%{_libdir}/libmemcachedutil.so.2* + +%files devel +%doc examples +%{_includedir}/libmemcached +%{_includedir}/libmemcached*.0 +%{_includedir}/libhashkit*/ +%{_libdir}/libhashkit.so +%{_libdir}/libmemcached*.so +%{_libdir}/pkgconfig/libmemcached.pc +%{_datadir}/aclocal/ax_libmemcached.m4 + +%files help +%{_mandir}/man1/mem* +%{_mandir}/man3/libmemcached* +%{_mandir}/man3/libhashkit* +%{_mandir}/man3/memcached* +%{_mandir}/man3/hashkit* + +%changelog +* Fri Feb 28 2020 zhouyihang - 1.0.18-16 +- Package init