# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 DISTUTILS_USE_PEP517=setuptools PYTHON_COMPAT=( python3_{8..10} pypy3 ) PYTHON_REQ_USE="threads(+)" inherit distutils-r1 virtualx DESCRIPTION="An asynchronous networking framework written in Python" HOMEPAGE="https://www.twistedmatrix.com/trac/" SRC_URI=" https://github.com/twisted/twisted/archive/${P}.tar.gz https://dev.gentoo.org/~mgorny/dist/twisted-regen-cache.gz" S=${WORKDIR}/${PN}-${P} LICENSE="MIT" SLOT="0" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" IUSE="conch crypt http2 serial test" RESTRICT="!test? ( test )" RDEPEND=" >=dev-python/attrs-19.2.0[${PYTHON_USEDEP}] >=dev-python/automat-0.3.0[${PYTHON_USEDEP}] >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}] >=dev-python/hyperlink-17.1.1[${PYTHON_USEDEP}] >=dev-python/incremental-21.3.0[${PYTHON_USEDEP}] >=dev-python/pyhamcrest-1.9.0[${PYTHON_USEDEP}] >=dev-python/typing-extensions-3.6.5[${PYTHON_USEDEP}] >=dev-python/zope-interface-4.4.2[${PYTHON_USEDEP}] conch? ( >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}] dev-python/bcrypt[${PYTHON_USEDEP}] >=dev-python/cryptography-1.5.0[${PYTHON_USEDEP}] dev-python/pyasn1[${PYTHON_USEDEP}] ) crypt? ( >=dev-python/pyopenssl-16.0.0[${PYTHON_USEDEP}] dev-python/service_identity[${PYTHON_USEDEP}] >=dev-python/idna-0.6[${PYTHON_USEDEP}] ) serial? ( >=dev-python/pyserial-3.0[${PYTHON_USEDEP}] ) http2? ( >=dev-python/h2-3.0.0[${PYTHON_USEDEP}] =dev-python/priority-1.1.0[${PYTHON_USEDEP}] "${D}$(python_get_sitedir)"/twisted/plugins/dropin.cache || die python_doscript "${WORKDIR}"/twisted-regen-cache } python_install_all() { distutils-r1_python_install_all newconfd "${FILESDIR}/twistd.conf" twistd newinitd "${FILESDIR}/twistd.init" twistd } python_postinst() { twisted-regen-cache || die } pkg_postinst() { if [[ -z ${ROOT} ]]; then python_foreach_impl python_postinst fi } python_postrm() { rm -f "${ROOT}$(python_get_sitedir)/twisted/plugins/dropin.cache" || die } pkg_postrm() { # if we're removing the last version, remove the cache file if [[ ! ${REPLACING_VERSIONS} ]]; then python_foreach_impl python_postrm fi }