Add vifm from git.
[rentiernetz-overlay.git] / app-misc / vifm / vifm-9999.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-misc/vifm/vifm-0.7.7.ebuild,v 1.4 2014/07/15 09:42:05 nimiux Exp $
4
5 EAPI=5
6
7 inherit eutils git-r3 autotools vim-doc
8
9 DESCRIPTION="Console file manager with vi(m)-like keybindings"
10 HOMEPAGE="http://vifm.sourceforge.net/"
11 EGIT_REPO_URI="https://github.com/ksteen/vifm.git"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS=""
16 IUSE="X developer +extended-keys gtk +magic vim vim-syntax"
17
18 DEPEND="
19         >=sys-libs/ncurses-5.7-r7
20         magic? ( sys-apps/file )
21         gtk? ( x11-libs/gtk+:2 )
22         X? ( x11-libs/libX11 )
23 "
24 RDEPEND="
25         ${DEPEND}
26         vim? ( || ( app-editors/vim app-editors/gvim ) )
27         vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )
28 "
29
30 DOCS=( AUTHORS FAQ NEWS README TODO )
31
32 src_prepare() {
33         eautoreconf
34 }
35
36 src_configure() {
37         econf \
38                 $(use_enable developer) \
39                 $(use_enable extended-keys) \
40                 $(use_with magic libmagic) \
41                 $(use_with gtk) \
42                 $(use_with X X11)
43 }
44
45 src_install() {
46         emake DESTDIR="${D}" install
47
48         if use vim; then
49                 local t
50                 for t in doc plugin; do
51                         insinto /usr/share/vim/vimfiles/"${t}"
52                         doins "${S}"/data/vim/"${t}"/"${PN}".*
53                 done
54         fi
55
56         if use vim-syntax; then
57                 local t
58                 for t in ftdetect ftplugin syntax; do
59                         insinto /usr/share/vim/vimfiles/"${t}"
60                         doins "${S}"/data/vim/"${t}"/"${PN}".vim
61                 done
62         fi
63 }
64
65 src_test() {
66         emake check
67 }
68
69 pkg_postinst() {
70         if use vim; then
71                 update_vim_helptags
72
73                 if [[ -n ${REPLACING_VERSIONS} ]]; then
74                         elog
75                         elog "You don't need to copy or link any files for"
76                         elog "  the vim plugin and documentation to work anymore."
77                         elog "If you copied any vifm files to ~/.vim/ manually"
78                         elog "  in earlier vifm versions, please delete them."
79                 fi
80                 elog
81                 elog "To use vim in vifm to view the documentation"
82                 elog "  edit ~/.vifm/vifmrc and set vimhelp instead of novimhelp"
83                 elog
84         fi
85 }
86
87 pkg_postrm() {
88         use vim && update_vim_helptags
89 }