salt-9999.ebuild 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. # Copyright 1999-2016 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. python_prepare() {
  79. # this test fails because it trys to "pip install distribute"
  80. rm tests/unit/{modules,states}/zcbuildout_test.py \
  81. tests/unit/modules/{rh_ip,win_network}_test.py || die
  82. # apparently libcloud does not know about this?
  83. rm tests/unit/cloud/clouds/dimensiondata_test.py || die
  84. # seriously? "ValueError: Missing (or not readable) key file: '/home/dany/PRIVKEY.pem'"
  85. rm tests/unit/cloud/clouds/gce_test.py || die
  86. }
  87. python_install_all() {
  88. local svc
  89. USE_SETUPTOOLS=1 distutils-r1_python_install_all
  90. for svc in minion master syndic api; do
  91. newinitd "${FILESDIR}"/${svc}-initd-4 salt-${svc}
  92. newconfd "${FILESDIR}"/${svc}-confd-1 salt-${svc}
  93. systemd_dounit "${FILESDIR}"/salt-${svc}.service
  94. done
  95. insinto /etc/${PN}
  96. doins -r conf/*
  97. }
  98. python_test() {
  99. local tempdir
  100. # testsuite likes lots of files
  101. ulimit -n 3072 || die
  102. # ${T} is too long a path for the tests to work
  103. tempdir="$(mktemp -dup /tmp salt-XXX)"
  104. mkdir "${T}/$(basename "${tempdir}")"
  105. (
  106. cleanup() { rm -f "${tempdir}"; }
  107. trap cleanup EXIT
  108. addwrite "${tempdir}"
  109. ln -s "$(realpath --relative-to=/tmp "${T}/$(basename "${tempdir}")")" "${tempdir}"
  110. USE_SETUPTOOLS=1 SHELL="/bin/bash" \
  111. TMPDIR="${tempdir}" \
  112. ${EPYTHON} tests/runtests.py \
  113. --unit-tests --no-report --verbose
  114. ) || die "testing failed"
  115. }