swift-2.10.0-r1.ebuild 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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 linux-info user
  6. DESCRIPTION="A highly available, distributed, and eventually consistent object/blob store"
  7. HOMEPAGE="https://launchpad.net/swift"
  8. SRC_URI="https://tarballs.openstack.org/${PN}/${P}.tar.gz"
  9. LICENSE="Apache-2.0"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~arm64 ~x86"
  12. IUSE="proxy account container object +memcached"
  13. REQUIRED_USE="|| ( proxy account container object )"
  14. CDEPEND="
  15. >=dev-python/pbr-0.8.0[${PYTHON_USEDEP}]
  16. <dev-python/pbr-2.0[${PYTHON_USEDEP}]"
  17. DEPEND="
  18. dev-python/setuptools[${PYTHON_USEDEP}]
  19. ${CDEPEND}"
  20. RDEPEND="
  21. ${CDEPEND}
  22. virtual/python-dnspython[${PYTHON_USEDEP}]
  23. >=dev-python/eventlet-0.17.4[${PYTHON_USEDEP}]
  24. >=dev-python/greenlet-0.3.1[${PYTHON_USEDEP}]
  25. >=dev-python/netifaces-0.5[${PYTHON_USEDEP}]
  26. !~dev-python/netifaces-0.10.0[${PYTHON_USEDEP}]
  27. !~dev-python/netifaces-0.10.1[${PYTHON_USEDEP}]
  28. >=dev-python/pastedeploy-1.3.3[${PYTHON_USEDEP}]
  29. >=dev-python/six-1.9.0[${PYTHON_USEDEP}]
  30. dev-python/pyxattr[${PYTHON_USEDEP}]
  31. >=dev-python/PyECLib-1.2.0[${PYTHON_USEDEP}]
  32. >=dev-python/cryptography-1.0[${PYTHON_USEDEP}]
  33. !~dev-python/cryptography-1.3.0[${PYTHON_USEDEP}]
  34. memcached? ( net-misc/memcached )
  35. net-misc/rsync[xattr]"
  36. pkg_pretend() {
  37. linux-info_pkg_setup
  38. CONFIG_CHECK="~EXT3_FS_XATTR ~SQUASHFS_XATTR ~CIFS_XATTR ~JFFS2_FS_XATTR
  39. ~TMPFS_XATTR ~UBIFS_FS_XATTR ~EXT2_FS_XATTR ~REISERFS_FS_XATTR ~EXT4_FS_XATTR
  40. ~ZFS"
  41. if linux_config_exists; then
  42. for module in ${CONFIG_CHECK}; do
  43. linux_chkconfig_present ${module} || ewarn "${module} needs to be enabled"
  44. done
  45. fi
  46. }
  47. pkg_setup() {
  48. enewuser swift
  49. enewgroup swift
  50. }
  51. src_prepare() {
  52. sed -i 's/xattr/pyxattr/g' swift.egg-info/requires.txt || die
  53. sed -i 's/xattr/pyxattr/g' requirements.txt || die
  54. sed -i '/^hacking/d' test-requirements.txt || die
  55. distutils-r1_python_prepare_all
  56. }
  57. src_test () {
  58. # https://bugs.launchpad.net/swift/+bug/1249727
  59. find . \( -name test_wsgi.py -o -name test_locale.py -o -name test_utils.py \) -delete || die
  60. SKIP_PIP_INSTALL=1 PBR_VERSION=0.6.0 sh .unittests || die
  61. }
  62. python_install_all() {
  63. distutils-r1_python_install_all
  64. keepdir /etc/swift
  65. insinto /etc/swift
  66. newins "etc/swift.conf-sample" "swift.conf"
  67. newins "etc/rsyncd.conf-sample" "rsyncd.conf"
  68. newins "etc/mime.types-sample" "mime.types-sample"
  69. newins "etc/memcache.conf-sample" "memcache.conf-sample"
  70. newins "etc/drive-audit.conf-sample" "drive-audit.conf-sample"
  71. newins "etc/dispersion.conf-sample" "dispersion.conf-sample"
  72. if use proxy; then
  73. newinitd "${FILESDIR}/swift-proxy.initd" "swift-proxy"
  74. newins "etc/proxy-server.conf-sample" "proxy-server.conf"
  75. if use memcached; then
  76. sed -i '/depend/a\
  77. need memcached' "${D}/etc/init.d/swift-proxy"
  78. fi
  79. fi
  80. if use account; then
  81. newinitd "${FILESDIR}/swift-account.initd" "swift-account"
  82. newins "etc/account-server.conf-sample" "account-server.conf"
  83. fi
  84. if use container; then
  85. newinitd "${FILESDIR}/swift-container.initd" "swift-container"
  86. newins "etc/container-server.conf-sample" "container-server.conf"
  87. fi
  88. if use object; then
  89. newinitd "${FILESDIR}/swift-object.initd" "swift-object"
  90. newins "etc/object-server.conf-sample" "object-server.conf"
  91. newins "etc/object-expirer.conf-sample" "object-expirer.conf"
  92. fi
  93. fowners swift:swift "/etc/swift" || die "fowners failed"
  94. }
  95. pkg_postinst() {
  96. elog "Openstack swift will default to using insecure http unless a"
  97. elog "certificate is created in /etc/swift/cert.crt and the associated key"
  98. elog "in /etc/swift/cert.key. These can be created with the following:"
  99. elog " * cd /etc/swift"
  100. elog " * openssl req -new -x509 -nodes -out cert.crt -keyout cert.key"
  101. }