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

Contents of /net-misc/xrdp/xrdp-0.8.0.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.8.0.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 DESCRIPTION="An open source Remote Desktop Protocol server"
10 HOMEPAGE="http://www.xrdp.org/"
11 # mirrored from https://github.com/neutrinolabs/xrdp/releases
12 SRC_URI="http://dev.gentoo.org/~mgorny/dist/${P}.tar.xz"
13
14 LICENSE="Apache-2.0"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="debug fuse kerberos jpeg pam pulseaudio"
18
19 RDEPEND="dev-libs/openssl:0=
20 x11-libs/libX11:0=
21 x11-libs/libXfixes:0=
22 x11-libs/libXrandr:0=
23 fuse? ( sys-fs/fuse:0= )
24 jpeg? ( virtual/jpeg:0= )
25 kerberos? ( virtual/krb5:0= )
26 pam? ( virtual/pam:0= )
27 pulseaudio? ( media-sound/pulseaudio:0= )"
28 DEPEND="${RDEPEND}
29 app-arch/xz-utils"
30 RDEPEND="${RDEPEND}
31 || (
32 net-misc/tigervnc:0=[server,xorgmodule]
33 net-misc/x11rdp:0=
34 )"
35
36 # does not work with gentoo version of freerdp
37 # neutrinordp? ( net-misc/freerdp:0= )
38 # incompatible with current ffmpeg/libav (surprising, isn't it?)
39 # xrdpvr? ( virtual/ffmpeg:0= )
40
41 src_prepare() {
42 epatch_user
43
44 # don't let USE=debug adjust CFLAGS
45 sed -i -e 's:-g -O0::' configure.ac || die
46 # disallow root login by default
47 sed -i -e '/^AllowRootLogin/s/1/0/' sesman/sesman.ini || die
48 # Fedora files, not included here
49 sed -i -e '/EnvironmentFile=/d' instfiles/*.service || die
50 # reorder so that X11rdp comes last again since it's not supported
51 sed -i -e '/^\[xrdp1\]$/,/^$/{wxrdp.ini.tmp
52 ;d}' xrdp/xrdp.ini || die
53 # move newline to the beginning
54 sed -i -e 'x' xrdp.ini.tmp || die
55 cat xrdp.ini.tmp >> xrdp/xrdp.ini || die
56 rm -f xrdp.ini.tmp || die
57
58 eautoreconf
59 # part of ./bootstrap
60 ln -s ../config.c sesman/tools/config.c || die
61 }
62
63 src_configure() {
64 use kerberos && use pam \
65 && ewarn "Both kerberos & pam auth enabled, kerberos will take precedence."
66
67 local myconf=(
68 # warning: configure.ac is completed flawed
69
70 --localstatedir="${EPREFIX}"/var
71
72 # -- authentication backends --
73 # kerberos is inside !SESMAN_NOPAM conditional for no reason
74 $(use pam || use kerberos || echo --enable-nopam)
75 $(usex kerberos --enable-kerberos '')
76 # pam_userpass is not in Gentoo at the moment
77 #--disable-pamuserpass
78
79 # -- jpeg support --
80 $(usex jpeg --enable-jpeg '')
81 # the package supports explicit linking against libjpeg-turbo
82 # (no need for -ljpeg compat)
83 $(use jpeg && has_version 'media-libs/libjpeg-turbo:0' && echo --enable-tjpeg)
84
85 # -- sound support --
86 $(usex pulseaudio '--enable-simplesound --enable-loadpulsemodules' '')
87
88 # -- others --
89 $(usex debug --enable-xrdpdebug '')
90 $(usex fuse --enable-fuse '')
91 # $(usex neutrinordp --enable-neutrinordp '')
92 # $(usex xrdpvr --enable-xrdpvr '')
93
94 "$(systemd_with_unitdir)"
95 )
96
97 econf "${myconf[@]}"
98 }
99
100 src_install() {
101 default
102 prune_libtool_files --all
103
104 # use our pam.d file since upstream's incompatible with Gentoo
105 use pam && newpamd "${FILESDIR}"/xrdp-sesman.pamd xrdp-sesman
106 # and our startwm.sh
107 exeinto /etc/xrdp
108 doexe "${FILESDIR}"/startwm.sh
109
110 # Fedora stuff
111 rm -r "${ED}"/etc/default || die
112
113 # own /etc/xrdp/rsakeys.ini
114 : > rsakeys.ini
115 insinto /etc/xrdp
116 doins rsakeys.ini
117
118 # contributed by Jan Psota <jasiupsota@gmail.com>
119 newinitd "${FILESDIR}/${PN}-initd" ${PN}
120 }
121
122 pkg_preinst() {
123 # either copy existing keys over to avoid CONFIG_PROTECT whining
124 # or generate new keys (but don't include them in binpkg!)
125 if [[ -f ${EROOT}/etc/xrdp/rsakeys.ini ]]; then
126 cp {"${EROOT}","${ED}"}/etc/xrdp/rsakeys.ini || die
127 else
128 einfo "Running xrdp-keygen to generate new rsakeys.ini ..."
129 "${S}"/keygen/xrdp-keygen xrdp "${ED}"/etc/xrdp/rsakeys.ini \
130 || die "xrdp-keygen failed to generate RSA keys"
131 fi
132 }
133
134 pkg_postinst() {
135 # check for use of bundled rsakeys.ini (installed by default upstream)
136 if [[ $(cksum "${EROOT}"/etc/xrdp/rsakeys.ini) == '2935297193 1019 '* ]]
137 then
138 ewarn "You seem to be using upstream bundled rsakeys.ini. This means that"
139 ewarn "your communications are encrypted using a well-known key. Please"
140 ewarn "consider regenerating rsakeys.ini using the following command:"
141 ewarn
142 ewarn " ${EROOT}/usr/bin/xrdp-keygen xrdp ${EROOT}/etc/xrdp/rsakeys.ini"
143 ewarn
144 fi
145
146 elog "Various session types require different backend implementations:"
147 elog "- sesman-Xvnc requires net-misc/tigervnc[server,xorgmodule]"
148 elog "- sesman-X11rdp requires net-misc/x11rdp"
149 }

  ViewVC Help
Powered by ViewVC 1.1.20