diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-db/rethinkdb |
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-db/rethinkdb')
-rw-r--r-- | dev-db/rethinkdb/Manifest | 8 | ||||
-rw-r--r-- | dev-db/rethinkdb/files/rethinkdb.confd | 12 | ||||
-rw-r--r-- | dev-db/rethinkdb/files/rethinkdb.initd | 49 | ||||
-rw-r--r-- | dev-db/rethinkdb/files/rethinkdb.service | 13 | ||||
-rw-r--r-- | dev-db/rethinkdb/files/rethinkdb.tmpfilesd | 1 | ||||
-rw-r--r-- | dev-db/rethinkdb/metadata.xml | 19 | ||||
-rw-r--r-- | dev-db/rethinkdb/rethinkdb-2.3.5.ebuild | 134 |
7 files changed, 236 insertions, 0 deletions
diff --git a/dev-db/rethinkdb/Manifest b/dev-db/rethinkdb/Manifest new file mode 100644 index 000000000000..af1c839b4e5f --- /dev/null +++ b/dev-db/rethinkdb/Manifest @@ -0,0 +1,8 @@ +AUX rethinkdb.confd 606 SHA256 5d659a409a7b1a502a6362b818b01c1eb5f12e1bed273e9e876cc43758464659 SHA512 3a07f9c78ef96b2ca37fca508ee14a644d3c08612f662ba5260182fbfcceba064d20253f1261f56dc0a2c28d1a4d5e2320872c3c4e7595cb7ab4e202eb28ad42 WHIRLPOOL 2598d32113314f60b9e64048ba148c6fb3653ab92f833da13cc58b080996b988a20a61b8821634889c735628421609cee36c88dede66d89d5de071011a7afc57 +AUX rethinkdb.initd 1645 SHA256 fea58f7423e160abd7470abcea821b5d502dff0314e94e81c5cbd0acbbbfc3d3 SHA512 4449b8a4d25232a1d8f375f161d3801d67d93756bd9b3e2f33b58a87e8a257e2e94e47f8aa4a74b69df3da528ffc349f15198a939552c3b5b9ffaacc18a096a9 WHIRLPOOL 6d1c2744ea27f9351e0165f711148581dadf472a7f88e65f08b23040f0e82c1c920e46506981550f3de0370017f96ae32dbac2ebbe12cc0f67ad3654586b564b +AUX rethinkdb.service 261 SHA256 c831f179b0973ea5abb205a5aae3f4597d09bc7575f3a75fa6db5c32fce5f5ee SHA512 70389797ae79481b7d47b45f1676bd0531bc830a2f2daf7baec87533a7a6a0e67177572bab7d42324fe719f8a056899babc5ab2358a679c6a59899ed1272374b WHIRLPOOL 7e0259a1678a216a44ee1b64df65ad8c3d653887a392ed371b027f17fa91cc9cb1f315fdce4071e8c1403e9af7891d772089f85fb9291981fdbca08ed3e46b6a +AUX rethinkdb.tmpfilesd 43 SHA256 656d3a42e75d087e723f71aa320fdd91cbbb82071ef72eb11fd3e4a619b429a4 SHA512 5996f72b8e08aac80285373e8e1b5a664177e9d0e8d13e5638c6b821fe5b7a0368001fbfa9ef3f6709dabf0616abcabea40adc4808d176572f8f99b7a3255bae WHIRLPOOL 84ff192ff84922155cfacb26e8f9255d506c0733472d5b674ea61e1c2f805a0293da0f69622d52bd21b2822dcaaf3a641c2ec39321283af0b3f00b0fb37ba2c9 +DIST rethinkdb-2.3.5.tgz 76829628 SHA256 dd8aeee169b177179bfe080725f0560443e0f26dae875b32ae25d90cf2f8ee10 SHA512 ac71656fd2451fd36432fa0f7d2c16c2be53888f748d88f0bfc2fb9ad7cd3c704b56551bc35eda72eb08fffdd799727a3cbe83830337cf71e17c159588d33c94 WHIRLPOOL 533a0a4db02672c4310ebd99a18517ff8a6e571e1c9a1c6b8f8ddc40e8b76c0506a56986857469a15ff74b6f80d2e5c830c0d606f67e4bf70eac4d59c7356652 +EBUILD rethinkdb-2.3.5.ebuild 3796 SHA256 2a2e3cd89d5323bd8f52fd899b82bf8e0328263b6806c4281102b0524ef97745 SHA512 95a8f533a12a939e03d5bab2076574bdd0c1c5f5cf1c5e45722c1bfd580f79a36c56fb903f063a057b0d3381317ff12577d4b1c5ae75fc4969d0d4d714513897 WHIRLPOOL bc29c69d86071912e33fa4ac6ebed4d5918bc345fdcb66d045be2d02e3b43934a628f0629c2a7cbb8d2f517d0c196b6205cdbb5678b94f05fda1e1c2c04a858f +MISC ChangeLog 811 SHA256 e88527a22732eb4670de3a12c546448deb0e77e1af8f70faa797b66cf850e09e SHA512 620ee0dbb9ecfc0c9244ab9caadd4f03948dfe9edb08596289ec5ac5166f8ceca1410752d272cb45398654b6299a8c78032bb91ac0ef7a8f1cf469a398942ccb WHIRLPOOL c811b8598672e07f87103fdce8883a9a5872d50bd59b78bfb0e961aa598c6567e46eb74f2149d26760340d620c958d19f93dc62ede049edada26fb86b39ce999 +MISC metadata.xml 584 SHA256 78e93ccdd027b576957d5e3cd8fcc3ca75150d2591d70a4fd60f35c8c170293f SHA512 50641820a4f298ad66ceedafcb388b8f99d2732e0e7de9c0aa412d75482488a9d382845802ea55a451c39890ff5167715f47e3346aad29992fd3bc069d097dae WHIRLPOOL faf720da7b8edb0781aa3985e448c049fe8027bfec7771a2f6319b3a60f4aaf94b0218230760ec0c4000a9eab6557fc2ae1dcaefb4ccc3b80b3657366912fabc diff --git a/dev-db/rethinkdb/files/rethinkdb.confd b/dev-db/rethinkdb/files/rethinkdb.confd new file mode 100644 index 000000000000..af65794a44bd --- /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 000000000000..9f55aa49c8e6 --- /dev/null +++ b/dev-db/rethinkdb/files/rethinkdb.initd @@ -0,0 +1,49 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +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 000000000000..09645c2ae6ab --- /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 000000000000..694501e8ab55 --- /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 000000000000..91224a49a819 --- /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.5.ebuild b/dev-db/rethinkdb/rethinkdb-2.3.5.ebuild new file mode 100644 index 000000000000..7dafd2bc1039 --- /dev/null +++ b/dev-db/rethinkdb/rethinkdb-2.3.5.ebuild @@ -0,0 +1,134 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +inherit python-utils-r1 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-libs/re2-0.2016.05.01 + dev-cpp/gtest + dev-libs/boost + dev-libs/protobuf-c + net-misc/curl + sys-libs/libunwind + sys-libs/ncurses:= + jemalloc? ( >=dev-libs/jemalloc-4.0 ) + 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() { + python_export python2.7 EPYTHON + 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} start" +} |