1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python2_7 python3_6 )
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"
15 KEYWORDS="~amd64 ~x86"
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}"/${P}-fix-packages-module.patch
54 "${FILESDIR}"/${P}-gentoo-support-upstream-templates.patch
55 "${FILESDIR}"/${PV}-fix-filename-for-storing-locale.patch
56 "${FILESDIR}"/${PV}-fix-update_package_sources-function.patch
57 "${FILESDIR}"/${PV}-add-support-for-package_upgrade.patch
61 # Fix location of documentation installation
62 sed -i "s:USR + '/share/doc/cloud-init:USR + '/share/doc/${PF}:" setup.py || die
63 distutils-r1_src_prepare
67 # Do not use Makefile target as it does not setup environment correclty
68 esetup.py nosetests -v --where cloudinit --where tests/unittests || die
72 distutils-r1_python_install --init-system=sysvinit_openrc,systemd --distro gentoo
75 python_install_all() {
78 distutils-r1_python_install_all
80 # installs as non-executable
81 chmod +x "${D}"/etc/init.d/*
85 elog "cloud-init-local needs to be run in the boot runlevel because it"
86 elog "modifies services in the default runlevel. When a runlevel is started"
87 elog "it is cached, so modifications that happen to the current runlevel"
88 elog "while you are in it are not acted upon."