-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuildvnc.linux
executable file
·91 lines (77 loc) · 2.81 KB
/
buildvnc.linux
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
set -u
set -e
SCRIPTDIR=`dirname $0`
if ls $OUTDIR/files/turbovnc-[0-9]*.x86_64.rpm >/dev/null 2>&1 \
|| ls $OUTDIR/files/turbovnc-[0-9]*.aarch.rpm >/dev/null 2>&1 \
|| ls $OUTDIR/files/turbovnc*_[0-9]*_amd64.deb >/dev/null 2>&1 \
|| ls $OUTDIR/files/turbovnc*_[0-9]*_arm64.deb >/dev/null 2>&1; then
if [ $FORCEBINARY = 0 ]; then
>&2 echo
>&2 echo Binary already exists!
>&2 echo Run $SCRIPT -fb to rebuild it.
>&2 echo
exit 1
else
rm -f $OUTDIR/files/*.x86_64.rpm $OUTDIR/files/*.aarch64.rpm $OUTDIR/files/*.deb
fi
fi
exec 2>&1
$SCRIPTDIR/openjdk.install
export JAVA_HOME=/opt/openjdk17
export PATH=/opt/openjdk17/bin:$PATH
echo Creating x86-64 binary RPM ...
mkdir -p rpmbuild/RPMS
mkdir -p rpmbuild/BUILD
mkdir -p rpmbuild/SRPMS
mkdir -p rpmbuild/buildroot
export CFLAGS=
export JAVAFLAGS='-target 1.8 -source 1.8 -Xlint:all,-serial,-unchecked,-rawtypes'
export LDFLAGS=
rpmbuild --rebuild --buildroot $TMPDIR/rpmbuild/buildroot --define "jre 1" \
--define "_topdir $TMPDIR/rpmbuild" $OUTDIR/files/turbovnc-[0-9]*.src.rpm
VERSION=`rpm -q -p rpmbuild/RPMS/x86_64/turbovnc-[0-9]*.x86_64.rpm | cut -f2 -d-`
mv rpmbuild/RPMS/x86_64/turbovnc-[0-9]*.x86_64.rpm $OUTDIR/files/turbovnc-$VERSION.x86_64.rpm
mv rpmbuild/RPMS/x86_64/turbovnc-debuginfo-[0-9]*.x86_64.rpm $OUTDIR/files/turbovnc-debuginfo-$VERSION.x86_64.rpm
if [ -f $SCRIPTDIR/gpgsign ]; then
$SCRIPTDIR/rpmsign $OUTDIR/files/turbovnc-$VERSION.x86_64.rpm
rpm --checksig -v $OUTDIR/files/turbovnc-$VERSION.x86_64.rpm
$SCRIPTDIR/rpmsign $OUTDIR/files/turbovnc-debuginfo-$VERSION.x86_64.rpm
rpm --checksig -v $OUTDIR/files/turbovnc-debuginfo-$VERSION.x86_64.rpm
fi
echo Creating amd64 binary DEB ...
rm -rf rpmbuild
pushd turbovnc-[0-9]*
mkdir linux64
pushd linux64
export CFLAGS=
export LDFLAGS=
export JAVA_HOME=/opt/openjdk17
$SCRIPTDIR/setupscripts/linux64
export NUMCPUS=`grep -c '^processor' /proc/cpuinfo`
make -j$NUMCPUS --load-average=$NUMCPUS
make deb
mv turbovnc_[0-9]*_amd64.deb $OUTDIR/files/
if [ -f $SCRIPTDIR/gpgsign ]; then
. $SCRIPTDIR/gpgsign
expect $SCRIPTDIR/debsign "$GPG_KEY_PASS" "$GPG_KEY_ID" $OUTDIR/files/turbovnc_[0-9]*_amd64.deb
fi
popd
echo Creating AArch64 binary RPM and DEB ...
mkdir linux64.arm
pushd linux64.arm
$SCRIPTDIR/setupscripts/linux64.arm
make -j$NUMCPUS --load-average=$NUMCPUS
STRIP=/opt/gcc.arm64/bin/aarch64-none-linux-gnu-strip make rpm
VERSION=`rpm -q -p turbovnc-[0-9]*.aarch64.rpm | cut -f2 -d-`
mv turbovnc-[0-9]*.aarch64.rpm $OUTDIR/files/turbovnc-$VERSION.aarch64.rpm
if [ -f $SCRIPTDIR/gpgsign ]; then
$SCRIPTDIR/rpmsign $OUTDIR/files/turbovnc-$VERSION.aarch64.rpm
rpm --checksig -v $OUTDIR/files/turbovnc-$VERSION.aarch64.rpm
fi
make deb
mv turbovnc_[0-9]*_arm64.deb $OUTDIR/files/
if [ -f $SCRIPTDIR/gpgsign ]; then
expect $SCRIPTDIR/debsign "$GPG_KEY_PASS" "$GPG_KEY_ID" $OUTDIR/files/turbovnc_[0-9]*_arm64.deb
fi
popd
popd