From d9c7ab29f5651da244cac393f446a6c5e823fcd1 Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Mon, 15 Feb 2010 15:50:09 -0800 Subject: [PATCH] Reorganizing kvstore sources and switching build system to CMake. --- kvstore/CMakeLists.txt | 15 +++++++++ kvstore/backend.cc | 8 ++--- kvstore/debian/README.Debian | 6 ---- kvstore/debian/README.source | 9 ----- kvstore/debian/changelog | 37 -------------------- kvstore/debian/compat | 1 - kvstore/debian/control | 13 ------- kvstore/debian/copyright | 35 ------------------- kvstore/debian/docs | 1 - kvstore/debian/install | 1 - kvstore/debian/rules | 43 ------------------------ kvstore/{protobufrpc => }/protobufrpc.cc | 0 kvstore/{protobufrpc => }/protobufrpc.h | 0 kvstore/protobufrpc/SConscript | 7 ---- kvstore/protobufrpc/SConstruct | 29 ---------------- kvstore/{protobufrpc => }/socket_pool.cc | 0 kvstore/{protobufrpc => }/socket_pool.h | 0 kvstore/{protobufrpc => }/util.h | 0 kvstore/{protobufrpc => }/workqueue.cc | 0 kvstore/{protobufrpc => }/workqueue.h | 0 20 files changed, 19 insertions(+), 186 deletions(-) create mode 100644 kvstore/CMakeLists.txt delete mode 100644 kvstore/debian/README.Debian delete mode 100644 kvstore/debian/README.source delete mode 100644 kvstore/debian/changelog delete mode 100644 kvstore/debian/compat delete mode 100644 kvstore/debian/control delete mode 100644 kvstore/debian/copyright delete mode 100644 kvstore/debian/docs delete mode 100644 kvstore/debian/install delete mode 100755 kvstore/debian/rules rename kvstore/{protobufrpc => }/protobufrpc.cc (100%) rename kvstore/{protobufrpc => }/protobufrpc.h (100%) delete mode 100644 kvstore/protobufrpc/SConscript delete mode 100644 kvstore/protobufrpc/SConstruct rename kvstore/{protobufrpc => }/socket_pool.cc (100%) rename kvstore/{protobufrpc => }/socket_pool.h (100%) rename kvstore/{protobufrpc => }/util.h (100%) rename kvstore/{protobufrpc => }/workqueue.cc (100%) rename kvstore/{protobufrpc => }/workqueue.h (100%) diff --git a/kvstore/CMakeLists.txt b/kvstore/CMakeLists.txt new file mode 100644 index 0000000..4d7edad --- /dev/null +++ b/kvstore/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 2.6) + +add_custom_command(OUTPUT kvstore.pb.cc kvstore.pb.h + COMMAND protoc --cpp_out=. kvstore.proto + DEPENDS kvstore.proto) + +add_library(protobufrpc protobufrpc.cc socket_pool.cc workqueue.cc) +add_library(kvservice kvservice.cc kvstore.pb.cc backend.cc) +add_library(kvclient kvclient.cc) +add_executable(kvstore kvstore.cc) + +target_link_libraries(kvstore + kvservice + boost_thread-mt boost_regex-mt boost_system-mt + boost_program_options-mt db protobuf protobufrpc pthread) diff --git a/kvstore/backend.cc b/kvstore/backend.cc index d97c492..04a6764 100644 --- a/kvstore/backend.cc +++ b/kvstore/backend.cc @@ -91,22 +91,22 @@ public: if (log_in_memory) { - res = _dbenv->set_flags(_dbenv, DB_LOG_INMEMORY, 1); + res = _dbenv->set_flags(_dbenv, DB_LOG_IN_MEMORY, 1); if (res != 0) { cerr << db_strerror(res) << endl; - throw std::runtime_error("BDB ENV DB_LOG_INMEMORY"); + throw std::runtime_error("BDB ENV DB_LOG_IN_MEMORY"); } } - res = _dbenv->set_flags(_dbenv, DB_LOG_AUTOREMOVE, 1); + res = _dbenv->set_flags(_dbenv, DB_LOG_AUTO_REMOVE, 1); if (res != 0) { cerr << db_strerror(res) << endl; - throw std::runtime_error("BDB ENV DB_LOG_AUTOREMOVE"); + throw std::runtime_error("BDB ENV DB_LOG_AUTO_REMOVE"); } res = _dbenv->open(_dbenv, diff --git a/kvstore/debian/README.Debian b/kvstore/debian/README.Debian deleted file mode 100644 index 0cc3a58..0000000 --- a/kvstore/debian/README.Debian +++ /dev/null @@ -1,6 +0,0 @@ -bicker-fcgi for Debian ----------------------- - - - - -- John McCullough Tue, 29 Sep 2009 13:29:18 -0700 diff --git a/kvstore/debian/README.source b/kvstore/debian/README.source deleted file mode 100644 index a7e4671..0000000 --- a/kvstore/debian/README.source +++ /dev/null @@ -1,9 +0,0 @@ -bicker-fcgi for Debian ----------------------- - - - - - - diff --git a/kvstore/debian/changelog b/kvstore/debian/changelog deleted file mode 100644 index be2e2de..0000000 --- a/kvstore/debian/changelog +++ /dev/null @@ -1,37 +0,0 @@ -kvstore (0.1-7) unstable; urgency=low - - * Reduced memory copying in protobuf, support for multiple data - targets - - -- John McCullough Thu, 21 Jan 2010 11:10:45 -0800 - -kvstore (0.1-6) unstable; urgency=low - - * Improved RPC Layer - - -- John McCullough Thu, 24 Dec 2009 14:25:41 -0800 - -kvstore (0.1-5) unstable; urgency=low - - * KeyValue -> KVStore rename. - * Fixed Dependencies - - -- John McCullough Sun, 29 Nov 2009 16:17:23 -0800 - -kvstore (0.1-3) unstable; urgency=low - - * More Packaging Fun - - -- John McCullough Sun, 29 Nov 2009 15:34:41 -0800 - -kvstore (0.1-2) unstable; urgency=low - - * Incremented boost version to .0 - - -- John McCullough Sun, 29 Nov 2009 15:32:01 -0800 - -kvstore (0.1-1) unstable; urgency=low - - * Initial release (Closes: #nnnn) - - -- John McCullough Tue, 29 Sep 2009 13:29:18 -0700 diff --git a/kvstore/debian/compat b/kvstore/debian/compat deleted file mode 100644 index 7f8f011..0000000 --- a/kvstore/debian/compat +++ /dev/null @@ -1 +0,0 @@ -7 diff --git a/kvstore/debian/control b/kvstore/debian/control deleted file mode 100644 index 748f726..0000000 --- a/kvstore/debian/control +++ /dev/null @@ -1,13 +0,0 @@ -Source: kvstore -Section: unknown -Priority: extra -Maintainer: John McCullough -Build-Depends: debhelper (>= 7), libboost-thread1.35-dev, libboost-system1.35-dev, libboost1.35-dev, libasio-dev, protobuf-compiler, libprotobuf-dev, libdb4.6-dev, libgtest-dev -Standards-Version: 3.8.3, -Homepage: - -Package: kvstore -Architecture: any -Depends: ${misc:Depends}, libboost-thread1.35.0, libboost-regex1.35.0, libboost-program-options1.35.0, libboost-system1.35.0, libprotobuf4, libdb4.6, libgtest0 -Description: Homebrew key value store - diff --git a/kvstore/debian/copyright b/kvstore/debian/copyright deleted file mode 100644 index c356a24..0000000 --- a/kvstore/debian/copyright +++ /dev/null @@ -1,35 +0,0 @@ -This work was packaged for Debian by: - - John McCullough on Tue, 29 Sep 2009 13:29:18 -0700 - -It was downloaded from - -Upstream Author(s): - - - - -Copyright: - - - - -License: - - - -The Debian packaging is: - - Copyright (C) 2009 John McCullough - -# Please chose a license for your packaging work. If the program you package -# uses a mainstream license, using the same license is the safest choice. -# Please avoid to pick license terms that are more restrictive than the -# packaged work, as it may make Debian's contributions unacceptable upstream. -# If you just want it to be GPL version 3, leave the following lines in. - -and is licensed under the GPL version 3, -see `/usr/share/common-licenses/GPL-3'. - -# Please also look if there are files or directories which have a -# different copyright/license attached and list them here. diff --git a/kvstore/debian/docs b/kvstore/debian/docs deleted file mode 100644 index e845566..0000000 --- a/kvstore/debian/docs +++ /dev/null @@ -1 +0,0 @@ -README diff --git a/kvstore/debian/install b/kvstore/debian/install deleted file mode 100644 index c110135..0000000 --- a/kvstore/debian/install +++ /dev/null @@ -1 +0,0 @@ -usr/bin/kvstore diff --git a/kvstore/debian/rules b/kvstore/debian/rules deleted file mode 100755 index a47c8e4..0000000 --- a/kvstore/debian/rules +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 -build: - dh_testdir - scons - -install: build - dh_testdir - dh_testroot - dh_prep - dh_installdirs - scons --prefix=$(CURDIR)/debian/tmp install - -clean: - scons -c - dh_clean - -binary-arch: install - dh_testdir - dh_testroot - dh_installchangelogs - dh_install - dh_link - #dh_strip - dh_compress - dh_fixperms - dh_installdeb - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-arch - -%: - dh $@ diff --git a/kvstore/protobufrpc/protobufrpc.cc b/kvstore/protobufrpc.cc similarity index 100% rename from kvstore/protobufrpc/protobufrpc.cc rename to kvstore/protobufrpc.cc diff --git a/kvstore/protobufrpc/protobufrpc.h b/kvstore/protobufrpc.h similarity index 100% rename from kvstore/protobufrpc/protobufrpc.h rename to kvstore/protobufrpc.h diff --git a/kvstore/protobufrpc/SConscript b/kvstore/protobufrpc/SConscript deleted file mode 100644 index b972f84..0000000 --- a/kvstore/protobufrpc/SConscript +++ /dev/null @@ -1,7 +0,0 @@ -Import('env') - -base_files = ['protobufrpc.cc', 'socket_pool.cc', 'workqueue.cc'] - -protobufrpc = env.StaticLibrary('protobufrpc', base_files) - -Return('protobufrpc') diff --git a/kvstore/protobufrpc/SConstruct b/kvstore/protobufrpc/SConstruct deleted file mode 100644 index 79fbb68..0000000 --- a/kvstore/protobufrpc/SConstruct +++ /dev/null @@ -1,29 +0,0 @@ -import os - -AddOption('--prefix', - dest='prefix', - type='string', - nargs=1, - action='store', - metavar='DIR', - help='installation prefix') - -env = Environment(CXXFLAGS='-g -fPIC', PREFIX=GetOption('prefix')) - -for envvar in ('HOME', 'DISTCC_DIR', 'DISTCC_HOSTS', 'CCACHE_DIR', - 'INTERCEPTOR_SOCKET', 'ENFORGE_DIGEST_CACHE', - 'ENFORGE_CACHE_HOST', 'ENFORGE_CACHE_PORT'): - if envvar in os.environ: - env['ENV'][envvar] = os.environ[envvar] - -if env['PREFIX'] is not None: - bin_dest = env['PREFIX'] + '/usr/bin' -else: - bin_dest = '/usr/bin' - -base_files = ['protobufrpc.cc', 'socket_pool.cc'] - -if not env.has_key('LIBS'): - env['LIBS'] = [] - -SConscript(['SConscript']) diff --git a/kvstore/protobufrpc/socket_pool.cc b/kvstore/socket_pool.cc similarity index 100% rename from kvstore/protobufrpc/socket_pool.cc rename to kvstore/socket_pool.cc diff --git a/kvstore/protobufrpc/socket_pool.h b/kvstore/socket_pool.h similarity index 100% rename from kvstore/protobufrpc/socket_pool.h rename to kvstore/socket_pool.h diff --git a/kvstore/protobufrpc/util.h b/kvstore/util.h similarity index 100% rename from kvstore/protobufrpc/util.h rename to kvstore/util.h diff --git a/kvstore/protobufrpc/workqueue.cc b/kvstore/workqueue.cc similarity index 100% rename from kvstore/protobufrpc/workqueue.cc rename to kvstore/workqueue.cc diff --git a/kvstore/protobufrpc/workqueue.h b/kvstore/workqueue.h similarity index 100% rename from kvstore/protobufrpc/workqueue.h rename to kvstore/workqueue.h -- 2.20.1