salt-2015.8.13.ebuild 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  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. >=dev-python/moto-0.3.6[${PYTHON_USEDEP}]
  70. >=dev-python/SaltTesting-2015.2.16[${PYTHON_USEDEP}]
  71. ${RDEPEND}
  72. )"
  73. DOCS=(README.rst AUTHORS)
  74. REQUIRED_USE="|| ( raet zeromq )"
  75. PATCHES=(
  76. "${FILESDIR}/${PN}-2015.8.0-remove-buggy-tests.patch"
  77. "${FILESDIR}/${PN}-2015.5.5-auth-tests.patch"
  78. "${FILESDIR}/${PN}-2015.5.5-cron-tests.patch"
  79. "${FILESDIR}/${PN}-2015.5.5-remove-buggy-tests.patch"
  80. "${FILESDIR}/${PN}-2015.8.2-tmpdir.patch"
  81. "${FILESDIR}/${PN}-2015.8.10-remove-failing-boto-test.patch"
  82. "${FILESDIR}/${PN}-2015.8.13-failing-gateway-tests.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
  88. }
  89. python_install_all() {
  90. local svc
  91. USE_SETUPTOOLS=1 distutils-r1_python_install_all
  92. for svc in minion master syndic api; do
  93. newinitd "${FILESDIR}"/${svc}-initd-4 salt-${svc}
  94. newconfd "${FILESDIR}"/${svc}-confd-1 salt-${svc}
  95. if [[ -e pkg/salt-${svc}.service ]]; then
  96. sed -i -r 's/After=(.*)/After=syslog.target \1/' pkg/salt-${svc}.service || die
  97. systemd_dounit pkg/salt-${svc}.service
  98. elif [[ -e "${FILESDIR}"/salt-${svc}.service ]]; then
  99. systemd_dounit "${FILESDIR}"/salt-${svc}.service
  100. fi
  101. done
  102. insinto /etc/${PN}
  103. doins -r conf/*
  104. }
  105. python_test() {
  106. local tempdir
  107. # testsuite likes lots of files
  108. ulimit -n 3072
  109. # ${T} is too long a path for the tests to work
  110. tempdir="$(mktemp -dup /tmp salt-XXX)"
  111. mkdir "${T}/$(basename "${tempdir}")"
  112. (
  113. cleanup() { rm -f "${tempdir}"; }
  114. trap cleanup EXIT
  115. addwrite "${tempdir}"
  116. ln -s "$(realpath --relative-to=/tmp "${T}/$(basename "${tempdir}")")" "${tempdir}"
  117. USE_SETUPTOOLS=1 SHELL="/bin/bash" TMPDIR="${tempdir}" \
  118. ${EPYTHON} tests/runtests.py \
  119. --unit-tests --no-report --verbose
  120. ) || die "testing failed"
  121. }