2018-03-18 12:26:19 +03:00
|
|
|
# Copyright 1999-2018 Gentoo Foundation
|
2014-06-03 10:58:39 +04:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
2018-07-25 13:34:31 +03:00
|
|
|
EAPI=7
|
|
|
|
PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} pypy )
|
2014-06-03 10:58:39 +04:00
|
|
|
|
|
|
|
inherit distutils-r1 eutils
|
|
|
|
|
|
|
|
DESCRIPTION="Python interface to xattr"
|
2018-03-18 12:26:19 +03:00
|
|
|
HOMEPAGE="https://pyxattr.k1024.org/"
|
2014-06-03 10:58:39 +04:00
|
|
|
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
|
2018-03-18 12:26:19 +03:00
|
|
|
https://pyxattr.k1024.org/downloads/${P}.tar.gz"
|
2014-06-03 10:58:39 +04:00
|
|
|
|
|
|
|
LICENSE="LGPL-2.1"
|
|
|
|
SLOT="0"
|
2017-01-31 08:49:52 +03:00
|
|
|
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
|
2014-06-03 10:58:39 +04:00
|
|
|
IUSE="doc test"
|
|
|
|
|
|
|
|
RDEPEND="sys-apps/attr"
|
|
|
|
DEPEND="${RDEPEND}
|
|
|
|
dev-python/setuptools[${PYTHON_USEDEP}]
|
2017-01-31 08:49:52 +03:00
|
|
|
doc? ( >=dev-python/sphinx-1.3.1[${PYTHON_USEDEP}] )
|
2014-06-03 10:58:39 +04:00
|
|
|
test? ( dev-python/nose[${PYTHON_USEDEP}] )"
|
|
|
|
|
|
|
|
python_prepare_all() {
|
|
|
|
sed -i -e 's:, "-Werror"::' setup.py || die
|
2017-01-31 08:49:52 +03:00
|
|
|
# Bug 548486
|
|
|
|
sed -e "s:html_theme = 'default':html_theme = 'classic':" \
|
|
|
|
-i doc/conf.py || die
|
2014-06-03 10:58:39 +04:00
|
|
|
|
|
|
|
distutils-r1_python_prepare_all
|
|
|
|
}
|
|
|
|
|
|
|
|
python_compile_all() {
|
|
|
|
use doc && emake doc
|
|
|
|
}
|
|
|
|
|
|
|
|
src_test() {
|
|
|
|
# Perform the tests in /var/tmp; that location is more likely
|
|
|
|
# to have xattr support than /tmp which is often tmpfs.
|
2018-07-25 13:34:31 +03:00
|
|
|
local -x TEST_DIR="${TEST_DIR:-/var/tmp}"
|
|
|
|
# Ignore selinux attributes by default, bug #503946.
|
|
|
|
local -x TEST_IGNORE_XATTRS="${TEST_IGNORE_XATTRS:-security.selinux}"
|
2014-06-03 10:58:39 +04:00
|
|
|
|
2018-07-25 13:34:31 +03:00
|
|
|
einfo "Please note that the tests fail if xattrs are not supported"
|
|
|
|
einfo "by the filesystem used for ${TEST_DIR}."
|
|
|
|
einfo
|
|
|
|
einfo "The location for tests can be overriden using TEST_DIR variable:"
|
|
|
|
einfo " $ export TEST_DIR=/my/test/place"
|
|
|
|
einfo
|
|
|
|
einfo "Additionally, TEST_IGNORE_XATTRS can be set to control which"
|
|
|
|
einfo "external attributes are ignored by the tests."
|
|
|
|
einfo "See https://bugs.gentoo.org/503946 for details."
|
|
|
|
einfo
|
2014-06-03 10:58:39 +04:00
|
|
|
distutils-r1_src_test
|
|
|
|
}
|
|
|
|
|
|
|
|
python_test() {
|
2018-07-25 13:34:31 +03:00
|
|
|
nosetests -v || die "Tests fail with ${EPYTHON}"
|
2014-06-03 10:58:39 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
python_install_all() {
|
|
|
|
use doc && local HTML_DOCS=( doc/html/. )
|
|
|
|
distutils-r1_python_install_all
|
|
|
|
}
|