1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python3_6 python3_7 )
9 DESCRIPTION="Cloud instance initialisation magic"
10 HOMEPAGE="https://launchpad.net/cloud-init"
11 SRC_URI="https://launchpad.net/${PN}/trunk/${PV}/+download/${P}.tar.gz"
17 RESTRICT="!test? ( test )"
20 dev-python/jinja[${PYTHON_USEDEP}]
21 dev-python/oauthlib[${PYTHON_USEDEP}]
22 dev-python/pyserial[${PYTHON_USEDEP}]
23 >=dev-python/configobj-5.0.2[${PYTHON_USEDEP}]
24 dev-python/pyyaml[${PYTHON_USEDEP}]
25 dev-python/requests[${PYTHON_USEDEP}]
26 dev-python/jsonpatch[${PYTHON_USEDEP}]
27 dev-python/jsonschema[${PYTHON_USEDEP}]
28 dev-python/six[${PYTHON_USEDEP}]
31 dev-python/setuptools[${PYTHON_USEDEP}]
34 >=dev-python/httpretty-0.7.1[${PYTHON_USEDEP}]
35 dev-python/mock[${PYTHON_USEDEP}]
36 dev-python/nose[${PYTHON_USEDEP}]
37 dev-python/unittest2[${PYTHON_USEDEP}]
38 dev-python/coverage[${PYTHON_USEDEP}]
39 dev-python/contextlib2[${PYTHON_USEDEP}]
44 net-analyzer/macchanger
52 # https://code.launchpad.net/~gilles-dartiguelongue/cloud-init/+git/cloud-init/+merge/358777
53 "${FILESDIR}/${PN}-18.4-fix-packages-module.patch"
54 "${FILESDIR}/${P}-gentoo-support-upstream-templates.patch"
55 "${FILESDIR}"/18.4-fix-filename-for-storing-locale.patch
56 "${FILESDIR}"/18.4-fix-update_package_sources-function.patch
57 "${FILESDIR}"/18.4-add-support-for-package_upgrade.patch
58 "${FILESDIR}/${P}_CVE-2020-8631.patch"
62 # Fix location of documentation installation
63 sed -i "s:USR + '/share/doc/cloud-init:USR + '/share/doc/${PF}:" setup.py || die
64 distutils-r1_src_prepare
68 # Do not use Makefile target as it does not setup environment correclty
69 esetup.py nosetests -v --where cloudinit --where tests/unittests || die
73 distutils-r1_python_install --init-system=sysvinit_openrc,systemd --distro gentoo
76 python_install_all() {
79 distutils-r1_python_install_all
81 # installs as non-executable
82 chmod +x "${D}"/etc/init.d/*
86 elog "cloud-init-local needs to be run in the boot runlevel because it"
87 elog "modifies services in the default runlevel. When a runlevel is started"
88 elog "it is cached, so modifications that happen to the current runlevel"
89 elog "while you are in it are not acted upon."