salt-2016.3.6.ebuild 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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 )
  5. inherit eutils systemd distutils-r1
  6. DESCRIPTION="Salt is a remote execution and configuration manager"
  7. HOMEPAGE="http://saltstack.org/"
  8. if [[ ${PV} == 9999* ]]; then
  9. inherit git-r3
  10. EGIT_REPO_URI="git://github.com/${PN}stack/${PN}.git"
  11. EGIT_BRANCH="develop"
  12. SRC_URI=""
  13. KEYWORDS=""
  14. else
  15. SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
  16. KEYWORDS="~x86 ~amd64"
  17. fi
  18. LICENSE="Apache-2.0"
  19. SLOT="0"
  20. IUSE="cherrypy ldap libcloud libvirt gnupg keyring mako mongodb mysql neutron nova"
  21. IUSE+=" openssl portage profile redis selinux test timelib raet +zeromq vim-syntax"
  22. RDEPEND="sys-apps/pciutils
  23. dev-python/jinja[${PYTHON_USEDEP}]
  24. >=dev-python/msgpack-0.3[${PYTHON_USEDEP}]
  25. dev-python/pyyaml[${PYTHON_USEDEP}]
  26. dev-python/markupsafe[${PYTHON_USEDEP}]
  27. >=dev-python/requests-1.0.0[${PYTHON_USEDEP}]
  28. dev-python/setuptools[${PYTHON_USEDEP}]
  29. >=www-servers/tornado-4.2.1[${PYTHON_USEDEP}]
  30. virtual/python-futures[${PYTHON_USEDEP}]
  31. libcloud? ( >=dev-python/libcloud-0.14.0[${PYTHON_USEDEP}] )
  32. mako? ( dev-python/mako[${PYTHON_USEDEP}] )
  33. ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] )
  34. libvirt? ( dev-python/libvirt-python[${PYTHON_USEDEP}] )
  35. openssl? (
  36. dev-libs/openssl:*[-bindist]
  37. dev-python/pyopenssl[${PYTHON_USEDEP}]
  38. )
  39. raet? (
  40. >=dev-python/libnacl-1.0.0[${PYTHON_USEDEP}]
  41. >=dev-python/ioflo-1.1.7[${PYTHON_USEDEP}]
  42. >=dev-python/raet-0.6.0[${PYTHON_USEDEP}]
  43. )
  44. zeromq? (
  45. >=dev-python/pyzmq-2.2.0[${PYTHON_USEDEP}]
  46. >=dev-python/pycrypto-2.6.1[${PYTHON_USEDEP}]
  47. )
  48. cherrypy? ( >=dev-python/cherrypy-3.2.2[${PYTHON_USEDEP}] )
  49. mongodb? ( dev-python/pymongo[${PYTHON_USEDEP}] )
  50. portage? ( sys-apps/portage[${PYTHON_USEDEP}] )
  51. keyring? ( dev-python/keyring[${PYTHON_USEDEP}] )
  52. mysql? ( dev-python/mysql-python[${PYTHON_USEDEP}] )
  53. redis? ( dev-python/redis-py[${PYTHON_USEDEP}] )
  54. selinux? ( sec-policy/selinux-salt )
  55. timelib? ( dev-python/timelib[${PYTHON_USEDEP}] )
  56. nova? ( >=dev-python/python-novaclient-2.17.0[${PYTHON_USEDEP}] )
  57. neutron? ( >=dev-python/python-neutronclient-2.3.6[${PYTHON_USEDEP}] )
  58. gnupg? ( dev-python/python-gnupg[${PYTHON_USEDEP}] )
  59. profile? ( dev-python/yappi[${PYTHON_USEDEP}] )
  60. vim-syntax? ( app-vim/salt-vim )"
  61. DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
  62. test? (
  63. dev-python/psutil[${PYTHON_USEDEP}]
  64. dev-python/pip[${PYTHON_USEDEP}]
  65. dev-python/virtualenv[${PYTHON_USEDEP}]
  66. dev-python/mock[${PYTHON_USEDEP}]
  67. dev-python/timelib[${PYTHON_USEDEP}]
  68. >=dev-python/boto-2.32.1[${PYTHON_USEDEP}]
  69. !x86? ( dev-python/boto3[${PYTHON_USEDEP}] )
  70. >=dev-python/moto-0.3.6[${PYTHON_USEDEP}]
  71. >=dev-python/SaltTesting-2016.5.11[${PYTHON_USEDEP}]
  72. >=dev-python/libcloud-0.14.0[${PYTHON_USEDEP}]
  73. ${RDEPEND}
  74. )"
  75. DOCS=( README.rst AUTHORS )
  76. REQUIRED_USE="|| ( raet zeromq )"
  77. RESTRICT="x86? ( test )"
  78. PATCHES=(
  79. "${FILESDIR}/${PN}-2016.3.5-tmpdir.patch"
  80. "${FILESDIR}/${PN}-2016.3.1-dont-realpath-tmpdir.patch"
  81. "${FILESDIR}/${PN}-2016.3.4-test-nonexist-dirs.patch"
  82. "${FILESDIR}/${PN}-2016.3.4-dont-test-ordering.patch"
  83. )
  84. python_prepare() {
  85. # this test fails because it trys to "pip install distribute"
  86. rm tests/unit/{modules,states}/zcbuildout_test.py \
  87. tests/unit/modules/{rh_ip,win_network,random_org}_test.py || die
  88. # apparently libcloud does not know about this?
  89. rm tests/unit/cloud/clouds/dimensiondata_test.py || die
  90. # seriously? "ValueError: Missing (or not readable) key file: '/home/dany/PRIVKEY.pem'"
  91. rm tests/unit/cloud/clouds/gce_test.py || die
  92. }
  93. python_install_all() {
  94. local svc
  95. USE_SETUPTOOLS=1 distutils-r1_python_install_all
  96. for svc in minion master syndic api; do
  97. newinitd "${FILESDIR}"/${svc}-initd-4 salt-${svc}
  98. newconfd "${FILESDIR}"/${svc}-confd-1 salt-${svc}
  99. systemd_dounit "${FILESDIR}"/salt-${svc}.service
  100. done
  101. insinto /etc/${PN}
  102. doins -r conf/*
  103. }
  104. python_test() {
  105. local tempdir
  106. # testsuite likes lots of files
  107. ulimit -n 3072 || die
  108. # ${T} is too long a path for the tests to work
  109. tempdir="$(mktemp -dup /tmp salt-XXX)"
  110. mkdir "${T}/$(basename "${tempdir}")"
  111. (
  112. cleanup() { rm -f "${tempdir}"; }
  113. trap cleanup EXIT
  114. addwrite "${tempdir}"
  115. ln -s "$(realpath --relative-to=/tmp "${T}/$(basename "${tempdir}")")" "${tempdir}"
  116. USE_SETUPTOOLS=1 SHELL="/bin/bash" \
  117. TMPDIR="${tempdir}" \
  118. ${EPYTHON} tests/runtests.py \
  119. --unit-tests --no-report --verbose
  120. ) || die "testing failed"
  121. }