cloud-init-0.7.6-r1.ebuild 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python2_7 )
  5. inherit distutils-r1 eutils multilib systemd
  6. DESCRIPTION="EC2 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/cheetah[${PYTHON_USEDEP}]
  15. dev-python/configobj[${PYTHON_USEDEP}]
  16. dev-python/jinja[${PYTHON_USEDEP}]
  17. dev-python/jsonpatch[${PYTHON_USEDEP}]
  18. dev-python/oauth[${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. "
  24. DEPEND="
  25. dev-python/setuptools[${PYTHON_USEDEP}]
  26. test? (
  27. ${CDEPEND}
  28. >=dev-python/httpretty-0.7.1[${PYTHON_USEDEP}]
  29. dev-python/mocker[${PYTHON_USEDEP}]
  30. dev-python/nose[${PYTHON_USEDEP}]
  31. ~dev-python/pep8-1.5.7[${PYTHON_USEDEP}]
  32. dev-python/pyflakes[${PYTHON_USEDEP}]
  33. sys-apps/iproute2
  34. )
  35. "
  36. RDEPEND="
  37. ${CDEPEND}
  38. sys-fs/growpart
  39. virtual/logger
  40. "
  41. python_prepare_all() {
  42. # Note: Gentoo places ip in /sbin/ not /bin/
  43. ebegin 'patching cloudinit/sources/DataSourceOpenNebula.py'
  44. sed \
  45. -e '438s/sbin/bin/' \
  46. -i cloudinit/sources/DataSourceOpenNebula.py
  47. STATUS=$?
  48. eend ${STATUS}
  49. [[ ${STATUS} -gt 0 ]] && die
  50. # https://bugs.launchpad.net/cloud-init/+bug/1380424
  51. ebegin 'patching tests/unittests/test_distros/test_netconfig.py'
  52. sed \
  53. -e '177s/test_simple_write_freebsd/_&/' \
  54. -i tests/unittests/test_distros/test_netconfig.py
  55. STATUS=$?
  56. eend ${STATUS}
  57. [[ ${STATUS} -gt 0 ]] && die
  58. # Note Gentoo installs its own RC files
  59. ebegin 'patching setup.py'
  60. sed \
  61. -e "144 s/'tests'/'tests.*', &/" \
  62. -e '163,167 d' \
  63. -i setup.py
  64. STATUS=$?
  65. eend ${STATUS}
  66. [[ ${STATUS} -gt 0 ]] && die
  67. distutils-r1_python_prepare_all
  68. }
  69. python_test() {
  70. emake test
  71. }
  72. python_install_all() {
  73. keepdir /etc/cloud
  74. distutils-r1_python_install_all
  75. doinitd "${S}"/sysvinit/gentoo/cloud-config
  76. doinitd "${S}"/sysvinit/gentoo/cloud-final
  77. doinitd "${S}"/sysvinit/gentoo/cloud-init
  78. doinitd "${S}"/sysvinit/gentoo/cloud-init-local
  79. insinto /etc/cloud/templates
  80. doins "${FILESDIR}/hosts.gentoo.tmpl"
  81. insinto /etc/cloud
  82. doins "${FILESDIR}/cloud.cfg"
  83. systemd_dounit "${S}"/systemd/cloud-config.service
  84. systemd_dounit "${S}"/systemd/cloud-config.target
  85. systemd_dounit "${S}"/systemd/cloud-final.service
  86. systemd_dounit "${S}"/systemd/cloud-init-local.service
  87. systemd_dounit "${S}"/systemd/cloud-init.service
  88. }