Gentoo Archives: gentoo-commits

From: Patrick McLean <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/salt/, app-admin/salt/files/
Date: Tue, 09 Feb 2021 17:00:53
Message-Id: 1612890045.37c20089d044d190eefb2fe38495df1b76292c69.chutzpah@gentoo
1 commit: 37c20089d044d190eefb2fe38495df1b76292c69
2 Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
3 AuthorDate: Tue Feb 9 17:00:17 2021 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 9 17:00:45 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=37c20089
7
8 app-admin/salt-3002.2-r3: Revbump, add supervision to services
9
10 Copyright: Sony Interactive Entertainment Inc.
11 Package-Manager: Portage-3.0.14, Repoman-3.0.2
12 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
13
14 app-admin/salt/files/api-confd-1 | 4 +-
15 app-admin/salt/files/api-initd-5 | 18 ++++
16 app-admin/salt/files/master-initd-5 | 18 ++++
17 app-admin/salt/files/minion-initd-5 | 19 ++++
18 app-admin/salt/files/syndic-confd-1 | 4 +-
19 app-admin/salt/files/syndic-initd-5 | 18 ++++
20 app-admin/salt/salt-3002.2-r3.ebuild | 185 +++++++++++++++++++++++++++++++++++
21 7 files changed, 262 insertions(+), 4 deletions(-)
22
23 diff --git a/app-admin/salt/files/api-confd-1 b/app-admin/salt/files/api-confd-1
24 index c70e8e766da..84a1c6c71a0 100644
25 --- a/app-admin/salt/files/api-confd-1
26 +++ b/app-admin/salt/files/api-confd-1
27 @@ -1,5 +1,5 @@
28 -# /etc/conf.d/salt-master: config file for /etc/init.d/salt-master
29 +# /etc/conf.d/salt-api: config file for /etc/init.d/salt-api
30
31 -# see man pages for salt-minion or run `salt-master --help`
32 +# see man pages for salt-minion or run `salt-api --help`
33 # for valid cmdline options
34 SALT_OPTS="--log-level=warning"
35
36 diff --git a/app-admin/salt/files/api-initd-5 b/app-admin/salt/files/api-initd-5
37 new file mode 100644
38 index 00000000000..1fecd03275e
39 --- /dev/null
40 +++ b/app-admin/salt/files/api-initd-5
41 @@ -0,0 +1,18 @@
42 +#!/sbin/openrc-run
43 +# Copyright 1999-2021 Gentoo Authors
44 +# Distributed under the terms of the GNU General Public License v2
45 +
46 +command="/usr/bin/salt-api"
47 +command_args="${SALT_OPTS}"
48 +pidfile="/var/run/salt-api.pid"
49 +command_args_background="--daemon --pid-file=\"${pidfile}\""
50 +name="SALT API daemon"
51 +retry="20"
52 +
53 +supervisor=supervise-daemon
54 +output_logger="logger -p daemon.info -t salt-api.stdout --"
55 +error_logger="logger -p daemon.err -t salt-api.error --"
56 +
57 +depend() {
58 + use net logger
59 +}
60
61 diff --git a/app-admin/salt/files/master-initd-5 b/app-admin/salt/files/master-initd-5
62 new file mode 100644
63 index 00000000000..13c8ad89228
64 --- /dev/null
65 +++ b/app-admin/salt/files/master-initd-5
66 @@ -0,0 +1,18 @@
67 +#!/sbin/openrc-run
68 +# Copyright 1999-2021 Gentoo Authors
69 +# Distributed under the terms of the GNU General Public License v2
70 +
71 +command="/usr/bin/salt-master"
72 +command_args="${SALT_OPTS}"
73 +command_args_background="--daemon --pid-file=\"${pidfile}\""
74 +pidfile="/var/run/salt-master.pid"
75 +name="SALT master daemon"
76 +retry="20"
77 +
78 +supervisor=supervise-daemon
79 +output_logger="logger -p daemon.info -t salt-master.stdout --"
80 +error_logger="logger -p daemon.err -t salt-master.error --"
81 +
82 +depend() {
83 + use net logger
84 +}
85
86 diff --git a/app-admin/salt/files/minion-initd-5 b/app-admin/salt/files/minion-initd-5
87 new file mode 100644
88 index 00000000000..e3a430b77fa
89 --- /dev/null
90 +++ b/app-admin/salt/files/minion-initd-5
91 @@ -0,0 +1,19 @@
92 +#!/sbin/openrc-run
93 +# Copyright 1999-2021 Gentoo Authors
94 +# Distributed under the terms of the GNU General Public License v2
95 +
96 +command="/usr/bin/salt-minion"
97 +command_args="${SALT_OPTS}"
98 +pidfile="/var/run/salt-minion.pid"
99 +command_args_background="--daemon --pid-file=\"${pidfile}\""
100 +name="SALT minion daemon"
101 +retry="20"
102 +
103 +supervisor=supervise-daemon
104 +output_logger="logger -p daemon.info -t salt-minion.stdout --"
105 +error_logger="logger -p daemon.err -t salt-minion.error --"
106 +
107 +depend() {
108 + need net
109 + use logger
110 +}
111
112 diff --git a/app-admin/salt/files/syndic-confd-1 b/app-admin/salt/files/syndic-confd-1
113 index d69d83fcd60..e9c75b8bc78 100644
114 --- a/app-admin/salt/files/syndic-confd-1
115 +++ b/app-admin/salt/files/syndic-confd-1
116 @@ -1,5 +1,5 @@
117 -# /etc/conf.d/salt-minion: config file for /etc/init.d/salt-minion
118 +# /etc/conf.d/salt-syndic: config file for /etc/init.d/salt-syndic
119
120 -# see man pages for salt-minion or run `salt-minion --help`
121 +# see man pages for salt-minion or run `salt-syndic --help`
122 # for valid cmdline options
123 SALT_OPTS="--log-level=warning"
124
125 diff --git a/app-admin/salt/files/syndic-initd-5 b/app-admin/salt/files/syndic-initd-5
126 new file mode 100644
127 index 00000000000..7e43828bda4
128 --- /dev/null
129 +++ b/app-admin/salt/files/syndic-initd-5
130 @@ -0,0 +1,18 @@
131 +#!/sbin/openrc-run
132 +# Copyright 1999-2021 Gentoo Authors
133 +# Distributed under the terms of the GNU General Public License v2
134 +
135 +command="/usr/bin/salt-syndic"
136 +command_args="${SALT_OPTS}"
137 +pidfile="/var/run/salt-syndic.pid"
138 +command_args_background="--daemon --pid-file=\"${pidfile}\""
139 +name="SALT syndic daemon"
140 +retry="20"
141 +
142 +supervisor=supervise-daemon
143 +output_logger="logger -p daemon.info -t salt-syndic.stdout --"
144 +error_logger="logger -p daemon.err -t salt-syndic.error --"
145 +
146 +depend() {
147 + use net logger
148 +}
149
150 diff --git a/app-admin/salt/salt-3002.2-r3.ebuild b/app-admin/salt/salt-3002.2-r3.ebuild
151 new file mode 100644
152 index 00000000000..7c65d1b1980
153 --- /dev/null
154 +++ b/app-admin/salt/salt-3002.2-r3.ebuild
155 @@ -0,0 +1,185 @@
156 +# Copyright 1999-2021 Gentoo Authors
157 +# Distributed under the terms of the GNU General Public License v2
158 +
159 +EAPI=7
160 +PYTHON_COMPAT=( python3_{7..8} )
161 +DISTUTILS_USE_SETUPTOOLS=rdepend
162 +inherit systemd distutils-r1
163 +
164 +DESCRIPTION="Salt is a remote execution and configuration manager"
165 +HOMEPAGE="https://www.saltstack.com/resources/community/
166 + https://github.com/saltstack"
167 +
168 +if [[ ${PV} == 9999* ]]; then
169 + inherit git-r3
170 + EGIT_REPO_URI="git://github.com/${PN}stack/${PN}.git"
171 + EGIT_BRANCH="develop"
172 + SRC_URI=""
173 +else
174 + SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
175 + KEYWORDS="~amd64 ~arm ~x86"
176 +fi
177 +
178 +LICENSE="Apache-2.0"
179 +SLOT="0"
180 +IUSE="cheetah cherrypy ldap libcloud libvirt genshi gnupg keyring mako
181 + mongodb neutron nova openssl portage profile redis selinux test raet
182 + +zeromq vim-syntax"
183 +
184 +RDEPEND="
185 + sys-apps/pciutils
186 + >=dev-python/distro-1.5[${PYTHON_USEDEP}]
187 + dev-python/jinja[${PYTHON_USEDEP}]
188 + dev-python/libnacl[${PYTHON_USEDEP}]
189 + >=dev-python/msgpack-1.0.0[${PYTHON_USEDEP}]
190 + >=dev-python/pycryptodome-3.9.8[${PYTHON_USEDEP}]
191 + dev-python/pyyaml[${PYTHON_USEDEP}]
192 + dev-python/markupsafe[${PYTHON_USEDEP}]
193 + >=dev-python/requests-1.0.0[${PYTHON_USEDEP}]
194 + dev-python/setuptools[${PYTHON_USEDEP}]
195 + dev-python/toml[${PYTHON_USEDEP}]
196 + dev-python/watchdog[${PYTHON_USEDEP}]
197 + libcloud? ( >=dev-python/libcloud-0.14.0[${PYTHON_USEDEP}] )
198 + mako? ( dev-python/mako[${PYTHON_USEDEP}] )
199 + ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] )
200 + libvirt? (
201 + $(python_gen_cond_dep 'dev-python/libvirt-python[${PYTHON_USEDEP}]' python3_7)
202 + )
203 + openssl? (
204 + dev-libs/openssl:0=[-bindist]
205 + dev-python/pyopenssl[${PYTHON_USEDEP}]
206 + )
207 + raet? (
208 + >=dev-python/libnacl-1.0.0[${PYTHON_USEDEP}]
209 + >=dev-python/ioflo-1.1.7[${PYTHON_USEDEP}]
210 + >=dev-python/raet-0.6.0[${PYTHON_USEDEP}]
211 + )
212 + cherrypy? ( >=dev-python/cherrypy-3.2.2[${PYTHON_USEDEP}] )
213 + cheetah? ( dev-python/cheetah3[${PYTHON_USEDEP}] )
214 + mongodb? ( dev-python/pymongo[${PYTHON_USEDEP}] )
215 + portage? ( sys-apps/portage[${PYTHON_USEDEP}] )
216 + keyring? ( dev-python/keyring[${PYTHON_USEDEP}] )
217 + redis? ( dev-python/redis-py[${PYTHON_USEDEP}] )
218 + selinux? ( sec-policy/selinux-salt )
219 + nova? (
220 + $(python_gen_cond_dep '>=dev-python/python-novaclient-2.17.0[${PYTHON_USEDEP}]' python3_7)
221 + )
222 + neutron? (
223 + $(python_gen_cond_dep '>=dev-python/python-neutronclient-2.3.6[${PYTHON_USEDEP}]' python3_7)
224 + )
225 + gnupg? ( dev-python/python-gnupg[${PYTHON_USEDEP}] )
226 + profile? ( dev-python/yappi[${PYTHON_USEDEP}] )
227 + vim-syntax? ( app-vim/salt-vim )
228 + zeromq? ( >=dev-python/pyzmq-2.2.0[${PYTHON_USEDEP}] )
229 +"
230 +BDEPEND="
231 + test? (
232 + ${RDEPEND}
233 + >=dev-python/boto-2.32.1[${PYTHON_USEDEP}]
234 + >=dev-python/jsonschema-3.0[${PYTHON_USEDEP}]
235 + >=dev-python/libcloud-0.14.0[${PYTHON_USEDEP}]
236 + >=dev-python/mock-2.0.0[${PYTHON_USEDEP}]
237 + >=dev-python/moto-0.3.6[${PYTHON_USEDEP}]
238 + dev-python/pip[${PYTHON_USEDEP}]
239 + dev-python/psutil[${PYTHON_USEDEP}]
240 + dev-python/pytest[${PYTHON_USEDEP}]
241 + dev-python/pytest-helpers-namespace[${PYTHON_USEDEP}]
242 + >=dev-python/pytest-salt-factories-0.93.0[${PYTHON_USEDEP}]
243 + dev-python/pytest-tempdir[${PYTHON_USEDEP}]
244 + >=dev-python/virtualenv-20.0.20[${PYTHON_USEDEP}]
245 + !x86? ( >=dev-python/boto3-1.3.15[${PYTHON_USEDEP}] )
246 + )"
247 +
248 +DOCS=( README.rst AUTHORS )
249 +
250 +REQUIRED_USE="|| ( raet zeromq )
251 + test? ( cheetah genshi )"
252 +RESTRICT="!test? ( test ) x86? ( test )"
253 +
254 +PATCHES=(
255 + "${FILESDIR}/salt-2019.2.0-skip-tests-that-oom-machine.patch"
256 + "${FILESDIR}/salt-3002-dont-realpath-on-tmpdir.patch"
257 + "${FILESDIR}/salt-3002-tests.patch"
258 +)
259 +
260 +python_prepare_all() {
261 + # remove tests with external dependencies that may not be available
262 + rm tests/unit/{test_zypp_plugins.py,utils/test_extend.py} || die
263 + rm tests/unit/modules/test_{file,boto_{vpc,secgroup,elb}}.py || die
264 + rm tests/unit/states/test_boto_vpc.py || die
265 + rm tests/support/gitfs.py tests/unit/runners/test_git_pillar.py || die
266 +
267 + # tests that require network access
268 + rm tests/unit/{states,modules}/test_zcbuildout.py || die
269 +
270 + # make sure pkg_resources doesn't bomb because pycrypto isn't installed
271 + # make sure pkg_resources doesn't bomb because pycrypto isn't installed
272 + find "${S}" -name '*.txt' -print0 | xargs -0 sed -e '/pycrypto>/ d ; /pycryptodomex/ d' -i || die
273 + # pycryptodome rather than pycryptodomex
274 + find "${S}" -name '*.py' -print0 | xargs -0 -- sed -i -e 's:Cryptodome:Crypto:g' -- || die
275 +
276 + distutils-r1_python_prepare_all
277 +}
278 +
279 +python_prepare() {
280 + einfo "Fixing collections.abc warnings for ${EPYTHON}"
281 + local abc
282 + abc="$("${EPYTHON}" -c 'import collections.abc; print("|".join((c for c in dir(collections.abc) if not c.startswith("_"))))')" || die
283 + find -name '*.py' -type f -print0 | xargs -0 sed -r -e "s:collections\\.(${abc}):collections.abc.\\1:g" -i || die
284 +}
285 +
286 +python_install_all() {
287 + local svc
288 + USE_SETUPTOOLS=1 distutils-r1_python_install_all
289 +
290 + for svc in minion master syndic api; do
291 + newinitd "${FILESDIR}"/${svc}-initd-5 salt-${svc}
292 + newconfd "${FILESDIR}"/${svc}-confd-1 salt-${svc}
293 + systemd_dounit "${FILESDIR}"/salt-${svc}.service
294 + done
295 +
296 + insinto /etc/${PN}
297 + doins -r conf/*
298 +}
299 +
300 +python_test() {
301 + local tempdir
302 + # testsuite likes lots of files
303 + ulimit -n 3072 || die
304 +
305 + # ${T} is too long a path for the tests to work
306 + tempdir="$(mktemp -du --tmpdir=/tmp salt-XXX)"
307 + mkdir "${T}/$(basename "${tempdir}")"
308 +
309 + (
310 + cleanup() { rm -f "${tempdir}" || die; }
311 +
312 + trap cleanup EXIT
313 +
314 + addwrite "${tempdir}"
315 + ln -s "$(realpath --relative-to=/tmp "${T}/$(basename "${tempdir}")")" "${tempdir}" || die
316 +
317 + USE_SETUPTOOLS=1 SHELL="/bin/bash" \
318 + TMPDIR="${tempdir}" \
319 + ${EPYTHON} tests/runtests.py \
320 + --unit-tests --no-report --verbose \
321 + || die "testing failed with ${EPYTHON}"
322 + )
323 +}
324 +
325 +pkg_postinst() {
326 + if use python_targets_python3_8; then
327 + if use nova; then
328 + ewarn "Salt's nova functionality will not work with python3.8 since"
329 + ewarn "dev-python/python-novaclient does not support it yet"
330 + fi
331 + if use neutron; then
332 + ewarn "Salt's neutron functionality will not work with python3.8 since"
333 + ewarn "dev-python/python-neutronclient does not support it yet"
334 + fi
335 + if use libvirt; then
336 + ewarn "Salt's libvirt functionality will not work with python3.8 since"
337 + ewarn "dev-python/libvirt-python does not support it yet"
338 + fi
339 + fi
340 +}