diff -Nru hiredis-0.11.0/debian/changelog hiredis-0.11.0/debian/changelog --- hiredis-0.11.0/debian/changelog 2013-08-11 18:55:09.000000000 +0000 +++ hiredis-0.11.0/debian/changelog 2014-10-28 07:55:37.000000000 +0000 @@ -1,3 +1,36 @@ +hiredis (0.11.0-3+syseleven5) trusty; urgency=medium + + * Add build dependency for libtbb-dev + + -- Martin Loschwitz Tue, 28 Oct 2014 07:55:22 +0000 + +hiredis (0.11.0-3+syseleven4) trusty; urgency=medium + + * Add Build dependency for libboost1.54-dev + + -- Martin Loschwitz Tue, 28 Oct 2014 07:52:01 +0000 + +hiredis (0.11.0-3+syseleven3) trusty; urgency=medium + + * Use proper include paths in boostasio.hpp for Hiredis includes + + -- Martin Loschwitz Tue, 28 Oct 2014 07:48:19 +0000 + +hiredis (0.11.0-3+syseleven2) trusty; urgency=medium + + * Include base64.cpp and base64.h supplied by Contrail (via SCons) + * Include boostasio in this build to remove the need for a separete + package + + -- Martin Loschwitz Tue, 28 Oct 2014 07:40:31 +0000 + +hiredis (0.11.0-3+syseleven1) trusty; urgency=medium + + * debian/patches/hiredis-opencontrail.patch: Add a patch ho Hiredis required + by OpenContrail + + -- Martin Loschwitz Mon, 27 Oct 2014 07:33:19 +0000 + hiredis (0.11.0-3) unstable; urgency=low * Fix incorrect --cflags & --libs in pkg-config file (closes: #717611) diff -Nru hiredis-0.11.0/debian/control hiredis-0.11.0/debian/control --- hiredis-0.11.0/debian/control 2013-08-11 18:55:09.000000000 +0000 +++ hiredis-0.11.0/debian/control 2014-10-28 07:55:21.000000000 +0000 @@ -3,7 +3,9 @@ Maintainer: Tom Lee Build-Depends: debhelper (>= 9), redis-server (>= 2:2.4.2-2) [linux-any], - procps + procps, + libboost1.54-dev, + libtbb-dev Standards-Version: 3.9.4 Section: libs Homepage: https://github.com/redis/hiredis diff -Nru hiredis-0.11.0/debian/patches/hiredis-contrail2.patch hiredis-0.11.0/debian/patches/hiredis-contrail2.patch --- hiredis-0.11.0/debian/patches/hiredis-contrail2.patch 1970-01-01 00:00:00.000000000 +0000 +++ hiredis-0.11.0/debian/patches/hiredis-contrail2.patch 2014-10-28 07:45:14.000000000 +0000 @@ -0,0 +1,406 @@ +diff -ruN hiredis-0.11.0.old/base64.cpp hiredis-0.11.0/base64.cpp +--- hiredis-0.11.0.old/base64.cpp 1970-01-01 00:00:00.000000000 +0000 ++++ hiredis-0.11.0/base64.cpp 2014-10-24 08:18:43.485474121 +0000 +@@ -0,0 +1,123 @@ ++/* ++ base64.cpp and base64.h ++ ++ Copyright (C) 2004-2008 René Nyffenegger ++ ++ This source code is provided 'as-is', without any express or implied ++ warranty. In no event will the author be held liable for any damages ++ arising from the use of this software. ++ ++ Permission is granted to anyone to use this software for any purpose, ++ including commercial applications, and to alter it and redistribute it ++ freely, subject to the following restrictions: ++ ++ 1. The origin of this source code must not be misrepresented; you must not ++ claim that you wrote the original source code. If you use this source code ++ in a product, an acknowledgment in the product documentation would be ++ appreciated but is not required. ++ ++ 2. Altered source versions must be plainly marked as such, and must not be ++ misrepresented as being the original source code. ++ ++ 3. This notice may not be removed or altered from any source distribution. ++ ++ René Nyffenegger rene.nyffenegger@adp-gmbh.ch ++ ++*/ ++ ++#include "base64.h" ++#include ++ ++static const std::string base64_chars = ++ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ++ "abcdefghijklmnopqrstuvwxyz" ++ "0123456789+/"; ++ ++ ++static inline bool is_base64(unsigned char c) { ++ return (isalnum(c) || (c == '+') || (c == '/')); ++} ++ ++std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) { ++ std::string ret; ++ int i = 0; ++ int j = 0; ++ unsigned char char_array_3[3]; ++ unsigned char char_array_4[4]; ++ ++ while (in_len--) { ++ char_array_3[i++] = *(bytes_to_encode++); ++ if (i == 3) { ++ char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; ++ char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); ++ char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); ++ char_array_4[3] = char_array_3[2] & 0x3f; ++ ++ for(i = 0; (i <4) ; i++) ++ ret += base64_chars[char_array_4[i]]; ++ i = 0; ++ } ++ } ++ ++ if (i) ++ { ++ for(j = i; j < 3; j++) ++ char_array_3[j] = '\0'; ++ ++ char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; ++ char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); ++ char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); ++ char_array_4[3] = char_array_3[2] & 0x3f; ++ ++ for (j = 0; (j < i + 1); j++) ++ ret += base64_chars[char_array_4[j]]; ++ ++ while((i++ < 3)) ++ ret += '='; ++ ++ } ++ ++ return ret; ++ ++} ++ ++std::string base64_decode(std::string const& encoded_string) { ++ int in_len = encoded_string.size(); ++ int i = 0; ++ int j = 0; ++ int in_ = 0; ++ unsigned char char_array_4[4], char_array_3[3]; ++ std::string ret; ++ ++ while (in_len-- && ( encoded_string[in_] != '=') && is_base64(encoded_string[in_])) { ++ char_array_4[i++] = encoded_string[in_]; in_++; ++ if (i ==4) { ++ for (i = 0; i <4; i++) ++ char_array_4[i] = base64_chars.find(char_array_4[i]); ++ ++ char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); ++ char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); ++ char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; ++ ++ for (i = 0; (i < 3); i++) ++ ret += char_array_3[i]; ++ i = 0; ++ } ++ } ++ ++ if (i) { ++ for (j = i; j <4; j++) ++ char_array_4[j] = 0; ++ ++ for (j = 0; j <4; j++) ++ char_array_4[j] = base64_chars.find(char_array_4[j]); ++ ++ char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); ++ char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); ++ char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; ++ ++ for (j = 0; (j < i - 1); j++) ret += char_array_3[j]; ++ } ++ ++ return ret; ++} +\ No newline at end of file +diff -ruN hiredis-0.11.0.old/base64.h hiredis-0.11.0/base64.h +--- hiredis-0.11.0.old/base64.h 1970-01-01 00:00:00.000000000 +0000 ++++ hiredis-0.11.0/base64.h 2014-10-24 08:18:43.485474121 +0000 +@@ -0,0 +1,7 @@ ++#ifndef __BASE64_H__ ++#define __BASE64_H__ ++#include ++ ++std::string base64_encode(unsigned char const* , unsigned int len); ++std::string base64_decode(std::string const& s); ++#endif +\ No newline at end of file +diff -ruN hiredis-0.11.0.old/boostasio.cpp hiredis-0.11.0/boostasio.cpp +--- hiredis-0.11.0.old/boostasio.cpp 1970-01-01 00:00:00.000000000 +0000 ++++ hiredis-0.11.0/boostasio.cpp 2014-10-27 15:11:45.000000000 +0000 +@@ -0,0 +1,152 @@ ++#include "boostasio.hpp" ++ ++#include ++ ++ ++redisBoostClient::redisBoostClient(boost::asio::io_service& io_service, ++ redisAsyncContext *ac, tbb::mutex& mtex) ++: socket_(io_service), mtex_(mtex), read_requested_(false), write_requested_(false), read_in_progress_(false), write_in_progress_(false), cleanup_(false) ++{ ++ ++ /*this gives us access to c->fd*/ ++ redisContext *c = &(ac->c); ++ ++ /*pass this to hiredis hooks*/ ++ context_ = ac; ++ ++ /*hiredis already connected ++ *use the existing native socket ++ */ ++ socket_.assign(boost::asio::ip::tcp::v4(),c->fd); ++ ++ /*register hooks with the hiredis async context*/ ++ ac->ev.addRead = call_C_addRead; ++ ac->ev.delRead = call_C_delRead; ++ ac->ev.addWrite = call_C_addWrite; ++ ac->ev.delWrite = call_C_delWrite; ++ ac->ev.cleanup = call_C_cleanup; ++ ++ /*I don't know whether this even gets used, but...*/ ++ ac->ev.data = ac; ++ ++ /*C wrapper functions will use this ++ *pointer to call class members. ++ *fortunately hiredis doesn't use the data field. ++ *see line 70 of async.h ++ */ ++ ac->data = this; ++} ++ ++void redisBoostClient::operate() ++{ ++ if(read_requested_ && !read_in_progress_) { ++ read_in_progress_ = true; ++ socket_.async_read_some(boost::asio::null_buffers(), ++ boost::bind(&redisBoostClient::handle_read,shared_from_this(),boost::asio::placeholders::error)); ++ } ++ ++ if(write_requested_ && !write_in_progress_) { ++ write_in_progress_ = true; ++ socket_.async_write_some(boost::asio::null_buffers(), ++ boost::bind(&redisBoostClient::handle_write,shared_from_this(),boost::asio::placeholders::error)); ++ } ++} ++ ++void redisBoostClient::handle_read(boost::system::error_code ec) ++{ ++ if (cleanup_) return; ++ ++ tbb::mutex::scoped_lock lock(mtex_); ++ read_in_progress_ = false; ++ if(!ec) { ++ redisAsyncHandleRead(context_); ++ } ++ ++ if (!ec || ec == boost::asio::error::would_block) ++ operate(); ++} ++ ++void redisBoostClient::handle_write(boost::system::error_code ec) ++{ ++ if (cleanup_) return; ++ ++ tbb::mutex::scoped_lock lock(mtex_); ++ write_in_progress_ = false; ++ if(!ec) { ++ redisAsyncHandleWrite(context_); ++ } ++ ++ if (!ec || ec == boost::asio::error::would_block) ++ operate(); ++} ++ ++void redisBoostClient::add_read(void *privdata) ++{ ++ read_requested_ = true; ++ operate(); ++} ++ ++void redisBoostClient::del_read(void *privdata) ++{ ++ read_requested_ = false; ++} ++ ++void redisBoostClient::add_write(void *privdata) ++{ ++ write_requested_ = true; ++ operate(); ++} ++ ++void redisBoostClient::del_write(void *privdata) ++{ ++ write_requested_ = false; ++} ++ ++void redisBoostClient::cleanup(void *privdata) ++{ ++ /*Do I even need this?*/ ++ read_requested_ = false; ++ write_requested_ = false; ++ read_in_progress_ = false; ++ write_in_progress_ = false; ++ cleanup_ = true; ++} ++ ++/*wrappers*/ ++extern "C" void call_C_addRead(void *privdata) ++{ ++ redisAsyncContext *ac = (redisAsyncContext*)privdata; ++ redisBoostClient *C = (redisBoostClient*)ac->data; ++ C->add_read(privdata); ++} ++ ++extern "C" void call_C_delRead(void *privdata) ++{ ++ redisAsyncContext *ac = (redisAsyncContext*)privdata; ++ redisBoostClient *C = (redisBoostClient*)ac->data; ++ C->del_read(privdata); ++} ++ ++extern "C" void call_C_addWrite(void *privdata) ++{ ++ redisAsyncContext *ac = (redisAsyncContext*)privdata; ++ redisBoostClient *C = (redisBoostClient*)ac->data; ++ C->add_write(privdata); ++} ++ ++extern "C" void call_C_delWrite(void *privdata) ++{ ++ redisAsyncContext *ac = (redisAsyncContext*)privdata; ++ redisBoostClient *C = (redisBoostClient*)ac->data; ++ C->del_write(privdata); ++} ++ ++extern "C" void call_C_cleanup(void *privdata) ++{ ++ redisAsyncContext *ac = (redisAsyncContext*)privdata; ++ redisBoostClient *C = (redisBoostClient*)ac->data; ++ C->cleanup(privdata); ++} ++/*end of wrappers*/ ++ ++ +diff -ruN hiredis-0.11.0.old/boostasio.hpp hiredis-0.11.0/boostasio.hpp +--- hiredis-0.11.0.old/boostasio.hpp 1970-01-01 00:00:00.000000000 +0000 ++++ hiredis-0.11.0/boostasio.hpp 2014-10-28 07:45:02.914789402 +0000 +@@ -0,0 +1,58 @@ ++#ifndef __HIREDIS_BOOSTASIO_H__ ++#define __HIREDIS_BOOSTASIO_H__ ++ ++#include "hiredis.h" ++#include "async.h" ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++ ++using boost::asio::ip::tcp; ++ ++class redisBoostClient : public boost::enable_shared_from_this ++{ ++public: ++ redisBoostClient(boost::asio::io_service& io_service, ++ redisAsyncContext *ac, ++ tbb::mutex &mtex); ++ ++ void operate(); ++ ++ void handle_read(boost::system::error_code ec); ++ void handle_write(boost::system::error_code ec); ++ void add_read(void *privdata); ++ void del_read(void *privdata); ++ void add_write(void *privdata); ++ void del_write(void *privdata); ++ void cleanup(void *privdata); ++ ++private: ++boost::asio::ip::tcp::socket socket_; ++tbb::mutex &mtex_; ++redisAsyncContext *context_; ++bool read_requested_; ++bool write_requested_; ++bool read_in_progress_; ++bool write_in_progress_; ++bool cleanup_; ++}; ++ ++ ++/*C wrappers for class member functions*/ ++extern "C" void call_C_addRead(void *privdata); ++extern "C" void call_C_delRead(void *privdata); ++extern "C" void call_C_addWrite(void *privdata); ++extern "C" void call_C_delWrite(void *privdata); ++extern "C" void call_C_cleanup(void *privdata); ++ ++ ++ ++ ++#endif /*__HIREDIS_BOOSTASIO_H__*/ +diff -ruN hiredis-0.11.0.old/Makefile hiredis-0.11.0/Makefile +--- hiredis-0.11.0.old/Makefile 2014-10-28 07:35:24.000000000 +0000 ++++ hiredis-0.11.0/Makefile 2014-10-28 07:37:44.356278931 +0000 +@@ -3,7 +3,7 @@ + # Copyright (C) 2010-2011 Pieter Noordhuis + # This file is released under the BSD license, see the COPYING file + +-OBJ=net.o hiredis.o sds.o async.o ++OBJ=net.o hiredis.o sds.o async.o base64.o boostasio.o + BINS=hiredis-example hiredis-test + LIBNAME=libhiredis + +@@ -16,6 +16,7 @@ + WARNINGS=-Wall -W -Wstrict-prototypes -Wwrite-strings + DEBUG?= -g -ggdb + REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CFLAGS) $(WARNINGS) $(DEBUG) $(ARCH) ++REAL_CXXFLAGS=$(OPTIMIZATION) -fPIC $(CXXFLAGS) $(WARNINGS) $(DEBUG) $(ARCH) + REAL_LDFLAGS=$(LDFLAGS) $(ARCH) + + DYLIBSUFFIX=so +@@ -50,6 +51,8 @@ + hiredis.o: hiredis.c fmacros.h hiredis.h net.h sds.h + sds.o: sds.c sds.h + test.o: test.c hiredis.h ++base64.o: base64.cpp ++boostasio.o: boostasio.cpp + + $(DYLIBNAME): $(OBJ) + $(DYLIB_MAKE_CMD) $(OBJ) +@@ -97,6 +100,9 @@ + .c.o: + $(CC) -std=c99 -pedantic -c $(REAL_CFLAGS) $< + ++.cpp.o: ++ $(CC) -std=c99 -pedantic -c $(REAL_CXXFLAGS) $< ++ + clean: + rm -rf $(DYLIBNAME) $(STLIBNAME) $(BINS) hiredis-example* *.o *.gcda *.gcno *.gcov hiredis.pc + +@@ -132,7 +138,7 @@ + + install: $(DYLIBNAME) $(STLIBNAME) hiredis.pc + mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH) +- $(INSTALL) hiredis.h async.h adapters $(INSTALL_INCLUDE_PATH) ++ $(INSTALL) hiredis.h async.h base64.h boostasio.hpp adapters $(INSTALL_INCLUDE_PATH) + $(INSTALL) $(DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(DYLIB_MINOR_NAME) + cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIB_MAJOR_NAME) + cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MAJOR_NAME) $(DYLIBNAME) diff -Nru hiredis-0.11.0/debian/patches/hiredis-opencontrail.patch hiredis-0.11.0/debian/patches/hiredis-opencontrail.patch --- hiredis-0.11.0/debian/patches/hiredis-opencontrail.patch 1970-01-01 00:00:00.000000000 +0000 +++ hiredis-0.11.0/debian/patches/hiredis-opencontrail.patch 2014-10-27 07:34:42.000000000 +0000 @@ -0,0 +1,12 @@ +diff --git a/third_party/hiredis-0.11.0/net.c b/third_party/hiredis-0.11.0/net.c +index 82ab2b4..f12089f 100755 +--- hiredis-0.11.0/net.c ++++ hiredis-0.11.0/net.c +@@ -137,6 +137,7 @@ static int redisContextWaitReady(redisContext *c, int fd, const struct timeval * + if (timeout != NULL) { + if (timeout->tv_usec > 1000000 || timeout->tv_sec > __MAX_MSEC) { + close(fd); ++ __redisSetError(c,REDIS_ERR_OTHER,"redisContextWaitReady: timeout"); + return REDIS_ERR; + } + diff -Nru hiredis-0.11.0/debian/patches/series hiredis-0.11.0/debian/patches/series --- hiredis-0.11.0/debian/patches/series 2013-08-11 18:55:09.000000000 +0000 +++ hiredis-0.11.0/debian/patches/series 2014-10-28 07:39:08.000000000 +0000 @@ -1,3 +1,5 @@ 01_use-proper-destdir.patch 02_disable-failing-test.patch 03_pkgconfig-cmake.patch +hiredis-opencontrail.patch +hiredis-contrail2.patch