dev-python/pytest: arm64 stable (bug #723996)
[gentoo.git] / app-emulation / cloud-init / cloud-init-19.4.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 PYTHON_COMPAT=( python3_6 python3_7 )
6
7 inherit distutils-r1
8
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"
12
13 LICENSE="GPL-3"
14 SLOT="0"
15 KEYWORDS="amd64 x86"
16 IUSE="test"
17 RESTRICT="!test? ( test )"
18
19 CDEPEND="
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}]
29 "
30 DEPEND="
31         dev-python/setuptools[${PYTHON_USEDEP}]
32         test? (
33                 ${CDEPEND}
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}]
40         )
41 "
42 RDEPEND="
43         ${CDEPEND}
44         net-analyzer/macchanger
45         sys-apps/iproute2
46         sys-fs/growpart
47         virtual/logger
48 "
49
50 PATCHES=(
51         # Fix Gentoo support
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"
59 )
60
61 src_prepare() {
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
65 }
66
67 python_test() {
68         # Do not use Makefile target as it does not setup environment correclty
69         esetup.py nosetests -v --where cloudinit --where tests/unittests || die
70 }
71
72 python_install() {
73         distutils-r1_python_install --init-system=sysvinit_openrc,systemd --distro gentoo
74 }
75
76 python_install_all() {
77         keepdir /etc/cloud
78
79         distutils-r1_python_install_all
80
81         # installs as non-executable
82         chmod +x "${D}"/etc/init.d/*
83 }
84
85 pkg_postinst() {
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."
90 }