summaryrefslogtreecommitdiff
blob: a9f3de5aa53c3e65952c753d66562da7e360c1df (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/xrdp/xrdp-0.4.1.ebuild,v 1.2 2009/12/21 14:09:33 ssuominen Exp $

EAPI="2"

inherit eutils multilib

DESCRIPTION="An open source remote desktop protocol(rdp) server."
HOMEPAGE="http://xrdp.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"

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

DEPEND="sys-libs/pam"
RDEPEND="${DEPEND}
	|| ( net-misc/vnc[server] net-misc/tightvnc )"

DESTDIR="/usr/$(get_libdir)/${PN}"

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

	epatch "${FILESDIR}/${P}-curdir.patch"

	# fix cflags, broken paths, multilib, and insecure rpath in all makefiles
	for MAKE in $(find . -name Makefile) ; do
		sed -i "s:CFLAGS = -Wall -O. :CFLAGS += :
			s:/usr/xrdp:${DESTDIR}:g
			s:/usr/lib/:/usr/$(get_libdir)/:g
			s:rpath,\.:rpath,${DESTDIR}:g" ${MAKE}
	done

	sed -i '/instfiles\/xrdp_control1.sh/ d' Makefile

	epatch "${FILESDIR}"/${P}-asneeded.patch
}

src_compile() {
	emake -j1 DESTDIR="${DESTDIR}" || die "emake failed"
}

src_install() {
	emake -j1 DESTDIRDEB="${D}" installdeb || die "emake installdeb failed"
	emake -j1 -C sesman/tools DESTDIRDEB="${D}" installdeb || die "emake installdeb failed"
	emake -j1 -C sesman/libscp DESTDIRDEB="${D}" installdeb || die "emake installdeb failed"
	dodoc design.txt readme.txt sesman/startwm.sh
	doman "${D}/usr/man/"*/*
	keepdir /var/log/${PN}
	rm -rf "${D}${DESTDIR}/startwm.sh" "${D}/usr/man"
	exeinto "${DESTDIR}"
	doexe "${FILESDIR}/startwm.sh"
	doexe "sesman/sessvc"
	newinitd "${FILESDIR}/${PN}-initd" ${PN}
	newconfd "${FILESDIR}/${PN}-confd" ${PN}
	sed -i "s:LIBDIR:$(get_libdir):" "${D}/etc/init.d/${PN}"
}