*/*: Discontinue Gentoo SuperH port
[gentoo.git] / app-admin / eselect / eselect-1.4.12.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 inherit bash-completion-r1
7
8 DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
9 HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Eselect"
10 SRC_URI="https://dev.gentoo.org/~ulm/eselect/${P}.tar.xz"
11
12 LICENSE="GPL-2+ || ( GPL-2+ CC-BY-SA-3.0 )"
13 SLOT="0"
14 KEYWORDS="~alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
15 IUSE="doc emacs vim-syntax"
16
17 RDEPEND="sys-apps/sed
18         || (
19                 sys-apps/coreutils
20                 sys-freebsd/freebsd-bin
21                 app-misc/realpath
22         )"
23 DEPEND="${RDEPEND}
24         doc? ( dev-python/docutils )"
25 RDEPEND="${RDEPEND}
26         sys-apps/file
27         sys-libs/ncurses:0"
28
29 PDEPEND="emacs? ( app-emacs/eselect-mode )
30         vim-syntax? ( app-vim/eselect-syntax )"
31
32 src_compile() {
33         emake
34         use doc && emake html
35 }
36
37 src_install() {
38         emake DESTDIR="${D}" install
39         newbashcomp misc/${PN}.bashcomp ${PN}
40         dodoc AUTHORS ChangeLog NEWS README TODO doc/*.txt
41         if use doc; then
42                 docinto html
43                 dodoc *.html doc/*.html doc/*.css
44         fi
45
46         # needed by news module
47         keepdir /var/lib/gentoo/news
48         if ! use prefix; then
49                 fowners root:portage /var/lib/gentoo/news
50                 fperms g+w /var/lib/gentoo/news
51         fi
52 }
53
54 pkg_postinst() {
55         # fowners in src_install doesn't work for the portage group:
56         # merging changes the group back to root
57         if ! use prefix; then
58                 chgrp portage "${EROOT}/var/lib/gentoo/news" \
59                         && chmod g+w "${EROOT}/var/lib/gentoo/news"
60         fi
61 }