Gentoo Archives: gentoo-commits

From: Samuel Bernardo <samuelbernardo.mail@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/user/ssnb:master commit in: app-emulation/opennebula/
Date: Mon, 11 May 2020 00:02:47
Message-Id: 1589155347.b5e607094495e8c79399d8bf8caf632148af764e.samuelbernardo@gentoo
1 commit: b5e607094495e8c79399d8bf8caf632148af764e
2 Author: Samuel Bernardo <samuelbernardo.mail <AT> gmail <DOT> com>
3 AuthorDate: Mon May 11 00:02:27 2020 +0000
4 Commit: Samuel Bernardo <samuelbernardo.mail <AT> gmail <DOT> com>
5 CommitDate: Mon May 11 00:02:27 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/user/ssnb.git/commit/?id=b5e60709
7
8 Add test for network sandbox in setup phase. Change dependency in opennebula from grunt-cli to grunt.
9
10 Signed-off-by: Samuel Bernardo <samuelbernardo.mail <AT> gmail.com>
11
12 app-emulation/opennebula/Manifest | 4 +-
13 app-emulation/opennebula/opennebula-5.10.3.ebuild | 299 ----------------------
14 app-emulation/opennebula/opennebula-5.10.4.ebuild | 11 +-
15 3 files changed, 9 insertions(+), 305 deletions(-)
16
17 diff --git a/app-emulation/opennebula/Manifest b/app-emulation/opennebula/Manifest
18 index 65bc162..8d7d1a4 100644
19 --- a/app-emulation/opennebula/Manifest
20 +++ b/app-emulation/opennebula/Manifest
21 @@ -60,9 +60,7 @@ AUX tmpfiles.d/opennebula-node.conf 17 BLAKE2B cfd907f606a7b9b24d897960720f97ed3
22 AUX tmpfiles.d/opennebula-sunstone.conf 77 BLAKE2B 9988562b0e36bf74fc67af5a1777eca18b24e0a1bcfc78735f360f1aceca4602e32f7b6cfbe3b731a13725a9cd14a4dc49b71c12bb7576a29aa00112b37cd2be SHA512 c13210255ebb0f34d464e2799858d6ac2a79afac287ead639821ef5e939b7666a960ebb1ee96bc7098a111ddd6765e72d8a5e53e0647b9a866d0826e02cbd2a1
23 AUX tmpfiles.d/opennebula.conf 77 BLAKE2B 9988562b0e36bf74fc67af5a1777eca18b24e0a1bcfc78735f360f1aceca4602e32f7b6cfbe3b731a13725a9cd14a4dc49b71c12bb7576a29aa00112b37cd2be SHA512 c13210255ebb0f34d464e2799858d6ac2a79afac287ead639821ef5e939b7666a960ebb1ee96bc7098a111ddd6765e72d8a5e53e0647b9a866d0826e02cbd2a1
24 DIST opennebula-5.10.1.tar.gz 43207580 BLAKE2B de87e839cd772bec769af4a689fed02e81fbdc6fbb35def9ad6344383dc935ebd431137cb194dd3b840965004f4e145ac63443d7034d56a9a6bb19af9030642d SHA512 861293298997c825e94228ea28f0f352db3f56dd28b654be24ca2226edd422fc54cf94665f5ae5cc17dc51d3d52081c936f249b77fc4f8198de6a1ec0006edaf
25 -DIST opennebula-5.10.3.tar.gz 5694695 BLAKE2B 09e20f0bcea43a454692c7bc5ac7e167024bc838755a2fed31ef5e4a0dea85f97a4334ec950a0a6c3f16a6d49837262dd7791b02298f58da600f65521de59764 SHA512 a0b581a6522054241d61255aba3a1754dd16052b058f0de244a3ec35fd99972aed36fef25d087a2a76566fa0d8c875c9e95766294d80adb4c5491231447ec839
26 DIST opennebula-5.10.4.tar.gz 5697792 BLAKE2B fde611cbe5b44ee403b57e915253c9ffba267230bf3a54cd466260615918e871aebeae6f17c246a84ef1686df176134acff272c49e6a9b69c8841bc8fab1f1b5 SHA512 c509ec4a56b7865d118ab79e08227f0a78d1d899361ea2ae2ea3c6ac6ad3ab4a2a38211a4f5b7abf35ef512674d13ffb19f97286fed63515289e4f9a602f3145
27 EBUILD opennebula-5.10.1.ebuild 9405 BLAKE2B fd6dfefc76da0aaadc993b7ed1593b8826fb642a92797220c9ce6226b846539900f6e7914730decfe57f79514654506e9a1aed76ebd28c1fc797d71ee5a6b2ba SHA512 360d3323e46a1253f6489c696e020ea38e260923d6b0fcb50154b0cb412b4bd3db994365a072915f5a8411032cea12dd8b87fe2f730e418d6742dd7218722a66
28 -EBUILD opennebula-5.10.3.ebuild 9653 BLAKE2B ad5ca71e2d22173d6a8815b1e38a82dc745e0d99d92ff0bdd9d24d86628fd5609213b1a984a984239fa68220877cf5781046164c3314f7bd358283052963e412 SHA512 43f66b8361cea0cad56efacf2a0187fd15ee4d49cf6f4c0b0bc563b9dcaa1ee4f23554475a7d23da412c9f58f1f6e26e95db26f5009c1c4270c3fe6e193a6e0c
29 -EBUILD opennebula-5.10.4.ebuild 9653 BLAKE2B ad5ca71e2d22173d6a8815b1e38a82dc745e0d99d92ff0bdd9d24d86628fd5609213b1a984a984239fa68220877cf5781046164c3314f7bd358283052963e412 SHA512 43f66b8361cea0cad56efacf2a0187fd15ee4d49cf6f4c0b0bc563b9dcaa1ee4f23554475a7d23da412c9f58f1f6e26e95db26f5009c1c4270c3fe6e193a6e0c
30 +EBUILD opennebula-5.10.4.ebuild 9705 BLAKE2B 6fcfa4e006240a45629ea3ed7fa09ac60736fc3efad771cc69b39d7b9a6102b66e3659301f064ca8f7941130e6883812a57ef9c636f52fea5b9c2f3b86507021 SHA512 4455c0c4338f47219828b70a68d44c30f53cc9ddbb8352a5b4d4fc6867476236fd4a5fe41be646cb98ad0728407d1afd902fa0714fc01fd71bae005edb0a5ec2
31 MISC metadata.xml 931 BLAKE2B abb0ecf04eb6fc45f64c5d2d6636591c9d706fbf1902943a80f7e058443787824581219fb8457a83192e4e2b672521609449d4eef78ab677f8c093fe939034b6 SHA512 c3770f399572b16601e7eeaf4a1eb4b5eea950ad18239be8719124f60f3edd02da4c7b28b177329d70b0810ee7d8597e522dd62a1bd4c8ea1194acf0d92dfeb2
32
33 diff --git a/app-emulation/opennebula/opennebula-5.10.3.ebuild b/app-emulation/opennebula/opennebula-5.10.3.ebuild
34 deleted file mode 100644
35 index 6db137d..0000000
36 --- a/app-emulation/opennebula/opennebula-5.10.3.ebuild
37 +++ /dev/null
38 @@ -1,299 +0,0 @@
39 -# Copyright 1999-2020 Gentoo Authors
40 -# Distributed under the terms of the GNU General Public License v2
41 -# $Header: $
42 -
43 -EAPI=7
44 -USE_RUBY="ruby24 ruby25 ruby26 ruby27"
45 -PYTHON_COMPAT=( python2_7 python3_6 )
46 -
47 -inherit user eutils multilib ruby-ng systemd rpm python-r1
48 -
49 -MY_P="one-release-${PV}"
50 -P_RPM="${P}-1"
51 -
52 -DESCRIPTION="OpenNebula Virtual Infrastructure Engine"
53 -HOMEPAGE="http://www.opennebula.org/"
54 -
55 -IUSE="qemu +mysql xen sqlite +extras systemd docker +sunstone vnc +python +doc"
56 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
57 -LICENSE="Apache-2.0"
58 -SLOT="0"
59 -#KEYWORDS="~amd64"
60 -SRC_URI="https://github.com/OpenNebula/one/archive/release-${PV}.tar.gz -> ${P}.tar.gz"
61 -
62 -RDEPEND=">=dev-libs/xmlrpc-c-1.18.02[abyss,cxx,threads]
63 - dev-lang/ruby
64 - python? ( ${PYTHON_DEPS}
65 - >=dev-python/pygobject-2.90.4:3[${PYTHON_USEDEP}] )
66 - extras? ( dev-libs/openssl
67 - dev-ruby/libxml
68 - net-misc/curl
69 - dev-libs/libxslt
70 - dev-libs/expat
71 - dev-ruby/uuidtools
72 - dev-ruby/amazon-ec2
73 - dev-ruby/webmock
74 - dev-ruby/mysql
75 - dev-ruby/mysql2
76 - dev-ruby/parse-cron
77 - dev-ruby/sequel
78 - dev-ruby/treetop
79 - dev-ruby/xml-simple
80 - dev-ruby/zendesk_api
81 - dev-ruby/ffi-rzmq
82 - dev-ruby/ffi-rzmq-core
83 - dev-ruby/rqrcode
84 - dev-ruby/rqrcode_core
85 - dev-ruby/chunky_png
86 - dev-ruby/rotp
87 - dev-libs/log4cpp )
88 - mysql? ( virtual/mysql )
89 - dev-db/sqlite
90 - net-misc/openssh
91 - net-fs/nfs-utils
92 - dev-db/mariadb
93 - net-libs/zeromq
94 - || ( app-cdr/cdrkit app-cdr/cdrtools )
95 - sqlite? ( dev-ruby/sqlite3 )
96 - qemu? ( app-emulation/libvirt[libvirtd,qemu] )
97 - xen? ( app-emulation/xen-tools )"
98 -DEPEND="${RDEPEND}
99 - dev-lang/ruby:2.5
100 - >=dev-util/scons-3.0.0
101 - dev-ruby/nokogiri
102 - dev-ruby/bundler
103 - dev-nodejs/grunt-cli
104 - dev-nodejs/bower
105 - net-libs/nodejs[npm]
106 - net-libs/libvncserver
107 - app-text/ronn
108 - dev-ruby/builder
109 - dev-ruby/highline
110 - dev-ruby/ipaddress:1
111 - docker? ( dev-go/dep )"
112 -
113 -# make sure no eclass is running tests
114 -RESTRICT="test"
115 -
116 -S="${WORKDIR}/${MY_P}"
117 -
118 -ONEUSER="oneadmin"
119 -ONEGROUP="oneadmin"
120 -
121 -PATCHES=(
122 - "${FILESDIR}/patches/fix_kvm_emulator.patch"
123 - "${FILESDIR}/patches/install.sh.patch"
124 -)
125 -
126 -pkg_pretend() {
127 - if use sunstone; then
128 - elog "Opennebula hotfix releases needs to build sunstone without network sandbox restriction."
129 - has network-sandbox ${FEATURES} && die "Please disable feature network-sandbox: -network-sandbox"
130 - fi
131 - if use docker; then
132 - elog "Opennebula releases needs to build docker without network sandbox restriction."
133 - has network-sandbox ${FEATURES} && die "Please disable feature network-sandbox: -network-sandbox"
134 - fi
135 -}
136 -
137 -pkg_setup () {
138 - enewgroup ${ONEGROUP}
139 - enewuser ${ONEUSER} -1 /bin/bash /var/lib/one ${ONEGROUP}
140 -}
141 -
142 -src_unpack() {
143 - default
144 -}
145 -
146 -src_prepare() {
147 - # install missing source file
148 - #cp "${FILESDIR}"/${P}/parsers/* "${S}"/src/parsers/ || die "copy parsers files failed"
149 -
150 - # set correct lib path
151 - use docker && make -C src/docker_machine/src/docker_machine vendor
152 - for f in $(grep -rlI "/usr/lib/one" .); do sed -i -e "s/\/usr\/lib\/one/\/usr\/$(get_libdir)\/one/g" $f; done || die "correct lib dir failed"
153 -
154 - # grunt-sass and node-sass versions
155 - sed -i -e 's|1.2.1|2.1.0|' -e 's|3.10.1|4.13.0|' src/sunstone/public/package.json || die "sed failed"
156 -
157 - # As we install from the github release sources we need to build sunstone as well.
158 - # To do that we need the npm environment set up
159 - # https://docs.opennebula.org/5.4/integration/references/sunstone_dev.html#sunstone-dev
160 - pushd src/sunstone/public/ >/dev/null
161 - ./build.sh -d || die "Install required dependencies for npm and bower failed."
162 - #export PATH=$PATH:$PWD/node_modules/.bin
163 - #./build.sh || die "Prepare minified files failed."
164 - popd >/dev/null
165 -
166 - eapply_user
167 -}
168 -
169 -src_configure() {
170 - :
171 -}
172 -
173 -src_compile() {
174 - # manual pages
175 - if use doc; then
176 - pushd ${S}/share/man >/dev/null
177 - ./build.sh
178 - popd >/dev/null
179 - fi
180 -
181 - ###########################################################################
182 - ## ##
183 - ## It is highly recommended that you read the documentation and tweak ##
184 - ## the PKGBUILD accordingly: ##
185 - ## http://docs.opennebula.org/stable/integration/references/compile.html ##
186 - ## ##
187 - ###########################################################################
188 - local myconf
189 - myconf+="parsers=yes new_xmlrpc=yes "
190 - use extras && myconf+="new_xmlrpc=yes "
191 - use mysql && myconf+="mysql=yes " || myconf+="mysql=no "
192 - use sunstone && myconf+="sunstone=yes "
193 - use docker && myconf+="docker_machine=yes "
194 - use systemd && myconf+="systemd=yes "
195 - use vnc && myconf+="svncterm=yes "
196 - python3 $(which scons) \
197 - ${myconf} \
198 - $(sed -r 's/.*(-j\s*|--jobs=)([0-9]+).*/-j\2/' <<< ${MAKEOPTS}) \
199 - || die "building ${PN} failed"
200 -}
201 -
202 -src_install() {
203 - # Prepare installation
204 - keepdir /var/{lib,run}/${PN} || die "keepdir failed"
205 -
206 - dodir /usr/$(get_libdir)/one
207 - dodir /var/log/one
208 - dodir /var/lib/one
209 - dodir /var/tmp/one
210 - dodir /var/lib/one
211 - dodir /var/lib/one/vms
212 - dodir /usr/share/one
213 - dodir /etc/tmpfiles.d
214 -
215 - # Installing Opennebula
216 - DESTDIR="${T}" ./install.sh -u ${ONEUSER} -g ${ONEGROUP} || die "install opennebula core failed"
217 - use extras && DESTDIR="${T}" ./install.sh -u ${ONEUSER} -g ${ONEGROUP} -c || die "install opennebula client tools failed"
218 - use docker && DESTDIR="${T}" ./install.sh -u ${ONEUSER} -g ${ONEGROUP} -e -k || die "install docker machine failed"
219 -
220 - pushd "${T}" >/dev/null
221 - # Clean files
222 - rm -rf etc/{logrotate.d,sudoers.d} lib/ var/{lock,run}
223 -
224 - # setup etc
225 - insinto /etc
226 - doins -r etc/one
227 - rm -rf etc/one
228 -
229 - insinto /etc/one
230 - insopts -m 0640
231 - doins "${FILESDIR}/one_auth"
232 -
233 - insinto /etc/tmpfiles.d
234 - insopts -m 0644
235 - doins "${FILESDIR}"/tmpfiles.d/*
236 -
237 - insinto /etc/logrotate.d
238 - doins "${FILESDIR}"/logrotate/*
239 -
240 - insinto /etc/sudoers.d
241 - doins "${FILESDIR}"/sudoers/*
242 -
243 - # set binaries executable
244 - into /usr
245 - dobin usr/bin/*
246 -
247 - cp -a usr/$(get_libdir)/one/* "${ED}"/usr/$(get_libdir)/one/
248 - cp -a usr/share/one/* "${ED}"/usr/share/one/
249 - cp -a var/lib/one/* "${ED}"/var/lib/one/
250 - rm -rf usr/bin usr/$(get_libdir)/one usr/share/one var/lib/one
251 -
252 - # add documentation
253 - dodoc usr/share/docs/one/*
254 - rm -rf usr/share/docs
255 -
256 - # install remaining files
257 - insinto /usr/share/man/man1
258 - doins -r usr/share/man/man1/
259 -
260 - # set correct owner
261 - fowners -R ${ONEUSER}:${ONEGROUP} /etc/one /usr/$(get_libdir)/one /usr/share/one /var/lib/{one,opennebula} /var/log/one /var/tmp/one
262 -
263 - # install daemon files
264 - if use systemd; then
265 - systemd_dounit "${FILESDIR}"/systemd/*.service
266 - else
267 - doenvd "${FILESDIR}/openrc/99one"
268 - newinitd "${FILESDIR}/openrc/opennebula.initd" opennebula
269 - newinitd "${FILESDIR}/openrc/sunstone-server.initd" sunstone-server
270 - newinitd "${FILESDIR}/openrc/oneflow-server.initd" oneflow-server
271 - newconfd "${FILESDIR}/openrc/opennebula.confd" opennebula
272 - newconfd "${FILESDIR}/openrc/sunstone-server.confd" sunstone-server
273 - newconfd "${FILESDIR}/openrc/oneflow-server.confd" oneflow-server
274 - fi
275 -
276 - popd >/dev/null
277 -
278 -}
279 -
280 -pkg_postinst() {
281 -
282 - #chown -R oneadmin:oneadmin ${ROOT}var/{lock,lib,log,run,tmp}/one
283 - #chown -R oneadmin:oneadmin ${ROOT}usr/share/one
284 - #chown -R oneadmin:oneadmin ${ROOT}etc/one
285 - #chown -R oneadmin:oneadmin ${ROOT}usr/$(get_libdir)/one
286 -
287 - local onedir="${EROOT}var/lib/one"
288 - if [ ! -d "${onedir}/.ssh" ] ; then
289 - #einfo "Generating ssh-key..."
290 - #umask 0027 || die "setting umask failed"
291 - #mkdir "${onedir}/.ssh" || die "creating ssh directory failed"
292 - #ssh-keygen -q -t rsa -N "" -f "${onedir}/.ssh/id_rsa" || die "ssh-keygen failed"
293 - #cat > "${onedir}/.ssh/config" <<EOF
294 -#UserKnownHostsFile /dev/null
295 -#Host *
296 -# StrictHostKeyChecking no
297 -#EOF
298 - #cat "${onedir}/.ssh/id_rsa.pub" >> "${onedir}/.ssh/authorized_keys" || die "adding key failed"
299 - #chown -R ${ONEUSER}:${ONEGROUP} "${onedir}/.ssh" || die "changing owner failed"
300 - elog "Create directory ${onedir}/.ssh with umask 0027."
301 - elog "Then generate ssh key using proper cypher algorithm (at least rsa)."
302 - elog "Add public key to ${ONEUSER} authorized_keys:"
303 - elog "cat ${onedir}/.ssh/id_rsa.pub >> ${onedir}/.ssh/authorized_keys"
304 - elog "${ONEUSER} ssh config for any host with"
305 - elog "StrictHostKeyChecking no"
306 - elog "and"
307 - elog "UserKnownHostsFile /dev/null"
308 - elog "In the end set correct owner to ${ONEUSER}:"
309 - elog "chown -R ${ONEUSER}:${ONEGROUP} ${onedir}/.ssh"
310 - fi
311 -
312 - if use qemu ; then
313 - elog "Make sure that the user ${ONEUSER} has access to the libvirt control socket"
314 - elog " /var/run/libvirt/libvirt-sock"
315 - elog "You can easily check this by executing the following command as ${ONEUSER} user"
316 - elog " virsh -c qemu:///system nodeinfo"
317 - elog "If not using using policykit in libvirt, the file you should take a look at is:"
318 - elog " /etc/libvirt/libvirtd.conf (look for the unix_sock_*_perms parameters)"
319 - elog "Failure to do so may lead to nodes hanging in PENDING state forever without further notice."
320 - echo ""
321 - elog "Should a node hang in PENDING state even with correct permissions, try the following to get more information."
322 - elog "In /tmp/one-im execute the following command for the biggest one_im-* file:"
323 - elog " ruby -wd one_im-???"
324 - echo ""
325 - elog "OpenNebula doesn't allow you to specify the disc format."
326 - elog "Unfortunately the default in libvirt is not to guess and"
327 - elog "it therefores assumes a 'raw' format when using qemu/kvm."
328 - elog "Set 'allow_disk_format_probing = 0' in /etc/libvirt/qemu.conf"
329 - elog "to work around this until OpenNebula fixes it."
330 - fi
331 -
332 - elog "If you wish to use the sunstone server, please issue the command"
333 - #elog "/usr/share/one/install_gems as oneadmin user"
334 - elog "gem install sequel thin json rack sinatra builder treetop zendesk_api mysql parse-cron"
335 -
336 -}
337 -
338
339 diff --git a/app-emulation/opennebula/opennebula-5.10.4.ebuild b/app-emulation/opennebula/opennebula-5.10.4.ebuild
340 index 6db137d..6025799 100644
341 --- a/app-emulation/opennebula/opennebula-5.10.4.ebuild
342 +++ b/app-emulation/opennebula/opennebula-5.10.4.ebuild
343 @@ -18,7 +18,7 @@ IUSE="qemu +mysql xen sqlite +extras systemd docker +sunstone vnc +python +doc"
344 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
345 LICENSE="Apache-2.0"
346 SLOT="0"
347 -#KEYWORDS="~amd64"
348 +KEYWORDS="~amd64"
349 SRC_URI="https://github.com/OpenNebula/one/archive/release-${PV}.tar.gz -> ${P}.tar.gz"
350
351 RDEPEND=">=dev-libs/xmlrpc-c-1.18.02[abyss,cxx,threads]
352 @@ -62,7 +62,7 @@ DEPEND="${RDEPEND}
353 >=dev-util/scons-3.0.0
354 dev-ruby/nokogiri
355 dev-ruby/bundler
356 - dev-nodejs/grunt-cli
357 + dev-nodejs/grunt
358 dev-nodejs/bower
359 net-libs/nodejs[npm]
360 net-libs/libvncserver
361 @@ -85,7 +85,7 @@ PATCHES=(
362 "${FILESDIR}/patches/install.sh.patch"
363 )
364
365 -pkg_pretend() {
366 +test_netsandbox() {
367 if use sunstone; then
368 elog "Opennebula hotfix releases needs to build sunstone without network sandbox restriction."
369 has network-sandbox ${FEATURES} && die "Please disable feature network-sandbox: -network-sandbox"
370 @@ -96,7 +96,12 @@ pkg_pretend() {
371 fi
372 }
373
374 +pkg_pretend() {
375 + test_netsandbox
376 +}
377 +
378 pkg_setup () {
379 + test_netsandbox
380 enewgroup ${ONEGROUP}
381 enewuser ${ONEUSER} -1 /bin/bash /var/lib/one ${ONEGROUP}
382 }