Gentoo Archives: gentoo-commits

From: Matt Thode <prometheanfire@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-cluster/swift/
Date: Wed, 30 Nov 2016 05:19:05
Message-Id: 1480483090.15e1c644a002244c3fae7e32d59a790d25f90318.prometheanfire@gentoo
1 commit: 15e1c644a002244c3fae7e32d59a790d25f90318
2 Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
3 AuthorDate: Wed Nov 30 05:03:49 2016 +0000
4 Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 30 05:18:10 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=15e1c644
7
8 sys-cluster/swift: switch to python_install_all
9
10 Package-Manager: portage-2.3.0
11
12 sys-cluster/swift/swift-2.10.0-r1.ebuild | 117 +++++++++++++++++++++++++++++++
13 1 file changed, 117 insertions(+)
14
15 diff --git a/sys-cluster/swift/swift-2.10.0-r1.ebuild b/sys-cluster/swift/swift-2.10.0-r1.ebuild
16 new file mode 100644
17 index 00000000..52716bf
18 --- /dev/null
19 +++ b/sys-cluster/swift/swift-2.10.0-r1.ebuild
20 @@ -0,0 +1,117 @@
21 +# Copyright 1999-2016 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +# $Id$
24 +
25 +EAPI=5
26 +PYTHON_COMPAT=( python2_7 )
27 +
28 +inherit distutils-r1 eutils linux-info user
29 +
30 +DESCRIPTION="A highly available, distributed, and eventually consistent object/blob store"
31 +HOMEPAGE="https://launchpad.net/swift"
32 +SRC_URI="https://tarballs.openstack.org/${PN}/${P}.tar.gz"
33 +
34 +LICENSE="Apache-2.0"
35 +SLOT="0"
36 +KEYWORDS="~amd64 ~arm64 ~x86"
37 +IUSE="proxy account container object +memcached"
38 +REQUIRED_USE="|| ( proxy account container object )"
39 +
40 +CDEPEND="
41 + >=dev-python/pbr-0.8.0[${PYTHON_USEDEP}]
42 + <dev-python/pbr-2.0[${PYTHON_USEDEP}]"
43 +DEPEND="
44 + dev-python/setuptools[${PYTHON_USEDEP}]
45 + ${CDEPEND}"
46 +
47 +RDEPEND="
48 + ${CDEPEND}
49 + virtual/python-dnspython[${PYTHON_USEDEP}]
50 + >=dev-python/eventlet-0.17.4[${PYTHON_USEDEP}]
51 + >=dev-python/greenlet-0.3.1[${PYTHON_USEDEP}]
52 + >=dev-python/netifaces-0.5[${PYTHON_USEDEP}]
53 + !~dev-python/netifaces-0.10.0[${PYTHON_USEDEP}]
54 + !~dev-python/netifaces-0.10.1[${PYTHON_USEDEP}]
55 + >=dev-python/pastedeploy-1.3.3[${PYTHON_USEDEP}]
56 + >=dev-python/six-1.9.0[${PYTHON_USEDEP}]
57 + dev-python/pyxattr[${PYTHON_USEDEP}]
58 + >=dev-python/PyECLib-1.2.0[${PYTHON_USEDEP}]
59 + >=dev-python/cryptography-1.0[${PYTHON_USEDEP}]
60 + !~dev-python/cryptography-1.3.0[${PYTHON_USEDEP}]
61 + memcached? ( net-misc/memcached )
62 + net-misc/rsync[xattr]"
63 +
64 +pkg_pretend() {
65 + linux-info_pkg_setup
66 + CONFIG_CHECK="~EXT3_FS_XATTR ~SQUASHFS_XATTR ~CIFS_XATTR ~JFFS2_FS_XATTR
67 + ~TMPFS_XATTR ~UBIFS_FS_XATTR ~EXT2_FS_XATTR ~REISERFS_FS_XATTR ~EXT4_FS_XATTR
68 + ~ZFS"
69 + if linux_config_exists; then
70 + for module in ${CONFIG_CHECK}; do
71 + linux_chkconfig_present ${module} || ewarn "${module} needs to be enabled"
72 + done
73 + fi
74 +}
75 +
76 +pkg_setup() {
77 + enewuser swift
78 + enewgroup swift
79 +}
80 +
81 +src_prepare() {
82 + sed -i 's/xattr/pyxattr/g' swift.egg-info/requires.txt || die
83 + sed -i 's/xattr/pyxattr/g' requirements.txt || die
84 + sed -i '/^hacking/d' test-requirements.txt || die
85 + distutils-r1_python_prepare_all
86 +}
87 +
88 +src_test () {
89 + # https://bugs.launchpad.net/swift/+bug/1249727
90 + find . \( -name test_wsgi.py -o -name test_locale.py -o -name test_utils.py \) -delete || die
91 + SKIP_PIP_INSTALL=1 PBR_VERSION=0.6.0 sh .unittests || die
92 +}
93 +
94 +python_install_all() {
95 + distutils-r1_python_install_all
96 + keepdir /etc/swift
97 + insinto /etc/swift
98 +
99 + newins "etc/swift.conf-sample" "swift.conf"
100 + newins "etc/rsyncd.conf-sample" "rsyncd.conf"
101 + newins "etc/mime.types-sample" "mime.types-sample"
102 + newins "etc/memcache.conf-sample" "memcache.conf-sample"
103 + newins "etc/drive-audit.conf-sample" "drive-audit.conf-sample"
104 + newins "etc/dispersion.conf-sample" "dispersion.conf-sample"
105 +
106 + if use proxy; then
107 + newinitd "${FILESDIR}/swift-proxy.initd" "swift-proxy"
108 + newins "etc/proxy-server.conf-sample" "proxy-server.conf"
109 + if use memcached; then
110 + sed -i '/depend/a\
111 + need memcached' "${D}/etc/init.d/swift-proxy"
112 + fi
113 + fi
114 + if use account; then
115 + newinitd "${FILESDIR}/swift-account.initd" "swift-account"
116 + newins "etc/account-server.conf-sample" "account-server.conf"
117 + fi
118 + if use container; then
119 + newinitd "${FILESDIR}/swift-container.initd" "swift-container"
120 + newins "etc/container-server.conf-sample" "container-server.conf"
121 + fi
122 + if use object; then
123 + newinitd "${FILESDIR}/swift-object.initd" "swift-object"
124 + newins "etc/object-server.conf-sample" "object-server.conf"
125 + newins "etc/object-expirer.conf-sample" "object-expirer.conf"
126 + fi
127 +
128 + fowners swift:swift "/etc/swift" || die "fowners failed"
129 +}
130 +
131 +pkg_postinst() {
132 + elog "Openstack swift will default to using insecure http unless a"
133 + elog "certificate is created in /etc/swift/cert.crt and the associated key"
134 + elog "in /etc/swift/cert.key. These can be created with the following:"
135 + elog " * cd /etc/swift"
136 + elog " * openssl req -new -x509 -nodes -out cert.crt -keyout cert.key"
137 +}