cloud-init-0.7.9.ebuild 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PYTHON_COMPAT=( python2_7 python3_4 python3_5 )
  5. inherit distutils-r1 eutils multilib systemd
  6. DESCRIPTION="cloud initialisation magic"
  7. HOMEPAGE="https://launchpad.net/cloud-init"
  8. SRC_URI="https://launchpad.net/${PN}/trunk/${PV}/+download/${P}.tar.gz"
  9. LICENSE="GPL-3"
  10. SLOT="0"
  11. KEYWORDS="amd64 x86"
  12. IUSE="test"
  13. CDEPEND="
  14. dev-python/six[${PYTHON_USEDEP}]
  15. dev-python/configobj[${PYTHON_USEDEP}]
  16. dev-python/jinja[${PYTHON_USEDEP}]
  17. dev-python/jsonpatch[${PYTHON_USEDEP}]
  18. dev-python/oauthlib[${PYTHON_USEDEP}]
  19. dev-python/prettytable[${PYTHON_USEDEP}]
  20. dev-python/pyserial[${PYTHON_USEDEP}]
  21. dev-python/pyyaml[${PYTHON_USEDEP}]
  22. dev-python/requests[${PYTHON_USEDEP}]
  23. dev-python/cheetah[$(python_gen_usedep 'python2_7')]
  24. "
  25. DEPEND="
  26. dev-python/setuptools[${PYTHON_USEDEP}]
  27. test? (
  28. ${CDEPEND}
  29. >=dev-python/httpretty-0.7.1[${PYTHON_USEDEP}]
  30. dev-python/mock[${PYTHON_USEDEP}]
  31. dev-python/nose[${PYTHON_USEDEP}]
  32. dev-python/unittest2[${PYTHON_USEDEP}]
  33. dev-python/pep8[${PYTHON_USEDEP}]
  34. dev-python/flake8[${PYTHON_USEDEP}]
  35. dev-python/hacking[${PYTHON_USEDEP}]
  36. )
  37. "
  38. RDEPEND="
  39. ${CDEPEND}
  40. net-analyzer/macchanger
  41. sys-apps/iproute2
  42. sys-fs/growpart
  43. virtual/logger
  44. "
  45. PATCHES=( "${FILESDIR}/cloud-init-0.7.9-tests.patch" )
  46. python_prepare_all() {
  47. sed -i '/^argparse/d' requirements.txt || die
  48. sed -i '/^hacking/d' test-requirements.txt || die
  49. distutils-r1_python_prepare_all
  50. }
  51. python_test() {
  52. emake test
  53. }
  54. python_install() {
  55. distutils-r1_python_install "--init-system=sysvinit_openrc"
  56. }
  57. python_install_all() {
  58. keepdir /etc/cloud
  59. distutils-r1_python_install_all
  60. chmod +x "${D}"/etc/init.d/cloud-config
  61. chmod +x "${D}"/etc/init.d/cloud-final
  62. chmod +x "${D}"/etc/init.d/cloud-init
  63. chmod +x "${D}"/etc/init.d/cloud-init-local
  64. insinto /etc/cloud/templates
  65. doins "${FILESDIR}/hosts.gentoo.tmpl"
  66. insinto /etc/cloud
  67. doins "${FILESDIR}/cloud.cfg"
  68. systemd_dounit "${S}"/systemd/cloud-config.service
  69. systemd_dounit "${S}"/systemd/cloud-config.target
  70. systemd_dounit "${S}"/systemd/cloud-final.service
  71. systemd_dounit "${S}"/systemd/cloud-init-local.service
  72. systemd_dounit "${S}"/systemd/cloud-init.service
  73. }
  74. pkg_postinst() {
  75. elog "cloud-init-local needs to be run in the boot runlevel because it"
  76. elog "modifies services in the default runlevel. When a runlevel is started"
  77. elog "it is cached, so modifications that happen to the current runlevel"
  78. elog "while you are in it are not acted upon."
  79. }