app-portage/layman: Python 3.8 compatibility
[gentoo.git] / app-portage / layman / layman-2.4.2-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5
6 PYTHON_COMPAT=( python3_6 )
7 PYTHON_REQ_USE="xml(+),sqlite?"
8
9 inherit eutils distutils-r1 linux-info prefix
10
11 DESCRIPTION="Tool to manage Gentoo overlays"
12 HOMEPAGE="https://wiki.gentoo.org/wiki/Layman"
13 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
14
15 LICENSE="GPL-2"
16 SLOT="0"
17 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
18 IUSE="bazaar cvs darcs +git gpg g-sorcery mercurial sqlite squashfs subversion sync-plugin-portage test"
19 RESTRICT="!test? ( test )"
20
21 DEPEND="test? ( dev-vcs/subversion )
22         "
23
24 RDEPEND="
25         bazaar? ( dev-vcs/bzr )
26         cvs? ( dev-vcs/cvs )
27         darcs? ( dev-vcs/darcs )
28         git? ( dev-vcs/git )
29         mercurial? ( dev-vcs/mercurial )
30         g-sorcery? ( app-portage/g-sorcery )
31         subversion? (
32                 || (
33                         >=dev-vcs/subversion-1.5.4[http]
34                         >=dev-vcs/subversion-1.5.4[webdav-neon]
35                         >=dev-vcs/subversion-1.5.4[webdav-serf]
36                 )
37         )
38         gpg? ( >=dev-python/pyGPG-0.2 )
39         sync-plugin-portage? ( >=sys-apps/portage-2.2.16[${PYTHON_USEDEP}] )
40         !sync-plugin-portage? ( sys-apps/portage[${PYTHON_USEDEP}] )
41         >=dev-python/ssl-fetch-0.4[${PYTHON_USEDEP}]
42         "
43
44 layman_check_kernel_config() {
45         local CONFIG_CHECK
46         use squashfs && CONFIG_CHECK+=" ~BLK_DEV_LOOP ~SQUASHFS"
47         [[ -n ${CONFIG_CHECK} ]] && check_extra_config
48 }
49
50 pkg_pretend() {
51         layman_check_kernel_config
52 }
53
54 pkg_setup() {
55         layman_check_kernel_config
56 }
57
58 python_prepare_all() {
59         python_setup
60         esetup.py setup_plugins
61         distutils-r1_python_prepare_all
62         eprefixify etc/layman.cfg layman/config.py
63 }
64
65 python_test() {
66         suite=layman/tests/external.py
67         PYTHONPATH="." "${PYTHON}" ${suite} || die "test suite '${suite}' failed"
68         unset suite
69 }
70
71 python_install_all() {
72         distutils-r1_python_install_all
73
74         insinto /etc/layman
75         doins etc/layman.cfg
76
77         doman doc/layman.8
78         dohtml doc/layman.8.html
79
80         keepdir /var/lib/layman
81         keepdir /etc/layman/overlays
82 }
83
84 pkg_postinst() {
85         # now run layman's update utility
86         einfo "Running layman-updater..."
87         "${EROOT}"/usr/bin/layman-updater
88         einfo
89 }