[packages/osquery] use system glog
glen
glen at pld-linux.org
Thu Jul 30 21:18:33 CEST 2015
commit b95a8d5c1702840d777152c23655865823788b68
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Thu Jul 30 22:17:51 2015 +0300
use system glog
osquery.spec | 9 +++++--
system-glog.patch | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 87 insertions(+), 2 deletions(-)
---
diff --git a/osquery.spec b/osquery.spec
index 17afc8e..2214ab6 100644
--- a/osquery.spec
+++ b/osquery.spec
@@ -9,6 +9,7 @@ Source0: https://github.com/facebook/osquery/archive/%{version}/%{name}-%{versio
Source1: https://github.com/osquery/third-party/archive/%{version}/%{name}-third-party-%{version}.tar.gz
# Source1-md5: 40da5c78ae344d5869fa5ef0e3946246
Patch1: gcc-flags.patch
+Patch2: system-glog.patch
URL: https://osquery.io/
BuildRequires: bison
BuildRequires: boost-devel >= 1.55.0
@@ -21,6 +22,7 @@ BuildRequires: doxygen
BuildRequires: flex
BuildRequires: gettext-devel
BuildRequires: gflags-devel >= 2.1.1
+BuildRequires: glog-devel
BuildRequires: gmock-devel
BuildRequires: iptables-devel >= 1.4.21
BuildRequires: libblkid-devel
@@ -35,8 +37,8 @@ BuildRequires: python-argparse
BuildRequires: python-jinja2
BuildRequires: python-psutil
BuildRequires: readline-devel
-BuildRequires: rocksdb-devel >= 3.10.2
-BuildRequires: rocksdb-static >= 3.10.2
+BuildRequires: rocksdb-devel >= 3.9
+BuildRequires: rocksdb-static >= 3.9
BuildRequires: snappy-devel >= 1.1.1
BuildRequires: snappy-static >= 1.1.1
BuildRequires: thrift-devel >= 0.9.1
@@ -44,6 +46,8 @@ BuildRequires: udev-devel >= 1:095
BuildRequires: yara-devel >= 3.4.0
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+%define specflags -DGFLAGS_NAMESPACE=gflags
+
# build fails with CC having spaces
%undefine with_ccache
@@ -57,6 +61,7 @@ network connections, browser plugins, hardware events or file hashes.
%prep
%setup -q -a1
%patch1 -p1
+%patch2 -p1
mv third-party-*/* third-party
diff --git a/system-glog.patch b/system-glog.patch
new file mode 100644
index 0000000..ba51e66
--- /dev/null
+++ b/system-glog.patch
@@ -0,0 +1,80 @@
+add glog from hhvm
+https://github.com/facebook/hhvm/commit/76a789b29068bc79db73a98e5835dc280b9a7f3c
+
+--- osquery-1.5.1/CMakeLists.txt 2015-07-30 21:12:40.073789154 +0300
++++ osquery-1.5.1/CMakeLists.txt 2015-07-30 21:16:50.116799762 +0300
+@@ -303,6 +303,8 @@
+ find_package(Sqlite3 REQUIRED)
+ find_package(Thrift 0.9.1 REQUIRED)
+
++LOG_LIBRARY(glog "${LIBGLOG_LIBRARY}")
++
+ # If using the RocksDB LITE version our code must also define ROCKSDB_LITE=1
+ if(ROCKSDB_LITE_FOUND)
+ add_definitions(-DROCKSDB_LITE=1)
+@@ -319,7 +321,7 @@
+ include(Packages)
+ include(Thrift)
+
+-include_directories("${GLOG_INCLUDE_DIRS}")
++include_directories("${LIBGLOG_INCLUDE_DIR}")
+ include_directories("${CMAKE_SOURCE_DIR}/include")
+ include_directories("${CMAKE_SOURCE_DIR}")
+ include_directories("/usr/local/include")
+--- osquery-1.5.1/CMake/FindGlog.cmake~ 2015-07-27 04:11:42.000000000 +0300
++++ osquery-1.5.1/CMake/FindGlog.cmake 2015-07-30 21:15:42.446611981 +0300
+@@ -1,35 +1,19 @@
+-include(FindPackageHandleStandardArgs)
+-if(POLICY CMP0054)
+- cmake_policy(SET CMP0054 NEW)
+-endif()
+-
+-set(GLOG_ROOT_DIR "${CMAKE_BINARY_DIR}/third-party/glog")
+-set(GLOG_SOURCE_DIR "${CMAKE_SOURCE_DIR}/third-party/glog")
+-
+-set(GLOG_C_FLAGS "${CMAKE_C_FLAGS} ${C_COMPILE_FLAGS}")
+-set(GLOG_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_COMPILE_FLAGS}")
+-set(GLOG_CXX_FLAGS "${GLOG_CXX_FLAGS} -Wno-deprecated-register -Wno-unnamed-type-template-args -Wno-deprecated -Wno-error")
+-
+-INCLUDE(ExternalProject)
+-ExternalProject_Add(
+- libglog
+- SOURCE_DIR ${GLOG_SOURCE_DIR}
+- INSTALL_DIR ${GLOG_ROOT_DIR}
+- CONFIGURE_COMMAND ${GLOG_SOURCE_DIR}/configure
+- CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER}
+- CFLAGS=${GLOG_C_FLAGS} CXXFLAGS=${GLOG_CXX_FLAGS}
+- --enable-frame-pointers --enable-shared=no --prefix=${GLOG_ROOT_DIR}
+- BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
+- INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install
+- LOG_CONFIGURE ON
+- LOG_INSTALL ON
+- LOG_BUILD ON
+-)
+-
+-set(GLOG_INCLUDE_DIR "${GLOG_ROOT_DIR}/include")
+-set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR})
+-
+-set(GLOG_LIBRARY "${GLOG_ROOT_DIR}/lib/libglog.a")
+-set(GLOG_LIBRARIES ${GLOG_LIBRARY})
+-
+-LOG_LIBRARY(glog "${GLOG_LIBRARY}")
++# Find libglog
++#
++# LIBGLOG_INCLUDE_DIR - where to find glog/logging.h, etc.
++# LIBGLOG_LIBRARY - List of libraries when using libglog.
++# LIBGLOG_FOUND - True if libglog found.
++
++IF (LIBGLOG_INCLUDE_DIR)
++ # Already in cache, be silent
++ SET(LIBGLOG_FIND_QUIETLY TRUE)
++ENDIF ()
++
++FIND_PATH(LIBGLOG_INCLUDE_DIR glog/logging.h)
++FIND_LIBRARY(LIBGLOG_LIBRARY glog)
++
++# handle the QUIETLY and REQUIRED arguments and set Libmemcached_FOUND to TRUE
++# if all listed variables are TRUE
++INCLUDE(FindPackageHandleStandardArgs)
++FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBGLOG DEFAULT_MSG LIBGLOG_LIBRARY LIBGLOG_INCLUDE_DIR)
++MARK_AS_ADVANCED(LIBGLOG_LIBRARY LIBGLOG_INCLUDE_DIR)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/osquery.git/commitdiff/b95a8d5c1702840d777152c23655865823788b68
More information about the pld-cvs-commit
mailing list