summaryrefslogtreecommitdiff
blob: 89a02fb53aaa8dbf69c0d2642bcb727dad784d26 (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
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-editors/vi/vi-3.7-r5.ebuild,v 1.8 2004/04/27 16:46:24 kugelfang Exp $

IUSE=""

MY_P=ex-040103
S=${WORKDIR}/${MY_P}
DESCRIPTION="The original VI package"
HOMEPAGE="http://ex-vi.berlios.de/"
SRC_URI="mirror://sourceforge/ex-vi/${MY_P}.tar.gz"
SLOT="0"
LICENSE="Caldera"
KEYWORDS="x86 ~ppc sparc ~alpha hppa ~mips amd64 ~ia64 ~ppc64"

# NOTE: vi needs /etc/termcap to function properly with TERM=linux.
DEPEND="sys-libs/ncurses
	sys-libs/libtermcap-compat"

PROVIDE="virtual/editor"

src_compile() {
	addpredict /dev/ptys/*

	# Do not use TERMLIB=ncurses, as it causes vi
	# to segfault with TERM=linux.
	#
	# WARN is set in the environment in /sbin/functions.sh
	# (unfortunately generic variable name).  Need to reset on the
	# make command-line to keep from breaking the build.
	make clean || die
	make DESTDIR=/usr \
		TERMLIB=termlib \
		PRESERVEDIR=/var/lib/expreserve \
		RECOVER="-DEXRECOVER=\\\"/var/lib/exrecover\\\" \
		         -DEXPRESERVE=\\\"/var/lib/expreserve\\\"" \
		WARN='' \
		|| die "failed compilation"
}

src_install() {
	local l

	dodir /usr/share/man
	keepdir /var/lib/{exrecover,expreserve}
	make INSTALL=/usr/bin/install \
		DESTDIR=${D}/usr \
		MANDIR=/share/man \
		TERMLIB=termlib \
		PRESERVEDIR=${D}/var/lib/expreserve \
		RECOVER="-DEXRECOVER=\\\"/var/lib/exrecover\\\" \
		         -DEXPRESERVE=\\\"/var/lib/expreserve\\\"" \
		install || die

	dodoc Changes LICENSE README TODO

	# By default this installs as ex with symlinks pointing to ex.
	# To reduce conflicts with other vi programs, change the master
	# program to vi, then point the symlinks at it.
	cd ${D}/usr/bin
	rm vi
	mv ex vi
	for l in *; do [ -L $l ] && ln -sfn vi $l; done
	ln -s vi ex
}