summaryrefslogtreecommitdiff
blob: 6fd8dbf44d791da20634362177e4996106eb5bd1 (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/rdist/rdist-6.1.5-r2.ebuild,v 1.3 2009/09/06 16:33:11 idl0r Exp $

inherit eutils

DESCRIPTION="Remote software distribution system"
HOMEPAGE="http://www.magnicomp.com/rdist/rdist.shtml"
SRC_URI="http://www.magnicomp.com/download/rdist/${P}.tar.gz"

LICENSE="RDist"
SLOT="1"
KEYWORDS="alpha ia64 ~ppc sparc x86"
IUSE="crypt"

DEPEND="sys-devel/bison"
RDEPEND="crypt? ( virtual/ssh )"

src_unpack() {
	unpack ${A}
	cd "${S}"

	# Change the following #define (10 Mar 2004 agriffis)
	sed -i -e 's/^\(#define ARG_TYPE\).*/\1 ARG_STDARG/' config/os-linux.h \
		|| die "sed ARG_TYPE failed"
	# Linux switched from a.out to ELF years ago...
	sed -i -e 's/^\(#define EXE_TYPE\).*/\1 EXE_ELF/' config/os-linux.h \
		|| die "sed EXE_TYPE failed"
	sed -i -e 's/a\.out/ELF/g' doc/rdist.man || die "sed a.out failed"

	# crypto lovers prefer ssh to rsh
	if use crypt; then
		sed -i -e 's,^\(#define _PATH_REMSH\).*,\1 "/usr/bin/ssh",' \
			config/os-linux.h || die "sed _PATH_REMSH failed"
	fi

	# remove yacc-isms eshewed by modern bisons
	sed -i -e '/^%type/ s/,//g' -e 's/= {/{/g' src/gram.y || die "fixup of gram.y failed"

	# use mkstemp(3) instead of mktemp(3)
	epatch "${FILESDIR}/${P}-mkstemp.patch"
}

src_compile() {
	# pull in <string.h> so strerror() is defined properly (64-bit bug)
	emake DEFS_LOCAL=-DNEED_STRING_H YACC='bison -y' || die "emake failed"
}

src_install() {
	dodir /usr/bin /usr/share/man/man{1,8} || die
	emake install \
		BIN_GROUP=root \
		BIN_DIR="${D}/usr/bin" || die "make install failed"
	emake install.man \
		MAN_GROUP=root \
		MAN_1_DIR=${D}/usr/share/man/man1 MAN_8_DIR=${D}/usr/share/man/man8 \
		|| die "make install.man failed"
}