* [gentoo-commits] repo/gentoo:master commit in: dev-db/rethinkdb/, dev-db/rethinkdb/files/
@ 2016-09-02 6:45 Alexys Jacob
0 siblings, 0 replies; 2+ messages in thread
From: Alexys Jacob @ 2016-09-02 6:45 UTC (permalink / raw
To: gentoo-commits
commit: c6ff4058cf235d3fa9754e5fa4484dd43699abbf
Author: Ultrabug <ultrabug <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 2 06:32:47 2016 +0000
Commit: Alexys Jacob <ultrabug <AT> gentoo <DOT> org>
CommitDate: Fri Sep 2 06:33:14 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c6ff4058
dev-db/rethinkdb: new package
Package-Manager: portage-2.2.27
dev-db/rethinkdb/Manifest | 1 +
dev-db/rethinkdb/files/rethinkdb.confd | 12 +++
dev-db/rethinkdb/files/rethinkdb.initd | 50 +++++++++++
dev-db/rethinkdb/files/rethinkdb.service | 13 +++
dev-db/rethinkdb/files/rethinkdb.tmpfilesd | 1 +
dev-db/rethinkdb/metadata.xml | 19 +++++
dev-db/rethinkdb/rethinkdb-2.3.4.ebuild | 133 +++++++++++++++++++++++++++++
7 files changed, 229 insertions(+)
diff --git a/dev-db/rethinkdb/Manifest b/dev-db/rethinkdb/Manifest
new file mode 100644
index 00000000..ae41ede
--- /dev/null
+++ b/dev-db/rethinkdb/Manifest
@@ -0,0 +1 @@
+DIST rethinkdb-2.3.4.tgz 76811758 SHA256 93a7927d1ed785d084be3b8bac3f9af2d89c86de16e003848acbe21a32a9e1a7 SHA512 47e62ef57de112129b7409027017882bc31bb2403287845253a0fe0f61d0977f2e37ba487506853ed3421ac57b2558cabde4f8aee4b9723e4c61300b447e1e19 WHIRLPOOL ce956ad5b7f5f6a38500e501b104571d819e0292cfd1a922ef4f6395ad4e48242456759dad399f5ed2048dee6680df645f54b8ef18e2eebc7f904abe5a2be91c
diff --git a/dev-db/rethinkdb/files/rethinkdb.confd b/dev-db/rethinkdb/files/rethinkdb.confd
new file mode 100644
index 00000000..af65794
--- /dev/null
+++ b/dev-db/rethinkdb/files/rethinkdb.confd
@@ -0,0 +1,12 @@
+# !! IMPORTANT !!
+#
+# This file is ONLY used to override some of the init script configuration.
+#
+# You should NOT use this file to configure your rethinkdb instance,
+# see the /etc/rethinkdb/default.conf.sample file instead.
+#
+# Available init script modifiers :
+# - config_file : the configuration file to use (default : /etc/rethinkdb/instance.d/<instance-name>.conf)
+# - user : the user used to run your rethinkdb instance (default : rethinkdb)
+# - group : the group used to run your rethinkdb instance (default : rethinkdb)
+# - run_dir : the run directory for your PID files (default : /run/rethinkdb)
\ No newline at end of file
diff --git a/dev-db/rethinkdb/files/rethinkdb.initd b/dev-db/rethinkdb/files/rethinkdb.initd
new file mode 100644
index 00000000..193f071
--- /dev/null
+++ b/dev-db/rethinkdb/files/rethinkdb.initd
@@ -0,0 +1,50 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+instance_name=${SVCNAME/*.}
+config_file=${config_file:-/etc/rethinkdb/instances.d/${instance_name}.conf}
+run_dir=${run_dir:-/run/rethinkdb}
+
+command="/usr/bin/rethinkdb"
+command_args="--config-file ${config_file}"
+command_background="true"
+pidfile=${run_dir}/${instance_name}.pid
+user=${user:-rethinkdb}
+group=${group:-rethinkdb}
+start_stop_daemon_args="--user ${user} --group ${group} --wait 2000"
+
+depend() {
+ use net
+}
+
+start_pre() {
+ checkpath -d -m 0750 -o "${user}":"${group}" "${run_dir}"
+ if [ "${instance_name}" == "rethinkdb" ]; then
+ eerror "You should not run this default init script directly"
+ eerror "Create a symlink to an instance name"
+ eerror "and create a configuration file in /etc/rethinkdb/instances.d/"
+ eerror "then run this instance init script instead."
+ return 1
+ fi
+ if [ ! -f ${config_file} ]; then
+ eerror "Missing configuration file ${config_file}"
+ return 1
+ else
+ # respect configured directory or set a default
+ directory=$(egrep -e '^directory=' "${config_file}" | cut -d'=' -f2)
+ if [ -z "${directory}" ]; then
+ directory=/var/lib/rethinkdb/instances.d/"${instance_name}"
+ fi
+ checkpath -d -m 0750 -o "${user}":"${group}" "${directory}"
+ command_args="${command_args} --directory ${directory}"
+
+ # respect configured log-file or set a default
+ log_file=$(egrep -e '^log_file=' "${config_file}" | cut -d'=' -f2)
+ if [ -z "${log_file}" ]; then
+ log_file=/var/log/rethinkdb/"${instance_name}".log
+ fi
+ command_args="${command_args} --log-file ${log_file}"
+ fi
+}
diff --git a/dev-db/rethinkdb/files/rethinkdb.service b/dev-db/rethinkdb/files/rethinkdb.service
new file mode 100644
index 00000000..09645c2
--- /dev/null
+++ b/dev-db/rethinkdb/files/rethinkdb.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=RethinkDB database server for instance '%i'
+
+[Service]
+User=rethinkdb
+Group=rethinkdb
+ExecStart=/usr/bin/rethinkdb serve --config-file /etc/rethinkdb/instances.d/%i.conf
+KillMode=process
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/dev-db/rethinkdb/files/rethinkdb.tmpfilesd b/dev-db/rethinkdb/files/rethinkdb.tmpfilesd
new file mode 100644
index 00000000..694501e
--- /dev/null
+++ b/dev-db/rethinkdb/files/rethinkdb.tmpfilesd
@@ -0,0 +1 @@
+d /run/rethinkdb 0755 rethinkdb rethinkdb -
\ No newline at end of file
diff --git a/dev-db/rethinkdb/metadata.xml b/dev-db/rethinkdb/metadata.xml
new file mode 100644
index 00000000..91224a4
--- /dev/null
+++ b/dev-db/rethinkdb/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>ultrabug@gentoo.org</email>
+ <name>Ultrabug</name>
+ </maintainer>
+ <use>
+ <flag name="jemalloc">
+ Use <pkg>dev-libs/jemalloc</pkg> for allocations (default).
+ </flag>
+ <flag name="tcmalloc">
+ Use tcmalloc from <pkg>dev-util/google-perftools</pkg> for allocations.
+ </flag>
+ </use>
+ <upstream>
+ <bugs-to>https://github.com/rethinkdb/rethinkdb/issues</bugs-to>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-db/rethinkdb/rethinkdb-2.3.4.ebuild b/dev-db/rethinkdb/rethinkdb-2.3.4.ebuild
new file mode 100644
index 00000000..cbd2f67
--- /dev/null
+++ b/dev-db/rethinkdb/rethinkdb-2.3.4.ebuild
@@ -0,0 +1,133 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="6"
+
+inherit systemd user
+
+DESCRIPTION="The open-source database for the realtime web."
+HOMEPAGE="http://www.rethinkdb.com"
+LICENSE="AGPL-3"
+SLOT="0"
+SRC_URI="http://download.rethinkdb.com/dist/${P}.tgz"
+
+KEYWORDS="~amd64 ~x86"
+IUSE="doc +jemalloc tcmalloc"
+
+# TODO: rly need some webui libs ?
+DEPEND="dev-cpp/gtest
+ dev-libs/boost
+ dev-libs/protobuf-c
+ >=dev-libs/re2-0.2016.05.01
+ sys-libs/libunwind
+ sys-libs/ncurses:=
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )
+ tcmalloc? ( dev-util/google-perftools )"
+RDEPEND="${DEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+pkg_setup() {
+ enewgroup rethinkdb
+ enewuser rethinkdb -1 -1 /var/lib/${PN} rethinkdb
+}
+
+src_prepare() {
+ eapply_user
+
+ # don't use predefined configuration
+ rm configure.default
+
+ # fix doc and init script auto installation
+ sed -e 's/ install-docs / /g' -e 's/ install-init / /g' -i mk/install.mk || die
+
+ # default config for Gentoo
+ # fix default pid-file path
+ # fix default directory path
+ # fix default log-file path
+ sed -e 's@/var/run/@/run/@g' \
+ -e 's@/var/lib/rethinkdb/@/var/lib/rethinkdb/instances.d/@g' \
+ -e 's@/var/log/rethinkdb@/var/log/rethinkdb/default.log@g' \
+ -i packaging/assets/config/default.conf.sample || die
+
+ # proper CXX declaration
+ sed -e "s/CXX=\$(.*/CXX=$(tc-getCXX)/g" -i configure || die
+
+ # respect user CXXFLAGS optimizations
+ sed -e 's/-O3//g' -i src/build.mk || die
+}
+
+src_configure() {
+ local conf_opts=(
+ --prefix="/usr"
+ --sysconfdir="/etc"
+ --localstatedir="/var"
+ --static=none
+ --dynamic=gtest
+ --dynamic=re2
+ )
+ if use jemalloc; then
+ conf_opts+=(--with-jemalloc)
+ elif use tcmalloc; then
+ conf_opts+=(--with-tcmalloc)
+ else
+ conf_opts+=(--with-system-malloc)
+ fi
+ ./configure "${conf_opts[@]}"
+}
+
+src_compile() {
+ emake VERBOSE=1
+}
+
+src_install() {
+ emake DESTDIR="${D}" VERBOSE=1 install
+
+ for x in /var/{lib,log}/${PN}; do
+ keepdir "${x}"
+ fowners rethinkdb:rethinkdb "${x}"
+ done
+
+ newconfd "${FILESDIR}/rethinkdb.confd" rethinkdb
+ newinitd "${FILESDIR}/rethinkdb.initd" rethinkdb
+
+ systemd_newunit "${FILESDIR}/"${PN}.service "rethinkdb@.service"
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd "rethinkdb.conf"
+
+ use doc && dodoc COPYRIGHT NOTES.md README.md
+}
+
+pkg_config() {
+ einfo "This will prepare a new RethinkDB instance. Press Control-C to abort."
+
+ einfo "Enter the name for the new instance: "
+ read instance_name
+ [[ -z "${instance_name}" ]] && die "Invalid instance name"
+
+ local instance_data="/var/lib/rethinkdb/instances.d/${instance_name}"
+ local instance_config="/etc/rethinkdb/instances.d/${instance_name}.conf"
+ if [[ -e "${instance_data}" || -e "${instance_config}" ]]; then
+ eerror "An instance with the same name already exists:"
+ eerror "Check ${instance_data} or ${instance_config}."
+ die "Instance already exists"
+ fi
+
+ /usr/bin/rethinkdb create -d "${instance_data}" &>/dev/null \
+ || die "Creating instance failed"
+ chown -R rethinkdb:rethinkdb "${instance_data}" \
+ || die "Correcting permissions for instance failed"
+ cp /etc/rethinkdb/default.conf.sample "${instance_config}" \
+ || die "Creating configuration file failed"
+ sed -e "s:^# \(directory=\).*$:\1${instance_data}:" \
+ -i "${instance_config}" \
+ || die "Modifying configuration file failed"
+ ln -s /etc/init.d/rethinkdb "/etc/init.d/rethinkdb.${instance_name}" \
+ || die "Creating init script symlink failed"
+
+ einfo "Successfully created the instance at ${instance_data}."
+ einfo "To change the default settings edit the configuration file:"
+ einfo "${instance_config}"
+ einfo " "
+ einfo "To start your instance, run:"
+ einfo "/etc/init.d/rethinkdb.${instance_name}"
+}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-db/rethinkdb/, dev-db/rethinkdb/files/
@ 2017-10-13 8:09 Alexys Jacob
0 siblings, 0 replies; 2+ messages in thread
From: Alexys Jacob @ 2017-10-13 8:09 UTC (permalink / raw
To: gentoo-commits
commit: 95dcce86af2109c34e7ac852c267ec07bab9c3cb
Author: Peter Levine <plevine457 <AT> gmail <DOT> com>
AuthorDate: Wed Oct 11 00:32:04 2017 +0000
Commit: Alexys Jacob <ultrabug <AT> gentoo <DOT> org>
CommitDate: Fri Oct 13 08:09:19 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95dcce86
dev-db/rethinkdb: Fix building against libressl
Bug: https://bugs.gentoo.org/594998
Package-Manager: Portage-2.3.10, Repoman-2.3.3
Closes: https://github.com/gentoo/gentoo/pull/5911
.../rethinkdb/files/rethinkdb-2.3.5-libressl.patch | 162 +++++++++++++++++++++
dev-db/rethinkdb/rethinkdb-2.3.5.ebuild | 1 +
2 files changed, 163 insertions(+)
diff --git a/dev-db/rethinkdb/files/rethinkdb-2.3.5-libressl.patch b/dev-db/rethinkdb/files/rethinkdb-2.3.5-libressl.patch
new file mode 100644
index 00000000000..b79850b0b6b
--- /dev/null
+++ b/dev-db/rethinkdb/files/rethinkdb-2.3.5-libressl.patch
@@ -0,0 +1,162 @@
+Bug: https://bugs.gentoo.org/594998
+Issue: https://github.com/rethinkdb/rethinkdb/issues/6336
+Patch: https://git.alpinelinux.org/cgit/aports/tree/community/rethinkdb/libressl.patch?id=146fb0d67a1b861d5c776d97f533efe0bb26af7a
+
+From d52a694a806c1a8b6dd4d7d17d0671a96240449a Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Wed, 4 Jan 2017 15:31:40 +0100
+Subject: [PATCH] Improve OpenSSL compatibility
+
+Refactor the conditionals for openssl 1.1 support so we avoid multiple
+if/else and add a check for LibreSSL as well.
+---
+ src/crypto/hash.cc | 13 +++++--------
+ src/crypto/hmac.cc | 34 ++++++++++++++++++----------------
+ src/crypto/initialization_guard.cc | 15 ++++++---------
+ 3 files changed, 29 insertions(+), 33 deletions(-)
+
+diff --git a/src/crypto/hash.cc b/src/crypto/hash.cc
+index 4427dfddeb..e035f695fc 100644
+--- a/src/crypto/hash.cc
++++ b/src/crypto/hash.cc
+@@ -8,27 +8,24 @@
+
+ #include "crypto/error.hpp"
+
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
++#define EVP_MD_CTX_new EVP_MD_CTX_create
++#define EVP_MD_CTX_free EVP_MD_CTX_destroy
++#endif
++
+ namespace crypto {
+
+ class evp_md_ctx_wrapper_t {
+ public:
+ evp_md_ctx_wrapper_t() {
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+- m_evp_md_ctx = EVP_MD_CTX_create();
+-#else
+ m_evp_md_ctx = EVP_MD_CTX_new();
+-#endif
+ if (m_evp_md_ctx == nullptr) {
+ throw openssl_error_t(ERR_get_error());
+ }
+ }
+
+ ~evp_md_ctx_wrapper_t() {
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+- EVP_MD_CTX_destroy(m_evp_md_ctx);
+-#else
+ EVP_MD_CTX_free(m_evp_md_ctx);
+-#endif
+ }
+
+ EVP_MD_CTX *get() {
+diff --git a/src/crypto/hmac.cc b/src/crypto/hmac.cc
+index 2ac4314e24..0e3f91a0c1 100644
+--- a/src/crypto/hmac.cc
++++ b/src/crypto/hmac.cc
+@@ -7,43 +7,45 @@
+
+ #include "crypto/error.hpp"
+
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
++
++inline HMAC_CTX *HMAC_CTX_new() {
++ HMAC_CTX *tmp = (HMAC_CTX *)OPENSSL_malloc(sizeof(HMAC_CTX));
++ if (tmp)
++ HMAC_CTX_init(tmp);
++ return tmp;
++}
++
++inline void HMAC_CTX_free(HMAC_CTX *ctx) {
++ if (ctx) {
++ HMAC_CTX_cleanup(ctx);
++ OPENSSL_free(ctx);
++ }
++}
++
++#endif
++
+ namespace crypto {
+
+ class hmac_ctx_wrapper_t {
+ public:
+ hmac_ctx_wrapper_t() {
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+- HMAC_CTX_init(&m_hmac_ctx);
+-#else
+ m_hmac_ctx = HMAC_CTX_new();
+ if (m_hmac_ctx == nullptr) {
+ throw openssl_error_t(ERR_get_error());
+ }
+-#endif
+ }
+
+ ~hmac_ctx_wrapper_t() {
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+- HMAC_CTX_cleanup(&m_hmac_ctx);
+-#else
+ HMAC_CTX_free(m_hmac_ctx);
+-#endif
+ }
+
+ HMAC_CTX *get() {
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+- return &m_hmac_ctx;
+-#else
+ return m_hmac_ctx;
+-#endif
+ }
+
+ private:
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+- HMAC_CTX m_hmac_ctx;
+-#else
+ HMAC_CTX *m_hmac_ctx;
+-#endif
+ };
+
+ std::array<unsigned char, SHA256_DIGEST_LENGTH> detail::hmac_sha256(
+diff --git a/src/crypto/initialization_guard.cc b/src/crypto/initialization_guard.cc
+index ba0503efc6..f76ffd96da 100644
+--- a/src/crypto/initialization_guard.cc
++++ b/src/crypto/initialization_guard.cc
+@@ -14,16 +14,17 @@
+ #include "arch/io/concurrency.hpp"
+ #include "arch/runtime/runtime.hpp"
+
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
++#define OPENSSL_init_ssl(x, y) SSL_library_init()
++#define OPENSSL_init_crypto(x, y) SSL_load_error_strings()
++#define OPENSSL_cleanup ERR_free_strings
++#endif
++
+ namespace crypto {
+
+ initialization_guard_t::initialization_guard_t() {
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+- SSL_library_init();
+- SSL_load_error_strings();
+-#else
+ OPENSSL_init_ssl(0, nullptr);
+ OPENSSL_init_crypto(0, nullptr);
+-#endif
+
+ // Make OpenSSL thread-safe by registering the required callbacks
+ CRYPTO_THREADID_set_callback([](CRYPTO_THREADID *thread_out) {
+@@ -49,11 +50,7 @@ initialization_guard_t::initialization_guard_t() {
+ }
+
+ initialization_guard_t::~initialization_guard_t() {
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+- ERR_free_strings();
+-#else
+ OPENSSL_cleanup();
+-#endif
+ }
+
+ } // namespace crypto
+--
+2.11.0
+
diff --git a/dev-db/rethinkdb/rethinkdb-2.3.5.ebuild b/dev-db/rethinkdb/rethinkdb-2.3.5.ebuild
index e9ee79bfdde..75c166abc66 100644
--- a/dev-db/rethinkdb/rethinkdb-2.3.5.ebuild
+++ b/dev-db/rethinkdb/rethinkdb-2.3.5.ebuild
@@ -34,6 +34,7 @@ pkg_setup() {
PATCHES=(
"${FILESDIR}"/${PN}-2.3.5-gcc6.patch
+ "${FILESDIR}"/${PN}-2.3.5-libressl.patch
)
src_prepare() {
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-13 8:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-13 8:09 [gentoo-commits] repo/gentoo:master commit in: dev-db/rethinkdb/, dev-db/rethinkdb/files/ Alexys Jacob
-- strict thread matches above, loose matches on Subject: below --
2016-09-02 6:45 Alexys Jacob
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox