[Bug/Feature] Create libLogger, libSimpleDbus, libConfig packages.
[Cause] N/A
[Solution] N/A
[Verification] Build, install, run tests, run server.
Change-Id: Iab8c507315f6534ffd11e9f664e017ab45d7e94e
Signed-off-by: Dariusz Michaluk <d.michaluk@samsung.com>
## Subdirectories ##############################################################
SET(COMMON_FOLDER ${PROJECT_SOURCE_DIR}/common)
+SET(LIBS_FOLDER ${PROJECT_SOURCE_DIR}/libs)
+SET(LOGGER_FOLDER ${PROJECT_SOURCE_DIR}/libs/logger)
+SET(DBUS_FOLDER ${PROJECT_SOURCE_DIR}/libs/dbus)
+SET(CONFIG_FOLDER ${PROJECT_SOURCE_DIR}/libs/config)
SET(CLIENT_FOLDER ${PROJECT_SOURCE_DIR}/client)
SET(SERVER_FOLDER ${PROJECT_SOURCE_DIR}/server)
SET(ZONE_SUPPORT_FOLDER ${PROJECT_SOURCE_DIR}/zone-support)
SET(VSM_SERVER_IPC_SOCKET_PATH /var/run/vasum-ipc.socket)
SET(VSM_UNIT_TESTS_IPC_SOCKET_PATH /var/run/vasum-ipc-unit-tests.socket)
+ADD_SUBDIRECTORY(${LOGGER_FOLDER})
+ADD_SUBDIRECTORY(${DBUS_FOLDER})
+ADD_SUBDIRECTORY(${CONFIG_FOLDER})
ADD_SUBDIRECTORY(${CLIENT_FOLDER})
ADD_SUBDIRECTORY(${SERVER_FOLDER})
ADD_SUBDIRECTORY(${ZONE_SUPPORT_FOLDER})
MESSAGE(STATUS "")
MESSAGE(STATUS "Generating makefile for the Client...")
FILE(GLOB project_SRCS *.cpp *.hpp *.h)
-FILE(GLOB common_SRCS ${COMMON_FOLDER}/config/*.hpp ${COMMON_FOLDER}/config/*.cpp
- ${COMMON_FOLDER}/config/sqlite3/*.hpp ${COMMON_FOLDER}/config/sqlite3/*.cpp
- ${COMMON_FOLDER}/dbus/*.hpp ${COMMON_FOLDER}/dbus/*.cpp
- ${COMMON_FOLDER}/epoll/*.hpp ${COMMON_FOLDER}/epoll/*.cpp
+FILE(GLOB common_SRCS ${COMMON_FOLDER}/epoll/*.hpp ${COMMON_FOLDER}/epoll/*.cpp
${COMMON_FOLDER}/ipc/*.hpp ${COMMON_FOLDER}/ipc/*.cpp
${COMMON_FOLDER}/ipc/internals/*.hpp ${COMMON_FOLDER}/ipc/internals/*.cpp
- ${COMMON_FOLDER}/logger/*.hpp ${COMMON_FOLDER}/logger/*.cpp
${COMMON_FOLDER}/utils/*.hpp ${COMMON_FOLDER}/utils/*.cpp
${COMMON_FOLDER}/*.hpp ${COMMON_FOLDER}/*.cpp)
VERSION ${_LIB_VERSION_}
COMPILE_DEFINITIONS HOST_IPC_SOCKET="${VSM_SERVER_IPC_SOCKET_PATH}")
-
## Link libraries ##############################################################
FIND_PACKAGE(Boost COMPONENTS system filesystem)
-PKG_CHECK_MODULES(LIB_DEPS REQUIRED gio-2.0 libsystemd-daemon libsystemd-journal libcap-ng sqlite3)
+PKG_CHECK_MODULES(LIB_DEPS REQUIRED gio-2.0 libsystemd-daemon libcap-ng)
INCLUDE_DIRECTORIES(SYSTEM ${LIB_DEPS_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${COMMON_FOLDER})
+INCLUDE_DIRECTORIES(${LIBS_FOLDER})
INCLUDE_DIRECTORIES(${SERVER_FOLDER})
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_DEPS_LIBRARIES} ${Boost_LIBRARIES})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_DEPS_LIBRARIES} ${Boost_LIBRARIES}
+ Config SimpleDbus)
## Generate the pc file ########################################################
CONFIGURE_FILE(${PC_FILE}.in ${CMAKE_BINARY_DIR}/${PC_FILE} @ONLY)
--- /dev/null
+# Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+# @file CMakeLists.txt
+# @author Dariusz Michaluk (d.michaluk@samsung.com)
+#
+
+PROJECT(Config)
+
+MESSAGE(STATUS "")
+MESSAGE(STATUS "Generating makefile for the libConfig...")
+FILE(GLOB HEADERS *.hpp)
+FILE(GLOB HEADERS_SQLITE3 ${CMAKE_CURRENT_BINARY_DIR}/sqlite3/*.hpp)
+FILE(GLOB_RECURSE SRCS *.cpp *.hpp)
+
+SET(_LIB_VERSION_ "0.0.1")
+SET(_LIB_SOVERSION_ "0")
+SET(PC_FILE "lib${PROJECT_NAME}.pc")
+
+## Setup target ################################################################
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
+ SOVERSION ${_LIB_SOVERSION_}
+ VERSION ${_LIB_VERSION_}
+)
+
+## Link libraries ##############################################################
+PKG_CHECK_MODULES(CONFIG_DEPS REQUIRED sqlite3 glib-2.0)
+INCLUDE_DIRECTORIES(${LIBS_FOLDER})
+INCLUDE_DIRECTORIES(SYSTEM ${CONFIG_DEPS_INCLUDE_DIRS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ${CONFIG_DEPS_LIBRARIES})
+
+## Generate the pc file ########################################################
+CONFIGURE_FILE(${PC_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${PC_FILE} @ONLY)
+
+## Install #####################################################################
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PC_FILE}
+ DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+
+INSTALL(TARGETS ${PROJECT_NAME}
+ DESTINATION ${LIB_INSTALL_DIR}
+ COMPONENT RuntimeLibraries)
+
+INSTALL(FILES ${HEADERS}
+ DESTINATION ${INCLUDE_INSTALL_DIR}/vasum-tools/config)
+
+INSTALL(FILES ${HEADERS_SQLITE3}
+ DESTINATION ${INCLUDE_INSTALL_DIR}/vasum-tools/config/sqlite3)
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Lukasz Pawelczyk (l.pawelczyk@partner.samsung.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+/**
+ * @file
+ * @author Lukasz Pawelczyk (l.pawelczyk@partner.samsung.com)
+ * @brief Configuration file for the code
+ */
+
+
+#ifndef COMMON_CONFIG_HPP
+#define COMMON_CONFIG_HPP
+
+
+#ifdef __clang__
+#define CLANG_VERSION (__clang__major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
+#endif // __clang__
+
+#if defined __GNUC__ && !defined __clang__ // clang also defines GCC versions
+#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
+#endif // __GNUC__
+
+
+#ifdef GCC_VERSION
+
+#if GCC_VERSION < 40800
+// GCC 4.8 is the first where those defines are not required for
+// std::this_thread::sleep_for() and ::yield(). They might exist though
+// in previous versions depending on the build configuration of the GCC.
+#ifndef _GLIBCXX_USE_NANOSLEEP
+#define _GLIBCXX_USE_NANOSLEEP
+#endif // _GLIBCXX_USE_NANOSLEEP
+#ifndef _GLIBCXX_USE_SCHED_YIELD
+#define _GLIBCXX_USE_SCHED_YIELD
+#endif // _GLIBCXX_USE_SCHED_YIELD
+#endif // GCC_VERSION < 40800
+
+#if GCC_VERSION < 40700
+// Those appeared in 4.7 with full c++11 support
+#define final
+#define override
+#define thread_local __thread // use GCC extension instead of C++11
+#define steady_clock monotonic_clock
+#endif // GCC_VERSION < 40700
+
+#endif // GCC_VERSION
+
+// Variadic macros support for boost preprocessor should be enabled
+// manually for clang since they are marked as untested feature
+// (boost trunk if fixed but the latest 1.55 version is not,
+// see boost/preprocessor/config/config.hpp)
+#ifdef __clang__
+#define BOOST_PP_VARIADICS 1
+#endif
+
+// This has to be defined always when the boost has not been compiled
+// using C++11. Headers detect that you are compiling using C++11 and
+// blindly and wrongly assume that boost has been as well.
+#ifndef BOOST_NO_CXX11_SCOPED_ENUMS
+#define BOOST_NO_CXX11_SCOPED_ENUMS 1
+#endif
+
+#endif // COMMON_CONFIG_HPP
* @brief Definition of a class for writing and reading data from a file descriptor
*/
-#include "config.hpp"
+#include "config/config.hpp"
#include "config/fdstore.hpp"
#include "config/exception.hpp"
* @brief Definition of a class for key-value storage in a sqlite3 database
*/
-#include "config.hpp"
+#include "config/config.hpp"
#include "config/kvstore.hpp"
#include "config/exception.hpp"
--- /dev/null
+# Package Information for pkg-config
+
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@
+
+Name: libConfig
+Description: Config library
+Version: @_LIB_VERSION_@
+Libs: -L${libdir} -lConfig
+Cflags: -I${includedir}/vasum-tools
--- /dev/null
+# Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+# @file CMakeLists.txt
+# @author Dariusz Michaluk (d.michaluk@samsung.com)
+#
+
+PROJECT(SimpleDbus)
+
+MESSAGE(STATUS "")
+MESSAGE(STATUS "Generating makefile for the libSimpleDbus...")
+FILE(GLOB HEADERS *.hpp)
+FILE(GLOB HEADERS_UTILS ${COMMON_FOLDER}/utils/callback-guard.hpp
+ ${COMMON_FOLDER}/utils/scoped-gerror.hpp
+ ${COMMON_FOLDER}/utils/glib-utils.hpp
+ ${COMMON_FOLDER}/utils/callback-wrapper.hpp)
+FILE(GLOB SRCS_UTILS ${COMMON_FOLDER}/utils/callback-guard.cpp
+ ${COMMON_FOLDER}/utils/scoped-gerror.cpp
+ ${COMMON_FOLDER}/utils/glib-utils.cpp
+ ${COMMON_FOLDER}/utils/callback-wrapper.cpp)
+FILE(GLOB SRCS *.cpp *.hpp)
+
+SET(_LIB_VERSION_ "0.0.1")
+SET(_LIB_SOVERSION_ "0")
+SET(PC_FILE "lib${PROJECT_NAME}.pc")
+
+## Setup target ################################################################
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS} ${SRCS_UTILS})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
+ SOVERSION ${_LIB_SOVERSION_}
+ VERSION ${_LIB_VERSION_}
+)
+
+## Link libraries ##############################################################
+PKG_CHECK_MODULES(DBUS_DEPS REQUIRED glib-2.0 gio-2.0)
+INCLUDE_DIRECTORIES(${COMMON_FOLDER})
+INCLUDE_DIRECTORIES(${LIBS_FOLDER})
+INCLUDE_DIRECTORIES(SYSTEM ${DBUS_DEPS_INCLUDE_DIRS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ${DBUS_DEPS_LIBRARIES} Logger)
+
+## Generate the pc file ########################################################
+CONFIGURE_FILE(${PC_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${PC_FILE} @ONLY)
+
+## Install #####################################################################
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PC_FILE}
+ DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+
+INSTALL(TARGETS ${PROJECT_NAME}
+ DESTINATION ${LIB_INSTALL_DIR}
+ COMPONENT RuntimeLibraries)
+
+INSTALL(FILES ${HEADERS}
+ DESTINATION ${INCLUDE_INSTALL_DIR}/vasum-tools/dbus)
+
+INSTALL(FILES ${HEADERS_UTILS}
+ DESTINATION ${INCLUDE_INSTALL_DIR}/vasum-tools/dbus/utils)
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Lukasz Pawelczyk (l.pawelczyk@partner.samsung.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+/**
+ * @file
+ * @author Lukasz Pawelczyk (l.pawelczyk@partner.samsung.com)
+ * @brief Configuration file for the code
+ */
+
+
+#ifndef COMMON_CONFIG_HPP
+#define COMMON_CONFIG_HPP
+
+
+#ifdef __clang__
+#define CLANG_VERSION (__clang__major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
+#endif // __clang__
+
+#if defined __GNUC__ && !defined __clang__ // clang also defines GCC versions
+#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
+#endif // __GNUC__
+
+
+#ifdef GCC_VERSION
+
+#if GCC_VERSION < 40800
+// GCC 4.8 is the first where those defines are not required for
+// std::this_thread::sleep_for() and ::yield(). They might exist though
+// in previous versions depending on the build configuration of the GCC.
+#ifndef _GLIBCXX_USE_NANOSLEEP
+#define _GLIBCXX_USE_NANOSLEEP
+#endif // _GLIBCXX_USE_NANOSLEEP
+#ifndef _GLIBCXX_USE_SCHED_YIELD
+#define _GLIBCXX_USE_SCHED_YIELD
+#endif // _GLIBCXX_USE_SCHED_YIELD
+#endif // GCC_VERSION < 40800
+
+#if GCC_VERSION < 40700
+// Those appeared in 4.7 with full c++11 support
+#define final
+#define override
+#define thread_local __thread // use GCC extension instead of C++11
+#define steady_clock monotonic_clock
+#endif // GCC_VERSION < 40700
+
+#endif // GCC_VERSION
+
+// Variadic macros support for boost preprocessor should be enabled
+// manually for clang since they are marked as untested feature
+// (boost trunk if fixed but the latest 1.55 version is not,
+// see boost/preprocessor/config/config.hpp)
+#ifdef __clang__
+#define BOOST_PP_VARIADICS 1
+#endif
+
+// This has to be defined always when the boost has not been compiled
+// using C++11. Headers detect that you are compiling using C++11 and
+// blindly and wrongly assume that boost has been as well.
+#ifndef BOOST_NO_CXX11_SCOPED_ENUMS
+#define BOOST_NO_CXX11_SCOPED_ENUMS 1
+#endif
+
+#endif // COMMON_CONFIG_HPP
* @brief Dbus connection class
*/
-#include "config.hpp"
+#include "dbus/config.hpp"
#include "dbus/connection.hpp"
#include "dbus/exception.hpp"
#include "utils/callback-wrapper.hpp"
--- /dev/null
+# Package Information for pkg-config
+
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@
+
+Name: libSimpleDbus
+Description: Simple Dbus library
+Version: @_LIB_VERSION_@
+Libs: -L${libdir} -lSimpleDbus
+Cflags: -I${includedir}/vasum-tools
--- /dev/null
+# Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+# @file CMakeLists.txt
+# @author Dariusz Michaluk (d.michaluk@samsung.com)
+#
+
+PROJECT(Logger)
+
+MESSAGE(STATUS "")
+MESSAGE(STATUS "Generating makefile for the libLogger...")
+FILE(GLOB HEADERS *.hpp)
+FILE(GLOB SRCS *.cpp *.hpp)
+
+SET(_LIB_VERSION_ "0.0.1")
+SET(_LIB_SOVERSION_ "0")
+SET(PC_FILE "lib${PROJECT_NAME}.pc")
+
+## Setup target ################################################################
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
+ SOVERSION ${_LIB_SOVERSION_}
+ VERSION ${_LIB_VERSION_}
+)
+
+## Link libraries ##############################################################
+PKG_CHECK_MODULES(LOGGER_DEPS REQUIRED libsystemd-journal)
+INCLUDE_DIRECTORIES(${LIBS_FOLDER})
+INCLUDE_DIRECTORIES(SYSTEM ${LOGGER_DEPS_INCLUDE_DIRS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ${LOGGER_DEPS_LIBRARIES})
+
+## Generate the pc file ########################################################
+CONFIGURE_FILE(${PC_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${PC_FILE} @ONLY)
+
+## Install #####################################################################
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PC_FILE}
+ DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+
+INSTALL(TARGETS ${PROJECT_NAME}
+ DESTINATION ${LIB_INSTALL_DIR}
+ COMPONENT RuntimeLibraries)
+
+INSTALL(FILES ${HEADERS}
+ DESTINATION ${INCLUDE_INSTALL_DIR}/vasum-tools/logger)
* @brief Systemd journal backend for logger
*/
-#include "config.hpp"
+#include "logger/config.hpp"
#include "logger/backend-journal.hpp"
#define SD_JOURNAL_SUPPRESS_LOCATION
* @brief Stderr backend for logger
*/
-#include "config.hpp"
+#include "logger/config.hpp"
#include "logger/backend-stderr.hpp"
#include "logger/formatter.hpp"
* @brief Console color for StderrBackend logger
*/
-#include "config.hpp"
+#include "logger/config.hpp"
#include "logger/ccolor.hpp"
#include <stdio.h>
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: Lukasz Pawelczyk (l.pawelczyk@partner.samsung.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+/**
+ * @file
+ * @author Lukasz Pawelczyk (l.pawelczyk@partner.samsung.com)
+ * @brief Configuration file for the code
+ */
+
+
+#ifndef COMMON_CONFIG_HPP
+#define COMMON_CONFIG_HPP
+
+
+#ifdef __clang__
+#define CLANG_VERSION (__clang__major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
+#endif // __clang__
+
+#if defined __GNUC__ && !defined __clang__ // clang also defines GCC versions
+#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
+#endif // __GNUC__
+
+
+#ifdef GCC_VERSION
+
+#if GCC_VERSION < 40800
+// GCC 4.8 is the first where those defines are not required for
+// std::this_thread::sleep_for() and ::yield(). They might exist though
+// in previous versions depending on the build configuration of the GCC.
+#ifndef _GLIBCXX_USE_NANOSLEEP
+#define _GLIBCXX_USE_NANOSLEEP
+#endif // _GLIBCXX_USE_NANOSLEEP
+#ifndef _GLIBCXX_USE_SCHED_YIELD
+#define _GLIBCXX_USE_SCHED_YIELD
+#endif // _GLIBCXX_USE_SCHED_YIELD
+#endif // GCC_VERSION < 40800
+
+#if GCC_VERSION < 40700
+// Those appeared in 4.7 with full c++11 support
+#define final
+#define override
+#define thread_local __thread // use GCC extension instead of C++11
+#define steady_clock monotonic_clock
+#endif // GCC_VERSION < 40700
+
+#endif // GCC_VERSION
+
+// Variadic macros support for boost preprocessor should be enabled
+// manually for clang since they are marked as untested feature
+// (boost trunk if fixed but the latest 1.55 version is not,
+// see boost/preprocessor/config/config.hpp)
+#ifdef __clang__
+#define BOOST_PP_VARIADICS 1
+#endif
+
+// This has to be defined always when the boost has not been compiled
+// using C++11. Headers detect that you are compiling using C++11 and
+// blindly and wrongly assume that boost has been as well.
+#ifndef BOOST_NO_CXX11_SCOPED_ENUMS
+#define BOOST_NO_CXX11_SCOPED_ENUMS 1
+#endif
+
+#endif // COMMON_CONFIG_HPP
* @brief Helper formatter for logger
*/
-#include "config.hpp"
+#include "logger/config.hpp"
#include "logger/formatter.hpp"
#include "logger/ccolor.hpp"
* @brief Functions to handle LogLevel
*/
-#include "config.hpp"
+#include "logger/config.hpp"
#include "logger/level.hpp"
#include <stdexcept>
--- /dev/null
+# Package Information for pkg-config
+
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@
+
+Name: libLogger
+Description: Logger library
+Version: @_LIB_VERSION_@
+Libs: -L${libdir} -lLogger
+Cflags: -I${includedir}/vasum-tools
* @brief Logger
*/
-#include "config.hpp"
+#include "logger/config.hpp"
#include "logger/logger.hpp"
#include "logger/formatter.hpp"
#include "logger/backend-null.hpp"
%defattr(644,root,root,755)
%{_libdir}/libvasum.so
%{_includedir}/vasum
-%{_libdir}/pkgconfig/*.pc
+%{_libdir}/pkgconfig/vasum.pc
## Zone Support Package ###################################################
-# TODO move to a separate repository
%package zone-support
Summary: Vasum Support
Group: Security/Other
## Zone Daemon Package ####################################################
-# TODO move to a separate repository
%package zone-daemon
Summary: Vasum Zones Daemon
Group: Security/Other
%config /etc/dbus-1/system.d/org.tizen.vasum.tests.conf
%{_unitdir}/vasum-socket-test.socket
%{_unitdir}/vasum-socket-test.service
+
+## libLogger Package ###########################################################
+%package -n libLogger
+Summary: Logger library
+Group: Security/Other
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libLogger
+The package provides libLogger library.
+
+%post -n libLogger -p /sbin/ldconfig
+
+%postun -n libLogger -p /sbin/ldconfig
+
+%files -n libLogger
+%defattr(644,root,root,755)
+%{_libdir}/libLogger.so.0
+%attr(755,root,root) %{_libdir}/libLogger.so.0.0.1
+
+%package -n libLogger-devel
+Summary: Development logger library
+Group: Development/Libraries
+Requires: libLogger = %{version}-%{release}
+
+%description -n libLogger-devel
+The package provides libLogger development tools and libs.
+
+%files -n libLogger-devel
+%defattr(644,root,root,755)
+%{_libdir}/libLogger.so
+%{_includedir}/vasum-tools/logger
+%{_libdir}/pkgconfig/libLogger.pc
+
+## libSimpleDbus Package #######################################################
+%package -n libSimpleDbus
+Summary: Simple dbus library
+Group: Security/Other
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libSimpleDbus
+The package provides libSimpleDbus library.
+
+%post -n libSimpleDbus -p /sbin/ldconfig
+
+%postun -n libSimpleDbus -p /sbin/ldconfig
+
+%files -n libSimpleDbus
+%defattr(644,root,root,755)
+%{_libdir}/libSimpleDbus.so.0
+%attr(755,root,root) %{_libdir}/libSimpleDbus.so.0.0.1
+
+%package -n libSimpleDbus-devel
+Summary: Development Simple dbus library
+Group: Development/Libraries
+Requires: libSimpleDbus = %{version}-%{release}
+Requires: pkgconfig(libLogger)
+
+%description -n libSimpleDbus-devel
+The package provides libSimpleDbus development tools and libs.
+
+%files -n libSimpleDbus-devel
+%defattr(644,root,root,755)
+%{_libdir}/libSimpleDbus.so
+%{_includedir}/vasum-tools/dbus
+%{_libdir}/pkgconfig/libSimpleDbus.pc
+
+## libConfig Package ##########################################################
+%package -n libConfig
+Summary: Config library
+Group: Security/Other
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libConfig
+The package provides libConfig library.
+
+%post -n libConfig -p /sbin/ldconfig
+
+%postun -n libConfig -p /sbin/ldconfig
+
+%files -n libConfig
+%defattr(644,root,root,755)
+%{_libdir}/libConfig.so.0
+%attr(755,root,root) %{_libdir}/libConfig.so.0.0.1
+
+%package -n libConfig-devel
+Summary: Development Config library
+Group: Development/Libraries
+Requires: libConfig = %{version}-%{release}
+Requires: boost-devel
+Requires: pkgconfig(libLogger)
+Requires: libjson-devel
+
+%description -n libConfig-devel
+The package provides libConfig development tools and libs.
+
+%files -n libConfig-devel
+%defattr(644,root,root,755)
+%{_libdir}/libConfig.so
+%{_includedir}/vasum-tools/config
+%{_libdir}/pkgconfig/libConfig.pc
+
+
## Link libraries ##############################################################
FIND_PACKAGE(Boost COMPONENTS program_options system filesystem regex)
-PKG_CHECK_MODULES(SERVER_DEPS REQUIRED lxc json gio-2.0 libsystemd-journal libsystemd-daemon
- libcap-ng sqlite3)
+PKG_CHECK_MODULES(SERVER_DEPS REQUIRED lxc json gio-2.0 libsystemd-journal libsystemd-daemon libcap-ng)
INCLUDE_DIRECTORIES(${COMMON_FOLDER})
+INCLUDE_DIRECTORIES(${LIBS_FOLDER})
INCLUDE_DIRECTORIES(${CLIENT_FOLDER})
INCLUDE_DIRECTORIES(SYSTEM ${SERVER_DEPS_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
LINK_FLAGS "-pthread"
)
-TARGET_LINK_LIBRARIES(${SERVER_CODENAME} ${SERVER_DEPS_LIBRARIES} ${Boost_LIBRARIES})
+TARGET_LINK_LIBRARIES(${SERVER_CODENAME} ${SERVER_DEPS_LIBRARIES} ${Boost_LIBRARIES}
+ Logger Config SimpleDbus)
## Subdirectories ##############################################################
ADD_SUBDIRECTORY(configs)
FIND_PACKAGE (Boost COMPONENTS unit_test_framework system filesystem regex)
PKG_CHECK_MODULES(UT_SERVER_DEPS REQUIRED lxc json gio-2.0 libsystemd-daemon
- libsystemd-journal libcap-ng sqlite3)
+ libsystemd-journal libcap-ng)
INCLUDE_DIRECTORIES(${COMMON_FOLDER} ${SERVER_FOLDER} ${UNIT_TESTS_FOLDER} ${CLIENT_FOLDER}
- ${SOCKET_TEST_FOLDER})
+ ${LIBS_FOLDER} ${SOCKET_TEST_FOLDER})
INCLUDE_DIRECTORIES(SYSTEM ${UT_SERVER_DEPS_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
SET_TARGET_PROPERTIES(${UT_SERVER_CODENAME} PROPERTIES
LINK_FLAGS "-pthread"
)
-TARGET_LINK_LIBRARIES(${UT_SERVER_CODENAME} ${UT_SERVER_DEPS_LIBRARIES} ${Boost_LIBRARIES})
-TARGET_LINK_LIBRARIES(${SOCKET_TEST_CODENAME} ${UT_SERVER_DEPS_LIBRARIES} ${Boost_LIBRARIES})
+TARGET_LINK_LIBRARIES(${UT_SERVER_CODENAME} ${UT_SERVER_DEPS_LIBRARIES} ${Boost_LIBRARIES}
+ Logger Config SimpleDbus)
+TARGET_LINK_LIBRARIES(${SOCKET_TEST_CODENAME} ${UT_SERVER_DEPS_LIBRARIES} ${Boost_LIBRARIES}
+ Logger Config SimpleDbus)
## Subdirectories ##############################################################
SET(VSM_TEST_CONFIG_INSTALL_DIR ${VSM_CONFIG_INSTALL_DIR}/tests)
MESSAGE(STATUS "")
MESSAGE(STATUS "Generating makefile for the Zone Daemon...")
FILE(GLOB project_SRCS *.cpp *.hpp)
-FILE(GLOB common_SRCS ${COMMON_FOLDER}/dbus/*.cpp ${COMMON_FOLDER}/dbus/*.hpp
- ${COMMON_FOLDER}/logger/*.cpp ${COMMON_FOLDER}/logger/*.hpp
- ${COMMON_FOLDER}/utils/*.cpp ${COMMON_FOLDER}/utils/*.hpp
+FILE(GLOB common_SRCS ${COMMON_FOLDER}/utils/*.cpp ${COMMON_FOLDER}/utils/*.hpp
${COMMON_FOLDER}/*.cpp)
## Setup target ################################################################
PKG_CHECK_MODULES(ZONE_DAEMON_DEPS REQUIRED gio-2.0 libsystemd-journal libcap-ng)
INCLUDE_DIRECTORIES(${COMMON_FOLDER})
+INCLUDE_DIRECTORIES(${LIBS_FOLDER})
INCLUDE_DIRECTORIES(SYSTEM ${ZONE_DAEMON_DEPS_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
SET_TARGET_PROPERTIES(${ZONE_DAEMON_CODENAME} PROPERTIES
LINK_FLAGS "-pthread"
)
-TARGET_LINK_LIBRARIES(${ZONE_DAEMON_CODENAME} ${ZONE_DAEMON_DEPS_LIBRARIES} ${Boost_LIBRARIES})
+TARGET_LINK_LIBRARIES(${ZONE_DAEMON_CODENAME} ${ZONE_DAEMON_DEPS_LIBRARIES}
+ ${Boost_LIBRARIES} Logger SimpleDbus)
## Install #####################################################################