commit:     29ea36efca2dcb65edacf603b70205a5a59b5832
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 14 23:15:51 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Sep 15 17:41:12 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=29ea36ef

dev-util/buildbot-worker: Version bump, fix pkg_config()

Include a sample buildbot.tac file.
Remove older 0.9.10 ebuild versions.

Package-Manager: Portage-2.3.6, Repoman-2.3.3

 dev-util/buildbot-worker/Manifest                  |  1 +
 ...-r1.ebuild => buildbot-worker-0.9.10-r2.ebuild} |  7 +-
 .../buildbot-worker/buildbot-worker-0.9.10.ebuild  | 74 ----------------------
 ...r-9999.ebuild => buildbot-worker-0.9.11.ebuild} |  7 +-
 .../buildbot-worker/buildbot-worker-9999.ebuild    |  7 +-
 dev-util/buildbot-worker/files/buildbot.tac.sample | 70 ++++++++++++++++++++
 6 files changed, 83 insertions(+), 83 deletions(-)

diff --git a/dev-util/buildbot-worker/Manifest 
b/dev-util/buildbot-worker/Manifest
index d38d1bf39f8..be50c03bdc7 100644
--- a/dev-util/buildbot-worker/Manifest
+++ b/dev-util/buildbot-worker/Manifest
@@ -1,4 +1,5 @@
 DIST buildbot-worker-0.9.10.tar.gz 99028 SHA256 
1793631d74629cd73bc0df1fadf28fb34d87e63aa72cba82058122bde165a824 SHA512 
0f515610d9c788657b10ba6624745841241fe554b472e53abdda221a678eb73d7a21a6529eb0769450de3a79b43bb6e51f4208247a4d8ef25c3d36b6ced6ec89
 WHIRLPOOL 
67cb199328428167c7e52f7b6ecbe7aa73729b5b453b5a8c16ba4999502bf30d9b139788f755eb4811968a60ce61fde32cdc29a31242d3777302792bb04863a6
+DIST buildbot-worker-0.9.11.tar.gz 100746 SHA256 
4254bf964465acb6586fda36b26a424466a265b6a5259138cf4fa63a1e9f6851 SHA512 
c7209c3fff8c43a23de71fa61709c9f02a5bdd9c8c8980ac5d205f720abdaa9bdb78d0d4e40fe9f915c8d5cf253b9e3c63401712ee121ac085909b0244d82897
 WHIRLPOOL 
30e1fb17eda975ff3a1e333a0ae17bdc2b432bd9c139a0c1f8dbea69984311add3a6f0659b7add0a3fecc2acf9460a908709efa8994f5763bfbbd2618df67050
 DIST buildbot-worker-0.9.4.tar.gz 100889 SHA256 
129e0d3fa9ee34f0f227487b6d1645820d2d4853099a1b0aed56587d3acab965 SHA512 
7d055b7b005ebf1cc8033fb86f5321a9d80e0505c1a8b28b9ba3945323f157d34f34066ee9513e82b05c63af099d6030bf42d6f44533859b4e01983f1114462b
 WHIRLPOOL 
8f2b95a476e93beaba5305137bb1d219a9aff59e8bb4450d6352babe799bb0166c299e7c8ea69e53c467e7e58be2681ddba4ae74ad8ba945221e1059906e5fc1
 DIST buildbot-worker-0.9.7.tar.gz 96416 SHA256 
a41b4e0c7329821a0d85ee0e6edbde3db403676c62e59a6f436a048a008ac268 SHA512 
84ccaf0472553f8422b342163e44e55481f6691338df38db6b1be74f0a79c13e2a52be56df632491662ab79648cd5034ce04d906bbedb01030e4fa96f1689ef9
 WHIRLPOOL 
70379e6f34ea30aef0e0008fd098a53ba144696f1416ac77c3756018bc371646d2261a28589ad5131f7be7de930189bd771b4a82de27343441543da5c683e122
 DIST buildbot-worker-0.9.8.tar.gz 97193 SHA256 
825e022a794c7470276169b6ac1b774f39f60d16545bb46fdf5b4a3b2c78f44f SHA512 
43cb7d83835d009c3d4f9a9671d3bd1037d50969b6238f9c77e9f1caedea83c9b9f77d642743d47ff2eea8f3c6549b9e4c843b7d9f638dc5a28339e034ea9b47
 WHIRLPOOL 
1127b956c3a94ad426c686e42dcbdf6a6f4427751c4ddf247569bc0ee03e86d1ae609263386e730d92b2a572be76208cb999c571fdee9f85de49de161a5c1ab1

diff --git a/dev-util/buildbot-worker/buildbot-worker-0.9.10-r1.ebuild 
b/dev-util/buildbot-worker/buildbot-worker-0.9.10-r2.ebuild
similarity index 95%
rename from dev-util/buildbot-worker/buildbot-worker-0.9.10-r1.ebuild
rename to dev-util/buildbot-worker/buildbot-worker-0.9.10-r2.ebuild
index 5b24f1fed3b..7bbef0496bd 100644
--- a/dev-util/buildbot-worker/buildbot-worker-0.9.10-r1.ebuild
+++ b/dev-util/buildbot-worker/buildbot-worker-0.9.10-r2.ebuild
@@ -66,6 +66,9 @@ python_install_all() {
        newconfd "${FILESDIR}/buildbot_worker.confd2" buildbot_worker
        newinitd "${FILESDIR}/buildbot_worker.initd2" buildbot_worker
 
+       dodir /var/lib/buildbot_worker
+       cp "${FILESDIR}/buildbot.tac.sample" "${D}/var/lib/buildbot_worker"|| 
die "Install failed!"
+
        readme.gentoo_create_doc
 }
 
@@ -106,13 +109,11 @@ pkg_config() {
                die "Instance already exists"
        fi
 
-       local buildbot="/usr/bin/buildbot"
        if [[ ! -d "${buildworker_path}" ]]; then
                mkdir --parents "${buildworker_path}" || die "Unable to create 
directory ${buildworker_path}"
        fi
-       "${buildbot}" create-master "${instance_path}" &>/dev/null || die 
"Creating instance failed"
        chown --recursive buildbot "${instance_path}" || die "Setting 
permissions for instance failed"
-       mv "${instance_path}/master.cfg.sample" "${instance_path}/master.cfg" \
+       cp "${buildworker_path}/buildbot.tac.sample" 
"${instance_path}/buildbot.tac" \
                || die "Moving sample configuration failed"
        ln --symbolic --relative "/etc/init.d/buildbot_worker" 
"/etc/init.d/buildbot_worker.${instance_name}" \
                || die "Unable to create link to init file"

diff --git a/dev-util/buildbot-worker/buildbot-worker-0.9.10.ebuild 
b/dev-util/buildbot-worker/buildbot-worker-0.9.10.ebuild
deleted file mode 100644
index 18aad48371c..00000000000
--- a/dev-util/buildbot-worker/buildbot-worker-0.9.10.ebuild
+++ /dev/null
@@ -1,74 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-PYTHON_COMPAT=( python2_7 python3_5 )
-
-EGIT_REPO_URI="https://github.com/buildbot/buildbot.git";
-
-[[ ${PV} == *9999 ]] && inherit git-r3
-inherit readme.gentoo user distutils-r1
-
-DESCRIPTION="BuildBot Worker (slave) Daemon"
-HOMEPAGE="https://buildbot.net/ https://github.com/buildbot/buildbot 
https://pypi.python.org/pypi/buildbot-worker";
-
-MY_PV="${PV/_p/.post}"
-MY_P="${PN}-${MY_PV}"
-[[ ${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-17.5.0[${PYTHON_USEDEP}]
-       dev-python/future[${PYTHON_USEDEP}]
-       !<dev-util/buildbot-0.9.7
-"
-DEPEND="${RDEPEND}
-       test? (
-               dev-python/mock[${PYTHON_USEDEP}]
-               dev-python/setuptools_trial[${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_test() {
-       distutils_install_for_testing
-
-       esetup.py test || die "Tests failed under ${EPYTHON}"
-}
-
-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-0.9.11.ebuild
similarity index 95%
copy from dev-util/buildbot-worker/buildbot-worker-9999.ebuild
copy to dev-util/buildbot-worker/buildbot-worker-0.9.11.ebuild
index 6c1b8bf74aa..d2bbf60849b 100644
--- a/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
+++ b/dev-util/buildbot-worker/buildbot-worker-0.9.11.ebuild
@@ -66,6 +66,9 @@ python_install_all() {
        newconfd "${FILESDIR}/buildbot_worker.confd2" buildbot_worker
        newinitd "${FILESDIR}/buildbot_worker.initd2" buildbot_worker
 
+       dodir /var/lib/buildbot_worker
+       cp "${FILESDIR}/buildbot.tac.sample" "${D}/var/lib/buildbot_worker"|| 
die "Install failed!"
+
        readme.gentoo_create_doc
 }
 
@@ -106,13 +109,11 @@ pkg_config() {
                die "Instance already exists"
        fi
 
-       local buildbot="/usr/bin/buildbot"
        if [[ ! -d "${buildworker_path}" ]]; then
                mkdir --parents "${buildworker_path}" || die "Unable to create 
directory ${buildworker_path}"
        fi
-       "${buildbot}" create-master "${instance_path}" &>/dev/null || die 
"Creating instance failed"
        chown --recursive buildbot "${instance_path}" || die "Setting 
permissions for instance failed"
-       mv "${instance_path}/master.cfg.sample" "${instance_path}/master.cfg" \
+       cp "${buildworker_path}/buildbot.tac.sample" 
"${instance_path}/buildbot.tac" \
                || die "Moving sample configuration failed"
        ln --symbolic --relative "/etc/init.d/buildbot_worker" 
"/etc/init.d/buildbot_worker.${instance_name}" \
                || die "Unable to create link to init file"

diff --git a/dev-util/buildbot-worker/buildbot-worker-9999.ebuild 
b/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
index 6c1b8bf74aa..d2bbf60849b 100644
--- a/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
+++ b/dev-util/buildbot-worker/buildbot-worker-9999.ebuild
@@ -66,6 +66,9 @@ python_install_all() {
        newconfd "${FILESDIR}/buildbot_worker.confd2" buildbot_worker
        newinitd "${FILESDIR}/buildbot_worker.initd2" buildbot_worker
 
+       dodir /var/lib/buildbot_worker
+       cp "${FILESDIR}/buildbot.tac.sample" "${D}/var/lib/buildbot_worker"|| 
die "Install failed!"
+
        readme.gentoo_create_doc
 }
 
@@ -106,13 +109,11 @@ pkg_config() {
                die "Instance already exists"
        fi
 
-       local buildbot="/usr/bin/buildbot"
        if [[ ! -d "${buildworker_path}" ]]; then
                mkdir --parents "${buildworker_path}" || die "Unable to create 
directory ${buildworker_path}"
        fi
-       "${buildbot}" create-master "${instance_path}" &>/dev/null || die 
"Creating instance failed"
        chown --recursive buildbot "${instance_path}" || die "Setting 
permissions for instance failed"
-       mv "${instance_path}/master.cfg.sample" "${instance_path}/master.cfg" \
+       cp "${buildworker_path}/buildbot.tac.sample" 
"${instance_path}/buildbot.tac" \
                || die "Moving sample configuration failed"
        ln --symbolic --relative "/etc/init.d/buildbot_worker" 
"/etc/init.d/buildbot_worker.${instance_name}" \
                || die "Unable to create link to init file"

diff --git a/dev-util/buildbot-worker/files/buildbot.tac.sample 
b/dev-util/buildbot-worker/files/buildbot.tac.sample
new file mode 100644
index 00000000000..ee3d7ca3cef
--- /dev/null
+++ b/dev-util/buildbot-worker/files/buildbot.tac.sample
@@ -0,0 +1,70 @@
+'''
+This is a sample buildbot.tac file to initalize
+a buildbot worker complete with logging.
+'''
+
+import os.path
+import socket
+
+from twisted.application import service
+from twisted.python.logfile import LogFile
+from twisted.python.log import ILogObserver, FileLogObserver
+
+from buildbot_worker.bot import Worker
+
+################################
+# Set the following variables
+# to your desired values
+#################################
+
+# use the current directory or
+# set to an absolute value
+basedir = '.'
+
+# logging
+rotateLength = 10000000
+maxRotatedFiles = 10
+
+# buildbot communication port
+port = 9989
+
+# worker settings
+worker_name = 'worker-1'
+passwd = 'mypasswd'
+buildmaster_host = 'mybuildbot.foobar.org'
+keepalive = 600
+umask = None
+maxdelay = 300
+numcpus = None
+allow_shutdown = None
+
+
+# Begin starting up the worker
+# if this is a relocatable tac file, get the directory containing the TAC
+if basedir == '.':
+    basedir = os.path.abspath(os.path.dirname(__file__))
+
+# note: this line is matched against to check that this is
+# a buildbot-worker directory; do not edit it.
+application = service.Application('buildbot-worker')
+
+# set up logging
+logfile = LogFile.fromFullPath(os.path.join(basedir, "twistd.log"),
+                               rotateLength=rotateLength,
+                               maxRotatedFiles=maxRotatedFiles
+                               )
+application.setComponent(ILogObserver, FileLogObserver(logfile).emit)
+
+worker = Worker(buildmaster_host,
+                port,
+                worker_name,
+                passwd,
+                basedir,
+                keepalive,
+                umask=umask,
+                maxdelay=maxdelay,
+                numcpus=numcpus,
+                allow_shutdown=allow_shutdown
+                )
+
+worker.setServiceParent(application)

Reply via email to