summaryrefslogtreecommitdiff
blob: 07ca32ba08dc396ec0dd0e4ca972266f240f6777 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-vim/cream/cream-0.30-r2.ebuild,v 1.2 2004/09/06 22:47:28 ciaranm Exp $

inherit vim-plugin eutils

DESCRIPTION="Cream is an easy-to-use configuration of the GVim text editor"
HOMEPAGE="http://cream.sourceforge.net"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz
	linguas_en? ( ${HOMEPAGE}/cream-spell-dict-eng-l.zip )
	linguas_fr? ( ${HOMEPAGE}/cream-spell-dict-fre-l.zip )
	linguas_es? ( ${HOMEPAGE}/cream-spell-dict-spa-l.zip )
	linguas_de? ( ${HOMEPAGE}/cream-spell-dict-ger-l.zip )"

IUSE=""
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86 sparc ~ppc mips ~amd64"

DEPEND=""
RDEPEND=">=app-editors/gvim-6.2
	dev-util/ctags"

src_unpack() {
	mkdir -p ${S}/spelldicts

	# install spell dictionaries into ${S}/spelldicts
	local my_a
	for my_a in ${A} ; do
		if [ -z ${my_a/*spell-dict*/} ] ; then
			cd ${S}/spelldicts
			unpack ${my_a}
		else
			cd ${WORKDIR}
			unpack ${my_a}
		fi
	done

	# change installation path + fix the wrapper command (disable plugins)
	cd ${S}
	cat >cream <<EOF
#!/bin/sh
gvim -u NONE -U "\\\$VIM/cream/creamrc" "\$@"
EOF
	sed -i "/let \$CREAM/s:VIMRUNTIME:VIM:" creamrc || die "sed #1 broke"

	# fix up evil autocmd behaviour, bug #61158
	epatch ${FILESDIR}/${P}-autocmd.patch
}

src_install() {
	# install launcher and menu entry
	dobin cream
	insinto /usr/share/applications
	doins cream.desktop
	insinto /usr/share/icons
	doins cream.svg cream.png

	# install shared vim files
	insinto /usr/share/vim/cream
	doins *.vim creamrc
	local dir
	for dir in addons bitmaps spelldicts ; do
		cp -R ${dir} ${D}/usr/share/vim/cream
	done
	dodir /usr/share/vim/vimfiles
	cp -R help ${D}/usr/share/vim/vimfiles/doc

	# install docs
	dodoc docs/*
	dohtml docs-html/*
}

pkg_postinst() {
	einfo " "
	einfo "To specify which dictionaries are installed with this ebuild,"
	einfo "set the LINGUAS variable in /etc/make.conf. For example, to"
	einfo "install full English and French dictionaries, use:"
	einfo "    LINGUAS=\"en fr\""
	einfo " "
	if [ -z "${LINGUAS}" ] ; then
		einfo "By default, a small English dictionary was installed."
		einfo " "
	fi
}