This repository has been archived by the owner on Nov 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
X11RDP-RH-Matic.sh
executable file
·583 lines (504 loc) · 15.8 KB
/
X11RDP-RH-Matic.sh
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
#!/bin/bash
#set -u # error unbound variables
# vim:ts=2:sw=2:sts=0:number
VERSION=2.0.7
RELEASEDATE=20170710
trap user_interrupt_exit 2
if [ $UID -eq 0 ] ; then
# write to stderr 1>&2
echo "${0}: Never run this utility as root." 1>&2
echo 1>&2
echo "This utility builds RPMs. Building RPM's as root is seriously dangerous." 1>&2
echo "This script will gain root privileges via sudo on demand, then type your password." 1>&2
exit 1
fi
if ! hash sudo 2> /dev/null ; then
# write to stderr 1>&2
echo "${0}: sudo not found." 1>&2
echo 1>&2
echo 'This utility requires sudo to gain root privileges on demand.' 1>&2
echo 'run `yum -y install sudo` in root privileges before run this utility.' 1>&2
exit 1
fi
LINE="----------------------------------------------------------------------"
PATH=/bin:/sbin:/usr/bin:/usr/sbin
# xrdp repository
: ${GH_ACCOUNT:=neutrinolabs}
: ${GH_PROJECT:=xrdp}
: ${GH_BRANCH:=master}
GH_URL=https://github.com/${GH_ACCOUNT}/${GH_PROJECT}.git
# xorgxrdp repository
: ${GH_ACCOUNT_xorgxrdp:=neutrinolabs}
: ${GH_PROJECT_xorgxrdp:=xorgxrdp}
: ${GH_BRANCH_xorgxrdp:=master}
GH_URL_xorgxrdp=https://github.com/${GH_ACCOUNT_xorgxrdp}/${GH_PROJECT_xorgxrdp}.git
OLDWRKDIR=''
WRKDIR=$(mktemp --directory --suffix .X11RDP-RH-Matic)
YUM_LOG=${WRKDIR}/yum.log
BUILD_LOG=${WRKDIR}/build.log
SUDO_LOG=${WRKDIR}/sudo.log
RPMS_DIR=$(rpm --eval %{_rpmdir}/%{_arch})
SOURCE_DIR=$(rpm --eval %{_sourcedir})
# variables for this utility
TARGETS="xrdp x11rdp"
META_DEPENDS="rpm-build rpmdevtools"
FETCH_DEPENDS="ca-certificates git wget"
EXTRA_SOURCE="xrdp.init xrdp.sysconfig xrdp.logrotate"
XRDP_CONFIGURE_ARGS="--enable-fuse --enable-jpeg --enable-ipv6 --disable-static"
# flags
PARALLELMAKE=true # increase make jobs
INSTALL_XRDP=true # install built package after build
MAINTAINER=false # maintainer mode
IS_EL6=$([ "$(rpm --eval %{?rhel})" -le 6 ] && echo true || echo false)
IS_EL7=$([ "$(rpm --eval %{?rhel})" -eq 7 ] && echo true || echo false)
# substitutes
XORGXRDPDEBUG_SUB="# "
# xrdp dependencies
XRDP_BASIC_BUILD_DEPENDS=$(<SPECS/xrdp.spec.in grep BuildRequires: | grep -v %% | awk '{ print $2 }' | tr '\n' ' ')
XRDP_ADDITIONAL_BUILD_DEPENDS="libjpeg-turbo-devel fuse-devel"
# xorg driver build dependencies
if $IS_EL7; then
LIBXFONT_DEVEL=libXfont2-devel
else
LIBXFONT_DEVEL=libXfont-devel
fi
XORGXRDP_BUILD_DEPENDS=$(<SPECS/xorgxrdp.spec.in grep BuildRequires: | grep -v %% | awk '{ print $2 }' | tr '\n' ' ')
XORGXRDP_BUILD_DEPENDS="${XORGXRDP_BUILD_DEPENDS} ${LIBXFONT_DEVEL}"
# x11rdp
X11RDP_BUILD_DEPENDS=$(<SPECS/x11rdp.spec.in grep BuildRequires: | awk '{ print $2 }' | tr '\n' ' ')
SUDO_CMD()
{
# sudo's password prompt timeouts 5 minutes by most default settings
# to avoid exit this script because of sudo timeout
echo_stderr
# not using echo_stderr here because output also be written $SUDO_LOG
echo "Following command will be executed via sudo:" | tee -a $SUDO_LOG 1>&2
echo " $@" | tee -a $SUDO_LOG 1>&2
while ! sudo -v; do :; done
sudo $@ | tee -a $SUDO_LOG
return ${PIPESTATUS[0]}
}
echo_stderr()
{
echo $@ 1>&2
}
error_exit()
{
echo_stderr; echo_stderr
echo_stderr "Oops, something going wrong around line: $BASH_LINENO"
echo_stderr "See logs to get further information:"
echo_stderr " $BUILD_LOG"
echo_stderr " $SUDO_LOG"
echo_stderr " $YUM_LOG"
echo_stderr "Exiting..."
if ${MAINTAINER}; then
echo_stderr
echo_stderr 'Maintainer mode detected, showing build log...'
echo_stderr
tail -n 100 ${BUILD_LOG} 1>&2
echo_stderr
fi
[ -f .PID ] && [ "$(cat .PID)" = $$ ] && rm -f .PID
exit 1
}
clean_exit()
{
[ -f .PID ] && [ "$(cat .PID)" = $$ ] && rm -f .PID
exit 0
}
user_interrupt_exit()
{
echo_stderr; echo_stderr
echo_stderr "Script stopped due to user interrupt, exiting..."
[ -f .PID ] && [ "$(cat .PID)" = $$ ] && rm -f .PID
exit 1
}
install_depends()
{
for f in $@; do
echo -n "Checking for ${f}... "
check_if_installed $f
if [ $? -eq 0 ]; then
echo "yes"
else
echo "no"
echo -n "Installing $f... "
SUDO_CMD yum -y install $f >> $YUM_LOG && echo "done" || error_exit
fi
sleep 0.1
done
}
check_if_installed()
{
if [ "$(repoquery --all --installed --qf="%{name}" "$1")" = "$1" ]; then
return 0
else
return 1
fi
}
calculate_version_num()
{
echo -n 'Calculating RPM version number... '
XRDPVER=$(<${WRKDIR}/${WRKSRC}/configure.ac grep ^AC_INIT | sed -e 's|AC_INIT(\[\(.*\)\], \[\(.*\)\], \[\(.*\)\])|\2|')
XORGXRDPVER=$(<${WRKDIR}/${WRKSRC_xorgxrdp}/configure.ac grep ^AC_INIT | sed -e 's|AC_INIT(\[\(.*\)\], \[\(.*\)\], \[\(.*\)\])|\2|')
echo ${XRDPVER} | grep -q '[0-9].[0-9].[0-9]' || error_exit
echo ${XORGXRDPVER} | grep -q '[0-9].[0-9].[0-9]' || error_exit
XRDPVER=${XRDPVER}.git${GH_COMMIT}
XORGXRDPVER=${XORGXRDPVER}.git$(cd ${WRKDIR}/${WRKSRC_xorgxrdp}; git rev-parse HEAD | head -c7)
echo xrdp=$XRDPVER xorgxrdp=$XORGXRDPVER
}
generate_spec()
{
calculate_version_num
calc_cpu_cores
echo -n 'Generating RPM spec files... '
GH_BRANCH_IN_PKGNAME=$(echo ${GH_BRANCH} | sed -e 's|[^A-Za-z0-9._\+]|_|g')
GH_BRANCH_IN_PKGNAME_xorgxrdp=$(echo ${GH_BRANCH_xorgxrdp} | sed -e 's|[^A-Za-z0-9._\+]|_|g')
# replace common variables in spec templates
for f in SPECS/*.spec.in
do
sed \
-e "s|%%XRDPVER%%|${XRDPVER}|g" \
-e "s|%%XORGXRDPVER%%|${XORGXRDPVER}|g" \
-e "s|%%XRDPBRANCH%%|${GH_BRANCH_IN_PKGNAME}|g" \
-e "s|%%XORGXRDPBRANCH%%|${GH_BRANCH_IN_PKGNAME_xorgxrdp}|g" \
-e "s|%%GH_ACCOUNT%%|${GH_ACCOUNT}|g" \
-e "s|%%GH_PROJECT%%|${GH_PROJECT}|g" \
-e "s|%%GH_COMMIT%%|${GH_COMMIT}|g" \
-e "s|%%GH_ACCOUNT_xorgxrdp%%|${GH_ACCOUNT_xorgxrdp}|g" \
-e "s|%%GH_PROJECT_xorgxrdp%%|${GH_PROJECT_xorgxrdp}|g" \
-e "s|%%GH_COMMIT_xorgxrdp%%|${GH_COMMIT_xorgxrdp}|g" \
< $f > ${WRKDIR}/$(basename ${f%.in}) || error_exit
done
sed -i.bak \
-e "s|%%BUILDREQUIRES%%|${XORGXRDP_BUILD_DEPENDS}|g" \
-e "s|%%XORGXRDPDEBUG%%|${XORGXRDPDEBUG_SUB}|g" \
-e "s|%%LIBXFONT_DEVEL%%|${LIBXFONT_DEVEL}|" \
${WRKDIR}/xorgxrdp.spec || error_exit
sed -i.bak \
-e "s|%%BUILDREQUIRES%%|${XRDP_ADDITIONAL_BUILD_DEPENDS}|g" \
-e "s|%%CONFIGURE_ARGS%%|${XRDP_CONFIGURE_ARGS}|g" \
${WRKDIR}/xrdp.spec || error_exit
sed -i.bak \
-e "s|%%X11RDPBASE%%|/opt/X11rdp|g" \
-e "s|make -j1|${makeCommand}|g" \
${WRKDIR}/x11rdp.spec || error_exit
if $IS_EL6; then
sed -i.bak \
-e 's|\(^BuildRequires:\s*\)\(autoconf\)|\1autoconf268|' \
${WRKDIR}/xrdp.spec || error_exit
fi
echo 'done'
}
clone()
{
GH_COMMIT=$(git ls-remote --heads $GH_URL | grep ${GH_BRANCH}$ | head -c7)
WRKSRC=${GH_ACCOUNT}-${GH_PROJECT}-${GH_COMMIT}
DISTFILE=${WRKSRC}.tar.gz
echo -n 'Cloning xrdp source code... '
if [ ! -f ${SOURCE_DIR}/${DISTFILE} ]; then
# always clone via https
git clone ${GH_URL} --branch ${GH_BRANCH} ${WRKDIR}/${WRKSRC} >> $BUILD_LOG 2>&1 || error_exit
sed -i -e 's|git://|https://|' ${WRKDIR}/${WRKSRC}/.gitmodules ${WRKDIR}/${WRKSRC}/.git/config
(cd ${WRKDIR}/${WRKSRC} && git submodule update --init --recursive) >> $BUILD_LOG 2>&1
if $IS_EL6; then
sed -i \
-e 's|librfxencode.a$|librfxencode.la|g' \
-e 's|libpainter.a$|libpainter.la|g' \
${WRKDIR}/${WRKSRC}/xrdp/Makefile.am
sed -i -e 's|autoreconf|autoreconf268|' \
${WRKDIR}/${WRKSRC}/bootstrap \
${WRKDIR}/${WRKSRC}/librfxcodec/bootstrap \
${WRKDIR}/${WRKSRC}/libpainter/bootstrap
fi
tar cfz ${WRKDIR}/${DISTFILE} -C ${WRKDIR} ${WRKSRC} || error_exit
cp -a ${WRKDIR}/${DISTFILE} ${SOURCE_DIR}/${DISTFILE} || error_exit
echo 'done'
else
echo 'already exists'
echo -n 'Unpacking previously cloned source code... '
tar zxf ${SOURCE_DIR}/${DISTFILE} -C ${WRKDIR} || error_exit
echo 'done'
fi
# xorgxrdp
GH_COMMIT_xorgxrdp=$(git ls-remote --heads $GH_URL_xorgxrdp | grep ${GH_BRANCH_xorgxrdp}$ | head -c7)
WRKSRC_xorgxrdp=${GH_ACCOUNT_xorgxrdp}-${GH_PROJECT_xorgxrdp}-${GH_COMMIT_xorgxrdp}
DISTFILE_xorgxrdp=${WRKSRC_xorgxrdp}.tar.gz
echo -n 'Cloning xorgxrdp source code... '
if [ ! -f ${SOURCE_DIR}/${DISTFILE_xorgxrdp} ]; then
git clone ${GH_URL_xorgxrdp} --branch ${GH_BRANCH_xorgxrdp} ${WRKDIR}/${WRKSRC_xorgxrdp} >> $BUILD_LOG 2>&1 || error_exit
if $IS_EL6; then
sed -i -e 's|autoreconf|autoreconf268|' ${WRKDIR}/${WRKSRC_xorgxrdp}/bootstrap
fi
tar cfz ${WRKDIR}/${DISTFILE_xorgxrdp} -C ${WRKDIR} ${WRKSRC_xorgxrdp} || error_exit
cp -a ${WRKDIR}/${DISTFILE_xorgxrdp} ${SOURCE_DIR}/${DISTFILE_xorgxrdp} || error_exit
echo 'done'
else
echo 'already exists'
echo -n 'Unpacking previously cloned source code... '
tar zxf ${SOURCE_DIR}/${DISTFILE_xorgxrdp} -C ${WRKDIR} || error_exit
echo 'done'
fi
}
x11rdp_dirty_build()
{
X11RDPBASE=/opt/X11rdp
# remove installed x11rdp before build x11rdp
check_if_installed x11rdp
if [ $? -eq 0 ]; then
SUDO_CMD yum -y remove x11rdp >> $YUM_LOG || error_exit
fi
# clean /opt/X11rdp
if [ -d $X11RDPBASE ]; then
SUDO_CMD find $X11RDPBASE -delete
fi
# extract xrdp source
tar zxf ${SOURCE_DIR}/${DISTFILE} -C $WRKDIR || error_exit
# build x11rdp once into $X11RDPBASE
(
cd ${WRKDIR}/${WRKSRC}/xorg/X11R7.6 && \
sed -i.bak \
-e 's|if ! mkdir $PREFIX_DIR|if ! mkdir -p $PREFIX_DIR|' \
-e 's|wget -cq|wget -cq --retry-connrefused --waitretry=10|' \
-e "s|make -j 1|make -j $jobs|g" \
-e 's|^download_url=http://server1.xrdp.org/xrdp/X11R7.6|download_url=https://xrdp.vmeta.jp/pub/xrdp/X11R7.6|' \
buildx.sh >> $BUILD_LOG 2>&1 && \
SUDO_CMD ./buildx.sh $X11RDPBASE >> $BUILD_LOG 2>&1
) || error_exit
QA_RPATHS=$[0x0001|0x0002] rpmbuild -ba ${WRKDIR}/x11rdp.spec >> $BUILD_LOG 2>&1 || error_exit
# cleanup installed files during the build
if [ -d $X11RDPBASE ]; then
SUDO_CMD find $X11RDPBASE -delete
fi
}
rpmdev_setuptree()
{
echo -n 'Setting up rpmbuild tree... '
rpmdev-setuptree && \
echo 'done'
}
build_rpm()
{
echo 'Building RPMs started, please be patient... '
echo 'Do the following command to see build progress.'
echo " $ tail -f $BUILD_LOG"
for f in $EXTRA_SOURCE; do
cp SOURCES/${f} $SOURCE_DIR
done
for f in $TARGETS; do
echo -n "Building ${f}... "
case "${f}" in
xrdp) QA_RPATHS=$[0x0001] rpmbuild -ba ${WRKDIR}/${f}.spec >> $BUILD_LOG 2>&1 || error_exit ;;
x11rdp) x11rdp_dirty_build || error_exit ;;
*) rpmbuild -ba ${WRKDIR}/${f}.spec >> $BUILD_LOG 2>&1 || error_exit ;;
esac
echo 'done'
done
echo "Built RPMs are located in $RPMS_DIR."
}
parse_commandline_args()
{
# If first switch = --help, display the help/usage message then exit.
if [ "$1" = "--help" ]
then
echo "usage: $0 OPTIONS
OPTIONS
-------
--help : show this help.
--version : show version.
--branch <branch> : use one of the available xrdp branches listed above...
Examples:
--branch v0.8 - use the 0.8 branch.
--branch master - use the master branch. <-- Default if no --branch switch used.
--branch devel - use the devel branch (Bleeding Edge - may not work properly!)
Branches beginning with \"v\" are stable releases.
The master branch changes when xrdp authors merge changes from the devel branch.
--nocpuoptimize : do not change X11rdp build script to utilize more than 1 of your CPU cores.
--cleanup : remove X11rdp / xrdp source code after installation. (Default is to keep it).
--maintainer : maintainer mode
--noinstall : do not install anything, just build the packages
--nox11rdp : do not build and install x11rdp
--with-xorgxrdp : build xorgxrdp (formerly known as xorg-driver)
--with-xorg-driver : alias for --with-xorgxrdp
--xorgxrdpdebug : increase log level of xorgxrdp
--tmpdir <dir> : specify working directory prefix (/tmp is default)"
get_branches
rmdir ${WRKDIR}
exit 0
fi
while [ $# -gt 0 ]; do
case "$1" in
--version)
show_version
;;
--branch)
get_branches
if [ $(expr "$BRANCHES" : ".*${2}.*") -ne 0 ]; then
GH_BRANCH=$2
GH_BRANCH_xorgxrdp=$2
else
echo "**** Error detected in branch selection. Argument after --branch was : $2 ."
echo "**** Available branches : "$BRANCHES
exit 1
fi
echo "Using branch ==>> $GH_BRANCH <<=="
if [ $GH_BRANCH = 'devel' ]; then
echo "Note : using the bleeding-edge version may result in problems :)"
fi
echo $LINE
;;
--maintainer)
MAINTAINER=true
;;
--noinstall)
INSTALL_XRDP=false
;;
--nocpuoptimize)
PARALLELMAKE=false
;;
--nox11rdp)
TARGETS=${TARGETS//x11rdp/}
;;
--with-xorg-driver) # alias for --with-xorgxrdp
echo_stderr 'WARNING: --with-xorg-driver was renamed to --with-xorgxrdp'
TARGETS="$TARGETS xorgxrdp"
;;
--with-xorgxrdp)
TARGETS="$TARGETS xorgxrdp"
;;
--xorgxrdpdebug)
XORGXRDPDEBUG_SUB=""
;;
--tmpdir)
if [ ! -d "${2}" ]; then
echo_stderr "Invalid working directory '${2}' specified."
exit 1
fi
OLDWRKDIR=${WRKDIR}
WRKDIR=$(mktemp --directory --suffix .X11RDP-RH-Matic --tmpdir="${2}") || exit 1
YUM_LOG=${WRKDIR}/yum.log
BUILD_LOG=${WRKDIR}/build.log
SUDO_LOG=${WRKDIR}/sudo.log
rmdir "${OLDWRKDIR}" || error_exit
;;
esac
shift
done
}
show_version()
{
echo "X11RDP-RH-Matic $VERSION $RELEASEDATE"
[ -f .PID ] && [ "$(cat .PID)" = $$ ] && rm -f .PID
exit 0
}
get_branches()
{
echo $LINE
echo "Obtaining list of available branches..."
echo $LINE
BRANCHES=$(git ls-remote --heads $GH_URL | cut -f2 | cut -d "/" -f 3)
echo $BRANCHES
echo $LINE
}
calc_cpu_cores()
{
jobs=$(($(nproc) + 1))
if $PARALLELMAKE; then
makeCommand="make -j $jobs"
else
makeCommand="make -j 1"
fi
}
remove_installed_xrdp()
{
$INSTALL_XRDP || return
# uninstall xrdp first if installed
for f in $TARGETS ; do
echo -n "Removing installed $f... "
check_if_installed $f
if [ $? -eq 0 ]; then
SUDO_CMD yum -y remove $f >> $YUM_LOG || error_exit
fi
echo "done"
done
}
install_built_xrdp()
{
$INSTALL_XRDP || return
for t in $TARGETS ; do
echo -n "Installing built $t... "
case "$t" in
xorgxrdp)
RPM_VERSION_SUFFIX=$(rpm --eval -${XORGXRDPVER}+${GH_BRANCH_IN_PKGNAME_xorgxrdp}-1%{?dist}.%{_arch}.rpm) ;;
*)
RPM_VERSION_SUFFIX=$(rpm --eval -${XRDPVER}+${GH_BRANCH_IN_PKGNAME}-1%{?dist}.%{_arch}.rpm) ;;
esac
SUDO_CMD yum -y localinstall \
${RPMS_DIR}/${t}${RPM_VERSION_SUFFIX} \
>> $YUM_LOG && echo "done" || error_exit
done
}
install_targets_depends()
{
for t in $TARGETS; do
case "$t" in
xrdp) install_depends $XRDP_BASIC_BUILD_DEPENDS $XRDP_ADDITIONAL_BUILD_DEPENDS;;
x11rdp) install_depends $X11RDP_BUILD_DEPENDS ;;
xorgxrdp) install_depends $XORGXRDP_BUILD_DEPENDS;;
esac
done
}
first_of_all()
{
if [ ! -f X11RDP-RH-Matic.sh ]; then
echo_stderr "Make sure you are in X11RDP-RH-Matic directory." 2>&1
error_exit
fi
if [ -f .PID ]; then
echo_stderr "Another instance of $0 is already running." 2>&1
error_exit
else
echo $$ > .PID
fi
if [ -n "${OLDWRKDIR}" ]; then
echo "Using working directory ${WRKDIR} instead of default."
fi
echo 'Allow X11RDP-RH-Matic to gain root privileges.'
echo 'Type your password if required.'
sudo -v
# first of all, check if yum-utils installed
echo 'First of all, checking for necessary programs to run this script... '
echo -n 'Checking for yum-utils... '
if hash repoquery 2> /dev/null; then
echo 'yes'
else
echo 'no'
echo -n 'Installing yum-utils... '
SUDO_CMD yum -y install yum-utils >> $YUM_LOG && echo "done" || exit 1
fi
if $IS_EL6; then
check_if_installed epel-release
if [ $? -ne 0 ]; then
echo "You are using $(cat /etc/redhat-release)."
echo '"epel-release" is needed to run this script.'
echo -n 'Installing epel-release...'
SUDO_CMD yum -y install epel-release >> $YUM_LOG && echo 'done' || exit 1
fi
XRDP_BASIC_BUILD_DEPENDS=${XRDP_BASIC_BUILD_DEPENDS/autoconf /autoconf268 }
fi
}
#
# main routines
#
parse_commandline_args $@
first_of_all
install_depends $META_DEPENDS $FETCH_DEPENDS
rpmdev_setuptree
clone
generate_spec
install_targets_depends
build_rpm
remove_installed_xrdp
install_built_xrdp
echo; echo 'Everything is done!'
clean_exit