/[gentoo-x86]/net-misc/xrdp/xrdp-0.6.1.ebuild
Gentoo

Contents of /net-misc/xrdp/xrdp-0.6.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Thu Feb 19 16:58:37 2015 UTC (4 years, 9 months ago) by mgorny
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Patch out crypt() NULL return check vulnerability, bug #540630. Remove old.

(Portage version: 2.2.17/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)

1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/xrdp/xrdp-0.6.1.ebuild,v 1.4 2014/10/27 14:33:09 mgorny Exp $
4
5 EAPI=5
6
7 inherit autotools eutils pam systemd
8
9 MY_P="${PN}-v${PV}"
10
11 DESCRIPTION="An open source Remote Desktop Protocol server"
12 HOMEPAGE="http://www.xrdp.org/"
13 SRC_URI="mirror://sourceforge/${PN}/${PV}/${MY_P}.tar.gz"
14
15 LICENSE="Apache-2.0"
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="debug kerberos pam"
19
20 RDEPEND="dev-libs/openssl:0=
21 x11-libs/libX11:0=
22 x11-libs/libXfixes:0=
23 kerberos? ( virtual/krb5:0= )
24 pam? ( virtual/pam:0= )"
25 DEPEND="${RDEPEND}"
26 RDEPEND="${RDEPEND}
27 || (
28 net-misc/tigervnc:0=[server,xorgmodule]
29 net-misc/x11rdp:0=
30 )"
31
32 S=${WORKDIR}/${MY_P}
33
34 src_prepare() {
35 epatch_user
36
37 # disallow root login by default
38 sed -i -e '/^AllowRootLogin/s/1/0/' sesman/sesman.ini || die
39
40 eautoreconf
41 # part of ./bootstrap
42 ln -s ../config.c sesman/tools/config.c || die
43 }
44
45 src_configure() {
46 use kerberos && use pam \
47 && ewarn "Both kerberos & pam auth enabled, kerberos will take precedence."
48
49 local myconf=(
50 # warning: configure.ac is completed flawed
51
52 --localstatedir="${EPREFIX}"/var
53
54 # -- authentication backends --
55 # kerberos is inside !SESMAN_NOPAM conditional for no reason
56 $(use pam || use kerberos || echo --enable-nopam)
57 $(usex kerberos --enable-kerberos '')
58 # pam_userpass is not in Gentoo at the moment
59 #--disable-pamuserpass
60
61 # -- others --
62 $(usex debug --enable-xrdpdebug '')
63
64 # --enable-freerdp1 does not work with 1.1 in gentoo
65 )
66
67 econf "${myconf[@]}"
68 }
69
70 src_install() {
71 default
72 prune_libtool_files --all
73
74 # use our pam.d file
75 use pam && newpamd "${FILESDIR}"/xrdp-sesman.pamd xrdp-sesman
76 # and our startwm.sh
77 exeinto /etc/xrdp
78 doexe "${FILESDIR}"/startwm.sh
79
80 # package empty /etc/xrdp/rsakeys.ini rather than bundled keys :)
81 : > rsakeys.ini
82 insinto /etc/xrdp
83 doins rsakeys.ini
84
85 # contributed by Jan Psota <jasiupsota@gmail.com>
86 newinitd "${FILESDIR}/${PN}-initd" ${PN}
87 }
88
89 pkg_preinst() {
90 # either copy existing keys over to avoid CONFIG_PROTECT whining
91 # or generate new keys (but don't include them in binpkg!)
92 if [[ -f ${EROOT}/etc/xrdp/rsakeys.ini ]]; then
93 cp {"${EROOT}","${ED}"}/etc/xrdp/rsakeys.ini || die
94 else
95 einfo "Running xrdp-keygen to generate new rsakeys.ini ..."
96 "${S}"/keygen/xrdp-keygen xrdp "${ED}"/etc/xrdp/rsakeys.ini \
97 || die "xrdp-keygen failed to generate RSA keys"
98 fi
99 }
100
101 pkg_postinst() {
102 # check for use of bundled rsakeys.ini (installed by default upstream)
103 if [[ $(cksum "${EROOT}"/etc/xrdp/rsakeys.ini) == '2935297193 1019 '* ]]
104 then
105 ewarn "You seem to be using upstream bundled rsakeys.ini. This means that"
106 ewarn "your communications are encrypted using a well-known key. Please"
107 ewarn "consider regenerating rsakeys.ini using the following command:"
108 ewarn
109 ewarn " ${EROOT}/usr/bin/xrdp-keygen xrdp ${EROOT}/etc/xrdp/rsakeys.ini"
110 ewarn
111 fi
112
113 elog "Various session types require different backend implementations:"
114 elog "- sesman-Xvnc requires net-misc/tigervnc[server,xorgmodule]"
115 elog "- sesman-X11rdp requires net-misc/x11rdp"
116 }

  ViewVC Help
Powered by ViewVC 1.1.20