Gentoo Archives: gentoo-commits

From: Brian Dolbec <dolsen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/buildbot/files/, dev-util/buildbot/
Date: Wed, 27 Jun 2018 15:24:32
Message-Id: 1530113051.2e402f7f0de545cd4277d95650d48d832fa2ca67.dolsen@gentoo
1 commit: 2e402f7f0de545cd4277d95650d48d832fa2ca67
2 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 17 10:33:03 2018 +0000
4 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 27 15:24:11 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e402f7f
7
8 dev-util/buildbot: Version bump, removed doc use flag
9
10 Docs generation has been broken last several versions,
11 blockdiag dep is failing tests.
12 Bump EAPI.
13 Add RUNTIME_PYTHON setting in /etc/conf.d/buildbot to
14 control the desired python version used.
15
16 Package-Manager: Portage-2.3.40, Repoman-2.3.9
17
18 dev-util/buildbot/Manifest | 1 +
19 dev-util/buildbot/buildbot-1.1.2.ebuild | 185 ++++++++++++++++++++++++++++++
20 dev-util/buildbot/files/buildmaster.confd | 5 +
21 dev-util/buildbot/files/buildmaster.initd | 4 +-
22 4 files changed, 193 insertions(+), 2 deletions(-)
23
24 diff --git a/dev-util/buildbot/Manifest b/dev-util/buildbot/Manifest
25 index d2dbae0ef33..fc86e187eef 100644
26 --- a/dev-util/buildbot/Manifest
27 +++ b/dev-util/buildbot/Manifest
28 @@ -4,3 +4,4 @@ DIST buildbot-0.9.13.tar.gz 3061713 BLAKE2B fac74d610bf0ff1cfeea1c59c46e95339d6b
29 DIST buildbot-0.9.15.post1.tar.gz 3088947 BLAKE2B c9a0265d3df2a9ac01872fc7106b5b787334bd899a43fcdb6ad06aab5e0e8f1ddb4374bf5211f251f26985c3b11a0b981bdd23fb668ac1717af36443831648e6 SHA512 c5c72132fd8446fbb14467851063d192dbb817506163eacc3022d563698453c66706a895613ca1c17502dd25957b31f6409996497d2e7646ab2fdbb3fb55c31d
30 DIST buildbot-1.1.0.docs.tar.xz 23932 BLAKE2B 81da8b86bb269efd2cd3f9146f3d9b41d64b28fdd0c878708c323d040a7e773cd277a18c82b1ef3cb07759ba8aedbc604e1de84f6477205b1708c28b6e86831e SHA512 511d244ffd205989047b4514b164e194b30fe4e0513d3bda776fb4d7a1a5bf42d8b7f00540b88e427838ab43f45686a83e556687ab75ce55eae6b834426a8ef7
31 DIST buildbot-1.1.0.tar.gz 3098781 BLAKE2B 5a4ba8b641765fd58c3b5e788fc20aa1fb6195655ce2d82929f0f62ff48d20672f21efe0c413387e583d095c3ffcee1055a287016fe87ec1f3eb6b0ccdefdccb SHA512 f850ba2cd93d54a8abc97503719f93f69dfdc3d03b519e2d05c02bdc11893529eb51d74b6584555689281aedb71c3aa6c23141cf5fbc68ae97e09f1c89b2c94c
32 +DIST buildbot-1.1.2.tar.gz 3101168 BLAKE2B 35ec56440014015850a69324d475c4ca9555ad90da85b26a7a43eca74f08361137021aec72ddca37cbb24f21519ebf45948e66214291f356b4a1fbada7c0b3b8 SHA512 14c28d6fae18a10d89d41509635188d881ac76e7b61758481a9afbb22eb384d7ab5080383242e5850af13bfe46877985a91036270c3c4fbf01eafee5b7699815
33
34 diff --git a/dev-util/buildbot/buildbot-1.1.2.ebuild b/dev-util/buildbot/buildbot-1.1.2.ebuild
35 new file mode 100644
36 index 00000000000..b8140223d81
37 --- /dev/null
38 +++ b/dev-util/buildbot/buildbot-1.1.2.ebuild
39 @@ -0,0 +1,185 @@
40 +# Copyright 1999-2018 Gentoo Foundation
41 +# Distributed under the terms of the GNU General Public License v2
42 +
43 +EAPI="6"
44 +PYTHON_REQ_USE="sqlite"
45 +PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
46 +
47 +EGIT_REPO_URI="https://github.com/buildbot/${PN}.git"
48 +
49 +[[ ${PV} == *9999 ]] && inherit git-r3
50 +inherit readme.gentoo-r1 user systemd distutils-r1
51 +
52 +MY_PV="${PV/_p/.post}"
53 +MY_P="${PN}-${MY_PV}"
54 +
55 +DESCRIPTION="BuildBot build automation system"
56 +HOMEPAGE="https://buildbot.net/ https://github.com/buildbot/buildbot https://pypi.org/project/buildbot/"
57 +[[ ${PV} == *9999 ]] || SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz"
58 +
59 +LICENSE="GPL-2"
60 +SLOT="0"
61 +if [[ ${PV} == *9999 ]]; then
62 + KEYWORDS=""
63 +else
64 + KEYWORDS="~amd64"
65 +fi
66 +
67 +IUSE="crypt docker examples irc test"
68 +
69 +RDEPEND="
70 + >=dev-python/jinja-2.1[${PYTHON_USEDEP}]
71 + >=dev-python/twisted-17.9.0[${PYTHON_USEDEP}]
72 + >=dev-python/autobahn-0.16.0[${PYTHON_USEDEP}]
73 + >=dev-python/sqlalchemy-0.8[${PYTHON_USEDEP}]
74 + >=dev-python/sqlalchemy-migrate-0.9[${PYTHON_USEDEP}]
75 + dev-python/future[${PYTHON_USEDEP}]
76 + >=dev-python/python-dateutil-1.5[${PYTHON_USEDEP}]
77 + >=dev-python/txaio-2.2.2[${PYTHON_USEDEP}]
78 + dev-python/pyjwt[${PYTHON_USEDEP}]
79 + >=dev-python/zope-interface-4.1.1[${PYTHON_USEDEP}]
80 + ~dev-util/buildbot-worker-${PV}[${PYTHON_USEDEP}]
81 + crypt? (
82 + >=dev-python/twisted-17.9.0[${PYTHON_USEDEP},crypt]
83 + >=dev-python/pyopenssl-16.0.0[${PYTHON_USEDEP}]
84 + dev-python/idna[${PYTHON_USEDEP}]
85 + dev-python/service_identity[${PYTHON_USEDEP}]
86 + )
87 + irc? (
88 + dev-python/txrequests[${PYTHON_USEDEP}]
89 + )
90 + docker? (
91 + >=dev-python/docker-py-2.2.0[${PYTHON_USEDEP}]
92 + )
93 +"
94 +DEPEND="${RDEPEND}
95 + >=dev-python/setuptools-21.2.1[${PYTHON_USEDEP}]
96 + test? (
97 + >=dev-python/python-dateutil-1.5[${PYTHON_USEDEP}]
98 + >=dev-python/mock-2.0.0[${PYTHON_USEDEP}]
99 + dev-python/moto[${PYTHON_USEDEP}]
100 + dev-python/boto3[${PYTHON_USEDEP}]
101 + dev-python/pyjade[${PYTHON_USEDEP}]
102 + dev-python/txgithub[${PYTHON_USEDEP}]
103 + dev-python/txrequests[${PYTHON_USEDEP}]
104 + dev-python/lz4[${PYTHON_USEDEP}]
105 + dev-python/treq[${PYTHON_USEDEP}]
106 + dev-python/setuptools_trial[${PYTHON_USEDEP}]
107 + ~dev-util/buildbot-worker-${PV}[${PYTHON_USEDEP}]
108 + >=dev-python/docker-py-2.2.0[${PYTHON_USEDEP}]
109 + )"
110 +
111 +S=${WORKDIR}/${MY_P}
112 +[[ ${PV} == *9999 ]] && S=${S}/master
113 +
114 +if [[ ${PV} != *9999 ]]; then
115 + PATCHES=(
116 + "${FILESDIR}/Remove-distro-version-test.patch"
117 + )
118 +fi
119 +
120 +pkg_setup() {
121 + enewuser buildbot
122 +
123 + DOC_CONTENTS="The \"buildbot\" user and the \"buildmaster\" init script has been added
124 + to support starting buildbot through Gentoo's init system. To use this,
125 + execute \"emerge --config =${CATEGORY}/${PF}\" to create a new instance.
126 + The scripts can run as a different user if desired."
127 +}
128 +
129 +
130 +src_install() {
131 + distutils-r1_src_install
132 +
133 + doman docs/buildbot.1
134 +
135 + if use examples; then
136 + insinto /usr/share/doc/${PF}
137 + doins -r docs/examples
138 + fi
139 +
140 + newconfd "${FILESDIR}/buildmaster.confd" buildmaster
141 + newinitd "${FILESDIR}/buildmaster.initd" buildmaster
142 + systemd_dounit "${FILESDIR}/buildmaster.target"
143 + systemd_newunit "${FILESDIR}/buildmaster_at.service" "buildmaster@.service"
144 + systemd_install_serviced "${FILESDIR}/buildmaster_at.service.conf" "buildmaster@.service"
145 +
146 + readme.gentoo_create_doc
147 +}
148 +
149 +python_test() {
150 + distutils_install_for_testing
151 +
152 + esetup.py test || die "Tests failed under ${EPYTHON}"
153 +}
154 +
155 +pkg_postinst() {
156 + readme.gentoo_print_elog
157 +
158 + if [[ -n ${REPLACING_VERSIONS} ]]; then
159 + ewarn
160 + ewarn "Starting with buildbot-0.8.12-r2, more than one instance of buildmaster"
161 + ewarn "can be run simultaneously. Note that \"BASEDIR\" in the buildbot configuration file"
162 + ewarn "is now the common base directory for all instances. If you are migrating from an older"
163 + ewarn "version, make sure that you copy the current contents of \"BASEDIR\" to a subdirectory."
164 + ewarn "The name of the subdirectory corresponds to the name of the buildmaster instance."
165 + ewarn "In order to start the service running OpenRC-based systems need to link to the init file:"
166 + ewarn " ln --symbolic --relative /etc/init.d/buildmaster /etc/init.d/buildmaster.myinstance"
167 + ewarn " rc-update add buildmaster.myinstance default"
168 + ewarn " /etc/init.d/buildmaster.myinstance start"
169 + ewarn "Systems using systemd can do the following:"
170 + ewarn " systemctl enable buildmaster@××××××××××.service"
171 + ewarn " systemctl enable buildmaster.target"
172 + ewarn " systemctl start buildmaster.target"
173 + elog
174 + elog "Upstream recommends the following when upgrading:"
175 + elog "Each time you install a new version of Buildbot, you should run the"
176 + elog "\"buildbot upgrade-master\" command on each of your pre-existing build masters."
177 + elog "This will add files and fix (or at least detect) incompatibilities between"
178 + elog "your old config and the new code."
179 + fi
180 + elog
181 + elog "In order to create a new instance of buildmaster, execute:"
182 + elog " emerge --config =${CATEGORY}/${PF}"
183 +}
184 +
185 +pkg_config() {
186 + local buildmaster_path="/var/lib/buildmaster"
187 + local log_path="/var/log/buildmaster"
188 +
189 + einfo "This will prepare a new buildmaster instance in ${buildmaster_path}."
190 + einfo "Press Control-C to abort."
191 +
192 + einfo "Enter the name for the new instance: "
193 + read instance_name
194 + [[ -z "${instance_name}" ]] && die "Invalid instance name"
195 +
196 + local instance_path="${buildmaster_path}/${instance_name}"
197 + local instance_log_path="${log_path}/${instance_name}"
198 +
199 + if [[ -e "${instance_path}" ]]; then
200 + eerror "The instance with the specified name already exists:"
201 + eerror "${instance_path}"
202 + die "Instance already exists"
203 + fi
204 +
205 + local buildbot="/usr/bin/buildbot"
206 + if [[ ! -d "${buildmaster_path}" ]]; then
207 + mkdir --parents "${buildmaster_path}" || die "Unable to create directory ${buildmaster_path}"
208 + fi
209 + "${buildbot}" create-master "${instance_path}" &>/dev/null || die "Creating instance failed"
210 + chown --recursive buildbot "${instance_path}" || die "Setting permissions for instance failed"
211 + mv "${instance_path}/master.cfg.sample" "${instance_path}/master.cfg" \
212 + || die "Moving sample configuration failed"
213 + ln --symbolic --relative "/etc/init.d/buildmaster" "/etc/init.d/buildmaster.${instance_name}" \
214 + || die "Unable to create link to init file"
215 +
216 + if [[ ! -d "${instance_log_path}" ]]; then
217 + mkdir --parents "${instance_log_path}" || die "Unable to create directory ${instance_log_path}"
218 + fi
219 + ln --symbolic --relative "${instance_log_path}/twistd.log" "${instance_path}/twistd.log" \
220 + || die "Unable to create link to log file"
221 +
222 + einfo "Successfully created a buildmaster instance at ${instance_path}."
223 + einfo "To change the default settings edit the master.cfg file in this directory."
224 +}
225
226 diff --git a/dev-util/buildbot/files/buildmaster.confd b/dev-util/buildbot/files/buildmaster.confd
227 index e489d66f9d4..eb3185aef35 100644
228 --- a/dev-util/buildbot/files/buildmaster.confd
229 +++ b/dev-util/buildbot/files/buildmaster.confd
230 @@ -8,3 +8,8 @@ USERNAME=buildbot
231
232 # Extra options to pass to twistd.
233 TWISTD_OPTS=""
234 +
235 +# Optional specific python version to run in
236 +# (if not the system default version)
237 +# ie: RUNTIME_PYTHON="/usr/bin/python2.7"
238 +RUNTIME_PYTHON=""
239
240 diff --git a/dev-util/buildbot/files/buildmaster.initd b/dev-util/buildbot/files/buildmaster.initd
241 index 29fd444d123..933c6e2b4e5 100644
242 --- a/dev-util/buildbot/files/buildmaster.initd
243 +++ b/dev-util/buildbot/files/buildmaster.initd
244 @@ -1,5 +1,5 @@
245 #!/sbin/openrc-run
246 -# Copyright 1999-2016 Gentoo Foundation
247 +# Copyright 1999-2018 Gentoo Foundation
248 # Distributed under the terms of the GNU General Public License v2
249
250 extra_started_commands="reload"
251 @@ -39,7 +39,7 @@ start() {
252 ebegin "Starting buildmaster in ${BUILDMASTER_PATH}"
253 start-stop-daemon --start -u "${USERNAME}" \
254 --pidfile "${BUILDMASTER_PATH}/buildmaster.pid" \
255 - --exec /usr/bin/python2 -- /usr/bin/twistd \
256 + --exec "${RUNTIME_PYTHON}" -- /usr/bin/twistd \
257 --no_save \
258 --logfile="${BUILDMASTER_PATH}/twistd.log" \
259 --pidfile="${BUILDMASTER_PATH}/buildmaster.pid" \