summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2017-09-16 00:06:48 +0000
committerBrian Dolbec <dolsen@gentoo.org>2017-09-16 14:47:39 +0000
commit3fb1500d20bab2a97bdd1242787e4e3979138709 (patch)
tree97d31c130c33d8685bcc794fc5e0def6dac1057e /net-misc/crossbar
parentnet-analyzer/zabbix: Bump to 3.4 (diff)
downloadgentoo-3fb1500d20bab2a97bdd1242787e4e3979138709.tar.gz
gentoo-3fb1500d20bab2a97bdd1242787e4e3979138709.tar.bz2
gentoo-3fb1500d20bab2a97bdd1242787e4e3979138709.zip
net-misc/crossbar: initial pkg move
Add init scripts, conf.d and a sample config.json. Improve the ebuild, add a pkg_config()
Diffstat (limited to 'net-misc/crossbar')
-rw-r--r--net-misc/crossbar/Manifest1
-rw-r--r--net-misc/crossbar/crossbar-17.6.1_p3-r1.ebuild156
-rw-r--r--net-misc/crossbar/files/confd11
-rw-r--r--net-misc/crossbar/files/config.json.sample60
-rw-r--r--net-misc/crossbar/files/crossbar.service12
-rw-r--r--net-misc/crossbar/files/initd35
-rw-r--r--net-misc/crossbar/metadata.xml22
7 files changed, 297 insertions, 0 deletions
diff --git a/net-misc/crossbar/Manifest b/net-misc/crossbar/Manifest
new file mode 100644
index 000000000000..37f6c5d045f2
--- /dev/null
+++ b/net-misc/crossbar/Manifest
@@ -0,0 +1 @@
+DIST crossbar-17.6.1.post3.tar.gz 725054 SHA256 8d023af0a772404f4e57add5888583fc0068d62a7a2249bea4539a6d7b70fbd9 SHA512 c3efac2c7f7a41e6544eb98057afb249908453d6ddfb81c514f0705ed967374d50f844fe1a80395652b81a7c23abc90a03a0d6c88287f10cbfe99e64cb70919d WHIRLPOOL 08555f6cecbc57ab447569864cec75993fb8aea485ce7c85aefb1530b950b5913371e73d384e15ce539445f759c4f74a35457ef4ef2fc8791c0802325cebdc7b
diff --git a/net-misc/crossbar/crossbar-17.6.1_p3-r1.ebuild b/net-misc/crossbar/crossbar-17.6.1_p3-r1.ebuild
new file mode 100644
index 000000000000..4b88c769f4a2
--- /dev/null
+++ b/net-misc/crossbar/crossbar-17.6.1_p3-r1.ebuild
@@ -0,0 +1,156 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+# Not quite ready for py3, unconditionally deps on too many backported
+# pkgs installed in newer pythons that shouldn't need them.
+PYTHON_COMPAT=( python2_7 )
+
+inherit user systemd distutils-r1
+
+MY_PV="17.6.1.post3"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Crossbar.io - The Unified Application Router for the twisted framework"
+HOMEPAGE="http://crossbar.io/ https://github.com/crossbario/crossbar https://pypi.python.org/pypi/crossbar"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz"
+
+LICENSE="AGPL-3"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="test"
+
+RDEPEND="
+ >=dev-python/setuptools-36.0.1[${PYTHON_USEDEP}]
+ >=dev-python/twisted-17.5.0[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep '>=dev-python/enum34-1.1.6[${PYTHON_USEDEP}]' python2_7)
+ >=dev-python/txaio-2.8.0[${PYTHON_USEDEP}]
+ >=dev-python/pyasn1-0.2.3[${PYTHON_USEDEP}]
+ >=dev-python/pyasn1-modules-0.0.9[${PYTHON_USEDEP}]
+ >=dev-python/incremental-17.5.0[${PYTHON_USEDEP}]
+ >=dev-python/zope-interface-4.4.2[${PYTHON_USEDEP}]
+ <dev-python/hyper-h2-3.0.0[${PYTHON_USEDEP}]
+ >=dev-python/priority-1.3.0[${PYTHON_USEDEP}]
+ >=dev-python/service_identity-17.0.0[${PYTHON_USEDEP}]
+ >=dev-python/pyopenssl-17.1.0[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-1.9.0[${PYTHON_USEDEP}]
+ >=dev-python/autobahn-17.6.2[${PYTHON_USEDEP}]
+ >=dev-python/jinja-2.9.6[${PYTHON_USEDEP}]
+ >=dev-python/treq-17.3.1[${PYTHON_USEDEP}]
+ >=dev-python/pyyaml-3.12[${PYTHON_USEDEP}]
+ >=dev-python/click-6.7[${PYTHON_USEDEP}]
+ >=dev-python/attrs-17.2.0[${PYTHON_USEDEP}]
+ >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep '>=dev-python/ipaddress-1.0.18[${PYTHON_USEDEP}]' python2_7)
+ >=dev-python/cbor-1.0.0[${PYTHON_USEDEP}]
+ >=dev-python/bitstring-3.1.5[${PYTHON_USEDEP}]
+ >=dev-python/pygments-2.2.0[${PYTHON_USEDEP}]
+ >=dev-python/pytrie-0.3[${PYTHON_USEDEP}]
+ >=dev-python/psutil-5.2.2[${PYTHON_USEDEP}]
+ >=dev-python/py-ubjson-0.9.0[${PYTHON_USEDEP}]
+ >=dev-python/pynacl-1.1.2[${PYTHON_USEDEP}]
+ >=dev-python/pyqrcode-1.2.1[${PYTHON_USEDEP}]
+ >=dev-python/lmdb-0.92[${PYTHON_USEDEP}]
+ >=dev-python/mistune-0.7.4[${PYTHON_USEDEP}]
+ >=dev-python/netaddr-0.7.19[${PYTHON_USEDEP}]
+ >=dev-python/setproctitle-1.1.10[${PYTHON_USEDEP}]
+ >=dev-python/sdnotify-0.3.1[${PYTHON_USEDEP}]
+ >=dev-python/shutilwhich-1.1.0[${PYTHON_USEDEP}]
+ >=dev-python/u-msgpack-2.4.1[${PYTHON_USEDEP}]
+ >=dev-python/watchdog-0.8.3[${PYTHON_USEDEP}]
+"
+DEPEND="
+ !dev-python/crossbar
+ >=dev-python/setuptools-36.0.1[${PYTHON_USEDEP}]
+ >=dev-python/twisted-17.5.0[${PYTHON_USEDEP}]
+ test? (
+ dev-python/mock[${PYTHON_USEDEP}]
+ )
+"
+DOCS=(
+ README.rst LICENSE-FOR-API LICENSE COPYRIGHT
+)
+
+S="${WORKDIR}"/${MY_P}
+
+python_prepare_all() {
+ # don't install the copyright, license... let dodoc do it
+ sed -e "s/^ data_files=.*//" -i setup.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+pkg_setup() {
+ enewuser crossbar
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ keepdir /var/lib/crossbar
+ insinto /var/lib/crossbar
+ doins "${FILESDIR}/config.json.sample"
+
+ newconfd "${FILESDIR}/confd" crossbar
+ newinitd "${FILESDIR}/initd" crossbar
+}
+
+pkg_posinst() {
+ einfo "For exapmle configurations and scripts"
+ einfo "See: https://github.com/crossbario/crossbar-examples"
+
+ if [[ -n ${REPLACING_VERSIONS} ]]; then
+ ewarn
+ ewarn "Starting with net-misc/crossbar-17.6.1_p3-r1, more than one instance of crossbar"
+ ewarn "can be run simultaneously. Note that \"BASEDIR\" in the crossbar conf.d/crossbar file"
+ ewarn "is the common base directory for all instances. If you are migrating from an older"
+ ewarn "version, make sure that you copy the current contents of \"BASEDIR\" to a subdirectory."
+ ewarn "The name of the subdirectory corresponds to the name of the buildbot_worker instance."
+ ewarn "In order to start the service running OpenRC-based systems need to link to the init file:"
+ ewarn " ln --symbolic --relative /etc/init.d/crossbar /etc/init.d/crossbar.myinstance"
+ ewarn " rc-update add crossbar.myinstance default"
+ ewarn " /etc/init.d/crossbar.myinstance start"
+ ewarn "Systems using systemd can do the following:"
+ ewarn " systemctl enable crossbar@myinstance.service"
+ ewarn " systemctl enable crossbar.target"
+ ewarn " systemctl start crossbar.target"
+ fi
+}
+
+pkg_config() {
+ local crossbar_path="/var/lib/crossbar"
+ local log_path="/var/log/crossbar"
+ einfo "This will prepare a new crossbar instance in ${crossbar_path}."
+ einfo "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_path="${crossbar_path}/${instance_name}"
+ local instance_log_path="${log_path}/${instance_name}"
+
+ if [[ -e "${instance_path}" ]]; then
+ eerror "The instance with the specified name already exists:"
+ eerror "${instance_path}"
+ die "Instance already exists"
+ fi
+
+ if [[ ! -d "${instance_path}" ]]; then
+ mkdir --parents "${instance_path}" || die "Unable to create directory ${crossbar_path}"
+ fi
+ chown --recursive crossbar "${instance_path}" || die "Setting permissions for instance failed"
+ cp "${crossbar_path}/config.json.sample" "${instance_path}/config.json" \
+ || die "Moving sample configuration failed"
+ ln --symbolic --relative "/etc/init.d/crossbar" "/etc/init.d/crossbar.${instance_name}" \
+ || die "Unable to create link to init file"
+
+ if [[ ! -d "${instance_log_path}" ]]; then
+ mkdir --parents "${instance_log_path}" || die "Unable to create directory ${instance_log_path}"
+ fi
+ ln --symbolic --relative "${instance_log_path}/node.log" "${instance_path}/node.log" \
+ || die "Unable to create link to log file"
+
+ einfo "Successfully created a crossbar instance at ${instance_path}."
+ einfo "To change the default settings edit the config.json file in this directory."
+}
diff --git a/net-misc/crossbar/files/confd b/net-misc/crossbar/files/confd
new file mode 100644
index 000000000000..e4a914f640fd
--- /dev/null
+++ b/net-misc/crossbar/files/confd
@@ -0,0 +1,11 @@
+# Path to the wamp router basedir.
+BASEDIR="/var/lib/crossbar"
+
+# User account for the crossbar router.
+# The basedir should be owned by this user.
+USERNAME="crossbar"
+
+# loglevel {none,error,warn,info,debug,trace}
+# How much Crossbar.io should log to the terminal, in
+# order of verbosity.
+LOGLEVEL="info"
diff --git a/net-misc/crossbar/files/config.json.sample b/net-misc/crossbar/files/config.json.sample
new file mode 100644
index 000000000000..d7b7d6af7300
--- /dev/null
+++ b/net-misc/crossbar/files/config.json.sample
@@ -0,0 +1,60 @@
+{
+ "version": 2,
+ "controller": {},
+ "workers": [
+ {
+ "type": "router",
+ "realms": [
+ {
+ "name": "realm1",
+ "roles": [
+ {
+ "name": "anonymous",
+ "permissions": [
+ {
+ "uri": "",
+ "match": "prefix",
+ "allow": {
+ "call": true,
+ "register": true,
+ "publish": true,
+ "subscribe": true
+ },
+ "disclose": {
+ "caller": false,
+ "publisher": false
+ },
+ "cache": true
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "transports": [
+ {
+ "type": "universal",
+ "endpoint": {
+ "type": "tcp",
+ "port": 8080
+ },
+ "rawsocket": {
+ },
+ "websocket": {
+ "ws": {
+ "type": "websocket"
+ }
+ },
+ "web": {
+ "paths": {
+ "/": {
+ "type": "static",
+ "directory": "../web"
+ }
+ }
+ }
+ }
+ ]
+ }
+ ]
+}
diff --git a/net-misc/crossbar/files/crossbar.service b/net-misc/crossbar/files/crossbar.service
new file mode 100644
index 000000000000..915974751f8e
--- /dev/null
+++ b/net-misc/crossbar/files/crossbar.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=crossbar wamp router instances
+After=local-fs.target network.target
+
+[Service]
+Type=forking
+User=crossbar
+ExecStart=/usr/bin/crossbar start /var/lib/crossbar
+ExecStop=/usr/bin/crossbar stop /var/lib/crossbar
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-misc/crossbar/files/initd b/net-misc/crossbar/files/initd
new file mode 100644
index 000000000000..565dfb304aea
--- /dev/null
+++ b/net-misc/crossbar/files/initd
@@ -0,0 +1,35 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+NODE=${RC_SVCNAME:9}
+
+command=/usr/bin/crossbar
+command_args="start --cbdir=${BASEDIR}/${NODE} --logtofile --colour=false --loglevel=${LOGLEVEL}"
+command_background=true
+description="start crossbar wamp router for ${NODE}"
+pidfile="${BASEDIR}/${NODE}/crossbar.pid"
+
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ -z "${BASEDIR}" ]; then
+ eerror "BASEDIR not set"
+ return 1
+ fi
+ if [ -z "${USERNAME}" ]; then
+ eerror "USERNAME not set"
+ return 1
+ fi
+ if [ ! -d "${BASEDIR}" ]; then
+ eerror "${BASEDIR} is not a directory"
+ return 1
+ fi
+ if [ ! -e "${BASEDIR}/${NODE}" ]; then
+ eerror "${BASEDIR} does not contain a ${NODE} sub directory"
+ return 1
+ fi
+}
diff --git a/net-misc/crossbar/metadata.xml b/net-misc/crossbar/metadata.xml
new file mode 100644
index 000000000000..254c332dbb0b
--- /dev/null
+++ b/net-misc/crossbar/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>dolsen@gentoo.org</email>
+ <description>Primary maintainer</description>
+ </maintainer>
+ <upstream>
+ <maintainer>
+ <name>Crossbar.io Technologies GmbH</name>
+ </maintainer>
+ <remote-id type="pypi">crossbar</remote-id>
+ <remote-id type="github">crossbariocrossbar</remote-id>
+ </upstream>
+ <longdescription>
+ Crossbar.io is an open source networking platform
+ for distributed and microservice applications. It implements the
+ open Web Application Messaging Protocol (WAMP), is feature rich,
+ scalable, robust and secure. Let Crossbar.io take care of the
+ hard parts of messaging so you can focus on your app's features.
+ </longdescription>
+</pkgmetadata>