summaryrefslogtreecommitdiff
path: root/databases/arangodb32/files
diff options
context:
space:
mode:
Diffstat (limited to 'databases/arangodb32/files')
-rw-r--r--databases/arangodb32/files/arangod.in85
-rw-r--r--databases/arangodb32/files/patch-CMakeLists.txt47
-rw-r--r--databases/arangodb32/files/patch-arangod_Agency_Store.cpp11
-rw-r--r--databases/arangodb32/files/patch-arangod_RestHandler_RestAuthHandler.cpp11
-rw-r--r--databases/arangodb32/files/patch-cmake_ArangoDBInstall.cmake11
-rw-r--r--databases/arangodb32/files/patch-lib_Basics_process-utils.cpp52
-rw-r--r--databases/arangodb32/files/patch-lib_Basics_socket-utils.h15
-rw-r--r--databases/arangodb32/files/patch-lib_Logger_LogAppenderSyslog.cpp11
8 files changed, 243 insertions, 0 deletions
diff --git a/databases/arangodb32/files/arangod.in b/databases/arangodb32/files/arangod.in
new file mode 100644
index 000000000000..4edc4bf9a59e
--- /dev/null
+++ b/databases/arangodb32/files/arangod.in
@@ -0,0 +1,85 @@
+#!/bin/sh
+
+# PROVIDE: arangod
+# REQUIRE: NETWORK ldconfig
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# arangod_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable arangod.
+# arangod_limits (bool): Set to "NO" by default.
+# Set it to yes to run `limits -e -U arangodb`
+# just before arangod starts.
+# arangod_dbpath (str): Default to "/var/db/arangodb"
+# Base database directory.
+# arangod_logpath (str): Default to "/var/log/arangodb"
+# Base logging directory
+# arangod_apppath (str): Default to "/var/db/arangodb-apps"
+# Base apps directory
+# arangod_flags (str): Custom additional arguments to be passed to arangod.
+# Default to "".
+# arangod_config (str): Default to "%%PREFIX%%/etc/arangodb/arangod.conf"
+# Path to config file
+#
+
+. /etc/rc.subr
+
+name="arangod"
+rcvar=arangod_enable
+
+load_rc_config $name
+
+: ${arangod_enable="NO"}
+: ${arangod_limits="NO"}
+: ${arangod_dbpath="/var/db/arangodb"}
+: ${arangod_logpath="/var/log/arangodb"}
+: ${arangod_apppath="/var/db/arangodb-apps"}
+: ${arangod_flags=""}
+: ${arangod_user="arangodb"}
+: ${arangod_group="arangodb"}
+: ${arangod_config="%%PREFIX%%/etc/arangodb/arangod.conf"}
+
+pidfile="${arangod_dbpath}/arangod.lock"
+command=%%PREFIX%%/sbin/${name}
+command_args="--configuration $arangod_config --database.directory $arangod_dbpath --log.output ${arangod_logpath}/arangod.log --javascript.app-path ${arangod_apppath} --daemon --pid-file ${pidfile} >/dev/null 2>/dev/null"
+start_precmd="${name}_prestart"
+
+arangod_create_dbpath()
+{
+ mkdir ${arangod_dbpath} >/dev/null 2>/dev/null
+ [ $? -eq 0 ] && chown -R ${arangod_user}:${arangod_group} ${arangod_dbpath}
+}
+
+arangod_create_logpath()
+{
+ mkdir ${arangod_logpath} >/dev/null 2>/dev/null
+ [ $? -eq 0 ] && chown -R ${arangod_user}:${arangod_group} ${arangod_logpath}
+}
+
+arangod_create_apppath()
+{
+ mkdir ${arangod_apppath} >/dev/null 2>/dev/null
+ [ $? -eq 0 ] && chown -R ${arangod_user}:${arangod_group} ${arangod_apppath}
+}
+
+arangod_prestart()
+{
+ if [ ! -d ${arangod_dbpath} ]; then
+ arangod_create_dbpath || return 1
+ fi
+ if [ ! -d ${arangod_logpath} ]; then
+ arangod_create_logpath || return 1
+ fi
+ if [ ! -d ${arangod_apppath} ]; then
+ arangod_create_apppath || return 1
+ fi
+ if checkyesno arangod_limits; then
+ eval `/usr/bin/limits -e -U ${arangod_user}` 2>/dev/null
+ else
+ return 0
+ fi
+}
+
+run_rc_command "$1"
diff --git a/databases/arangodb32/files/patch-CMakeLists.txt b/databases/arangodb32/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..cac21d531523
--- /dev/null
+++ b/databases/arangodb32/files/patch-CMakeLists.txt
@@ -0,0 +1,47 @@
+--- CMakeLists.txt.orig 2017-11-15 11:23:07 UTC
++++ CMakeLists.txt
+@@ -38,9 +38,9 @@ if (NOT CMAKE_OSX_DEPLOYMENT_TARGET)
+ endif ()
+
+ if (WIN32)
+- project(arangodb3 CXX C)
++ project(arangodb CXX C)
+ else ()
+- project(arangodb3 CXX C ASM)
++ project(arangodb CXX C ASM)
+ endif ()
+
+ # required for clang completion in editors
+@@ -364,7 +364,7 @@ if (CMAKE_COMPILER_IS_GNUCC OR APPLE)
+ endif ()
+
+ if (CMAKE_COMPILER_IS_CLANG)
+- if (APPLE)
++ if (APPLE OR FREEBSD)
+ set(BASE_CXX_FLAGS "${BASE_CXX_FLAGS} -stdlib=libc++")
+ add_definitions("-Wno-deprecated-declarations")
+ else ()
+@@ -498,7 +498,11 @@ if (USE_BACKTRACE)
+ if (MSVC)
+ set(BT_LIBS "Dbghelp" CACHE path "Debug Helper libraries")
+ else ()
+- set(BT_LIBS "" CACHE path "Debug Helper libraries")
++ if (FREEBSD)
++ set(BT_LIBS execinfo)
++ else ()
++ set(BT_LIBS "" CACHE path "Debug Helper libraries")
++ endif ()
+ endif ()
+
+ add_definitions("-DARANGODB_ENABLE_BACKTRACE=1")
+@@ -573,7 +577,9 @@ endif ()
+ ################################################################################
+
+ if (NOT WINDOWS)
+- set(SYS_LIBS ${SYS_LIBS} resolv)
++ if (NOT FREEBSD)
++ set(SYS_LIBS ${SYS_LIBS} resolv)
++ endif ()
+
+ if (NOT DARWIN)
+ set(SYS_LIBS ${SYS_LIBS} rt)
diff --git a/databases/arangodb32/files/patch-arangod_Agency_Store.cpp b/databases/arangodb32/files/patch-arangod_Agency_Store.cpp
new file mode 100644
index 000000000000..5860dfdcd0fd
--- /dev/null
+++ b/databases/arangodb32/files/patch-arangod_Agency_Store.cpp
@@ -0,0 +1,11 @@
+--- arangod/Agency/Store.cpp.orig 2017-11-15 11:23:07 UTC
++++ arangod/Agency/Store.cpp
+@@ -601,7 +601,7 @@ void Store::dumpToBuilder(Builder& build
+ auto ts = std::chrono::duration_cast<std::chrono::seconds>(
+ i.first.time_since_epoch())
+ .count();
+- builder.add(i.second, VPackValue(ts));
++ builder.add(i.second, VPackValue((int64_t)ts));
+ }
+ }
+ {
diff --git a/databases/arangodb32/files/patch-arangod_RestHandler_RestAuthHandler.cpp b/databases/arangodb32/files/patch-arangod_RestHandler_RestAuthHandler.cpp
new file mode 100644
index 000000000000..b3134688347a
--- /dev/null
+++ b/databases/arangodb32/files/patch-arangod_RestHandler_RestAuthHandler.cpp
@@ -0,0 +1,11 @@
+--- arangod/RestHandler/RestAuthHandler.cpp.orig 2017-11-15 11:23:07 UTC
++++ arangod/RestHandler/RestAuthHandler.cpp
+@@ -59,7 +59,7 @@ std::string RestAuthHandler::generateJwt
+ VPackObjectBuilder p(&bodyBuilder);
+ bodyBuilder.add("preferred_username", VPackValue(username));
+ bodyBuilder.add("iss", VPackValue("arangodb"));
+- bodyBuilder.add("exp", VPackValue(exp.count()));
++ bodyBuilder.add("exp", VPackValue((int64_t)exp.count()));
+ }
+ return authentication->authInfo()->generateJwt(bodyBuilder);
+ }
diff --git a/databases/arangodb32/files/patch-cmake_ArangoDBInstall.cmake b/databases/arangodb32/files/patch-cmake_ArangoDBInstall.cmake
new file mode 100644
index 000000000000..91a7456014ad
--- /dev/null
+++ b/databases/arangodb32/files/patch-cmake_ArangoDBInstall.cmake
@@ -0,0 +1,11 @@
+--- cmake/ArangoDBInstall.cmake.orig 2017-11-16 20:17:40 UTC
++++ cmake/ArangoDBInstall.cmake
+@@ -100,7 +100,7 @@ endif ()
+
+ install(
+ DIRECTORY
+- ${PROJECT_BINARY_DIR}/var/log/arangodb3
++ ${PROJECT_BINARY_DIR}/var/log/arangodb
+ DESTINATION
+ ${CMAKE_INSTALL_LOCALSTATEDIR}/log
+ )
diff --git a/databases/arangodb32/files/patch-lib_Basics_process-utils.cpp b/databases/arangodb32/files/patch-lib_Basics_process-utils.cpp
new file mode 100644
index 000000000000..895a1f4ad680
--- /dev/null
+++ b/databases/arangodb32/files/patch-lib_Basics_process-utils.cpp
@@ -0,0 +1,52 @@
+--- lib/Basics/process-utils.cpp.orig 2017-11-15 11:23:07 UTC
++++ lib/Basics/process-utils.cpp
+@@ -23,7 +23,7 @@
+
+ #include "process-utils.h"
+
+-#if defined(TRI_HAVE_MACOS_MEM_STATS)
++#if defined(TRI_HAVE_MACOS_MEM_STATS) || defined (__FreeBSD__)
+ #include <sys/types.h>
+ #include <sys/sysctl.h>
+ #endif
+@@ -581,6 +581,7 @@ TRI_process_info_t TRI_ProcessInfoSelf()
+ }
+
+ #else
++#ifdef _WIN32
+ /// --------------------------------------------
+ /// transform a file time to timestamp
+ /// Particularities:
+@@ -673,6 +674,7 @@ TRI_process_info_t TRI_ProcessInfoSelf()
+ return result;
+ }
+ #endif
++#endif
+
+ ////////////////////////////////////////////////////////////////////////////////
+ /// @brief returns information about the process
+@@ -1254,7 +1256,7 @@ bool TRI_ContinueExternalProcess(TRI_ext
+ /// @brief gets the physical memory
+ ////////////////////////////////////////////////////////////////////////////////
+
+-#if defined(TRI_HAVE_MACOS_MEM_STATS)
++#if defined(TRI_HAVE_MACOS_MEM_STATS) || defined(__FreeBSD__)
+
+ static uint64_t GetPhysicalMemory() {
+ int mib[2];
+@@ -1297,6 +1299,7 @@ static uint64_t GetPhysicalMemory() {
+
+ #else
+
++#ifdef _WIN32
+ static uint64_t GetPhysicalMemory() {
+ PROCESS_MEMORY_COUNTERS pmc;
+ memset(&result, 0, sizeof(result));
+@@ -1307,6 +1310,7 @@ static uint64_t GetPhysicalMemory() {
+ }
+ return 0;
+ }
++#endif // _WIN32
+ #endif
+ #endif
+ #endif
diff --git a/databases/arangodb32/files/patch-lib_Basics_socket-utils.h b/databases/arangodb32/files/patch-lib_Basics_socket-utils.h
new file mode 100644
index 000000000000..0bb3c0dd8b6b
--- /dev/null
+++ b/databases/arangodb32/files/patch-lib_Basics_socket-utils.h
@@ -0,0 +1,15 @@
+--- lib/Basics/socket-utils.h.orig 2017-11-15 11:23:07 UTC
++++ lib/Basics/socket-utils.h
+@@ -31,6 +31,12 @@
+ #include <WS2tcpip.h>
+ #endif
+
++#ifdef __FreeBSD__
++#include <sys/types.h>
++#include <sys/socket.h>
++#include <netinet/in.h>
++#endif
++
+ ////////////////////////////////////////////////////////////////////////////////
+ /// @brief socket types
+ ////////////////////////////////////////////////////////////////////////////////
diff --git a/databases/arangodb32/files/patch-lib_Logger_LogAppenderSyslog.cpp b/databases/arangodb32/files/patch-lib_Logger_LogAppenderSyslog.cpp
new file mode 100644
index 000000000000..976c757c8338
--- /dev/null
+++ b/databases/arangodb32/files/patch-lib_Logger_LogAppenderSyslog.cpp
@@ -0,0 +1,11 @@
+--- lib/Logger/LogAppenderSyslog.cpp.orig 2017-11-15 11:23:07 UTC
++++ lib/Logger/LogAppenderSyslog.cpp
+@@ -64,7 +64,7 @@ LogAppenderSyslog::LogAppenderSyslog(std
+ if ('0' <= facility[0] && facility[0] <= '9') {
+ value = StringUtils::int32(facility);
+ } else {
+- CODE* ptr = reinterpret_cast<CODE*>(TRI_facilitynames);
++ const CODE* ptr = reinterpret_cast<const CODE*>(TRI_facilitynames);
+
+ while (ptr->c_name != 0) {
+ if (strcmp(ptr->c_name, facility.c_str()) == 0) {