dev-util/buildbot-worker: New buildbot-0.9 worker (slave)
authorBrian Dolbec <dolsen@gentoo.org>
Tue, 9 Aug 2016 21:50:15 +0000 (14:50 -0700)
committerBrian Dolbec <dolsen@gentoo.org>
Tue, 9 Aug 2016 23:47:21 +0000 (16:47 -0700)
This new package replaces the dev-util/buildbot-slave package.
This new build slave is not comaptible with buildbot versions prior to 0.9*.

Package-Manager: portage-2.3.0

dev-util/buildbot-worker/Manifest [new file with mode: 0644]
dev-util/buildbot-worker/buildbot-worker-0.9.0_rc1.ebuild [new file with mode: 0644]
dev-util/buildbot-worker/buildbot-worker-9999.ebuild [new file with mode: 0644]
dev-util/buildbot-worker/files/buildbot_worker.confd [new file with mode: 0644]
dev-util/buildbot-worker/files/buildbot_worker.initd [new file with mode: 0644]
dev-util/buildbot-worker/files/buildbot_worker.service [new file with mode: 0644]
dev-util/buildbot-worker/metadata.xml [new file with mode: 0644]

diff --git a/dev-util/buildbot-worker/Manifest b/dev-util/buildbot-worker/Manifest
new file mode 100644 (file)
index 0000000..f5d3c01
--- /dev/null
@@ -0,0 +1 @@
+DIST buildbot-worker-0.9.0rc1.tar.gz 98041 SHA256 5fc9bc888aee3af5e144c51a6c11d8f5afe57e459644749c66b495e82fba7e7e SHA512 c9201649d8af74bc988032a69c20b220bf70b2fe7bba7eb27638408a34f2d82b90f6421a39f3a2af8cfbe8ea11429dc04faa1de635bff77fd5a9b13c9d78f167 WHIRLPOOL 6205a8bc018a65674e955fa6edeb9f32ec1f0dbc05bf50f649cab7271f506cfad61c8556a05c0d2185f364b9b9a493130bdea2e798cd96238f7b0797f6d12257
diff --git a/dev-util/buildbot-worker/buildbot-worker-0.9.0_rc1.ebuild b/dev-util/buildbot-worker/buildbot-worker-0.9.0_rc1.ebuild
new file mode 100644 (file)
index 0000000..b59c113
--- /dev/null
@@ -0,0 +1,67 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+
+EGIT_REPO_URI="https://github.com/buildbot/buildbot.git"
+
+[[ ${PV} == *9999 ]] && inherit git-r3
+inherit readme.gentoo user distutils-r1
+
+DESCRIPTION="BuildBot Slave Daemon"
+HOMEPAGE="http://trac.buildbot.net/ http://code.google.com/p/buildbot/ http://pypi.python.org/pypi/buildbot-slave"
+
+MY_PV="${PV/_p/p}"
+MY_V="0.9.0rc1"
+MY_P="${PN}-${MY_V}"
+[[ ${PV} == *9999 ]] || SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+if [[ ${PV} == *9999 ]]; then
+       KEYWORDS=""
+else
+       KEYWORDS="~amd64"
+fi
+IUSE="test"
+
+RDEPEND=">=dev-python/setuptools-21.2.1[${PYTHON_USEDEP}]
+       || ( >=dev-python/twisted-core-8.0.0[${PYTHON_USEDEP}]
+                <dev-python/twisted-16.3.0[${PYTHON_USEDEP}]
+       )
+       dev-python/future[${PYTHON_USEDEP}]
+       !<dev-util/buildbot-0.9.0_rc1"
+DEPEND="${RDEPEND}
+       test? ( dev-python/mock[${PYTHON_USEDEP}] )"
+
+S="${WORKDIR}/${MY_P}"
+[[ ${PV} == *9999 ]] && S=${S}/slave
+
+pkg_setup() {
+       enewuser buildbot
+
+       DOC_CONTENTS="The \"buildbot\" user and the \"buildbot_worker\" init script has been added
+               to support starting buildbot_worker through Gentoo's init system. To use this,
+               set up your build worker following the documentation, make sure the
+               resulting directories are owned by the \"buildbot\" user and point
+               \"${ROOT}etc/conf.d/buildbot_worker\" at the right location.  The scripts can
+               run as a different user if desired. If you need to run more than one
+               build worker, just copy the scripts."
+}
+
+python_install_all() {
+       distutils-r1_python_install_all
+
+       doman docs/buildbot-worker.1
+
+       newconfd "${FILESDIR}/buildbot_worker.confd" buildbot_worker
+       newinitd "${FILESDIR}/buildbot_worker.initd" buildbot_worker
+
+       readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+       readme.gentoo_print_elog
+}
diff --git a/dev-util/buildbot-worker/buildbot-worker-9999.ebuild b/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
new file mode 100644 (file)
index 0000000..1c363da
--- /dev/null
@@ -0,0 +1,67 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+
+EGIT_REPO_URI="https://github.com/buildbot/buildbot.git"
+
+[[ ${PV} == *9999 ]] && inherit git-r3
+inherit readme.gentoo user distutils-r1
+
+DESCRIPTION="BuildBot Slave Daemon"
+HOMEPAGE="http://trac.buildbot.net/ http://code.google.com/p/buildbot/ http://pypi.python.org/pypi/buildbot-slave"
+
+MY_PV="${PV/_p/p}"
+MY_V="0.9.0rc1"
+MY_P="${PN}-${MY_V}"
+[[ ${PV} == *9999 ]] || SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+if [[ ${PV} == *9999 ]]; then
+       KEYWORDS=""
+else
+       KEYWORDS="~amd64"
+fi
+IUSE="test"
+
+RDEPEND=">=dev-python/setuptools-21.2.1[${PYTHON_USEDEP}]
+       || ( >=dev-python/twisted-core-8.0.0[${PYTHON_USEDEP}]
+                <dev-python/twisted-16.3.0[${PYTHON_USEDEP}]
+       )
+       dev-python/future[${PYTHON_USEDEP}]
+       !<dev-util/buildbot-0.9.0_rc1"
+DEPEND="${RDEPEND}
+       test? ( dev-python/mock[${PYTHON_USEDEP}] )"
+
+S="${WORKDIR}/${MY_P}"
+[[ ${PV} == *9999 ]] && S=${S}/slave
+
+pkg_setup() {
+       enewuser buildbot
+
+       DOC_CONTENTS="The \"buildbot\" user and the \"buildbot_worker\" init script has been added
+               to support starting buildbot_worker through Gentoo's init system. To use this,
+               set up your build worker following the documentation, make sure the
+               resulting directories are owned by the \"buildbot\" user and point
+               \"${ROOT}etc/conf.d/buildbot_worker\" at the right location.  The scripts can
+               run as a different user if desired. If you need to run more than one
+               build worker, just copy the scripts."
+}
+
+python_install_all() {
+       distutils-r1_python_install_all
+
+       doman docs/buildbot-worker.1
+
+       newconfd "${FILESDIR}/buildbot_worker.confd" buildslave
+       newinitd "${FILESDIR}/buildbot_worker.initd" buildslave
+
+       readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+       readme.gentoo_print_elog
+}
diff --git a/dev-util/buildbot-worker/files/buildbot_worker.confd b/dev-util/buildbot-worker/files/buildbot_worker.confd
new file mode 100644 (file)
index 0000000..7e77999
--- /dev/null
@@ -0,0 +1,9 @@
+# Path to the build slave's basedir.
+BASEDIR="/var/lib/buildbot_worker"
+
+# User account for the buildslave.
+# The basedir should be owned by this user.
+USERNAME="buildbot"
+
+# Extra options passed to twistd.
+TWISTD_OPTS=""
diff --git a/dev-util/buildbot-worker/files/buildbot_worker.initd b/dev-util/buildbot-worker/files/buildbot_worker.initd
new file mode 100644 (file)
index 0000000..5301ed5
--- /dev/null
@@ -0,0 +1,48 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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}/buildbot.tac" ]; then
+               eerror "${BASEDIR} does not contain buildbot.tac"
+               return 1
+       fi
+}
+
+start() {
+       checkconfig || return 1
+       ebegin "Starting buildslave in ${BASEDIR}"
+       # We set HOME here to make something valid show up in the env of child
+       # processes spawned by the buildslave.
+       start-stop-daemon --start -u "${USERNAME}" \
+               --pidfile "${BASEDIR}/buildbot_worker.pid" \
+               --env HOME="${BASEDIR}" \
+               --exec /usr/bin/twistd -- \
+               --no_save \
+               --logfile="${BASEDIR}/twistd.log" \
+               --pidfile="${BASEDIR}/buildbot_worker.pid" \
+               --python="${BASEDIR}/buildbot.tac"
+       eend $?
+}
+
+stop() {
+       ebegin "Stopping buildslave in ${BASEDIR}"
+       start-stop-daemon --stop --pidfile "${BASEDIR}/buildbot_worker.pid"
+       eend $?
+}
diff --git a/dev-util/buildbot-worker/files/buildbot_worker.service b/dev-util/buildbot-worker/files/buildbot_worker.service
new file mode 100644 (file)
index 0000000..e75a2d5
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=buildbot worker (slave) instances
+After=local-fs.target network.target
+
+[Service]
+Type=forking
+User=buildbot
+ExecStart=/usr/bin/buildbot_worker start /var/lib/buildbot_worker
+ExecStop=/usr/bin/buildbot_worker stop /var/lib/buildbot_worker
+
+[Install]
+WantedBy=multi-user.target
diff --git a/dev-util/buildbot-worker/metadata.xml b/dev-util/buildbot-worker/metadata.xml
new file mode 100644 (file)
index 0000000..973ff7f
--- /dev/null
@@ -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>hwoarang@gentoo.org</email>
+               <name>Markos Chandras</name>
+       </maintainer>
+       <maintainer type="person">
+               <email>dolsen@gentoo.org</email>
+               <name>Brian Dolbec</name>
+       </maintainer>
+       <upstream>
+               <maintainer>
+                       <email>devel@buildbot.net</email>
+                       <name>Developers List</name>
+               </maintainer>
+               <remote-id type="pypi">buildbot-slave</remote-id>
+       </upstream>
+</pkgmetadata>