Howto install spark-2.6.3.src.rpm on Scientific Linux 6.5 (RHEL 6.x)

Hi,

i installed/started Openfire server (on our RHEL 6.5 server) connected to our LDAP (389-DS) server. Nice and cute setup!

Surprisingly, i had more troubles to install Spark client on my Scientific Linux 6.5 laptop :]

‘Quick and dirty’ “rpmbuild --rebuild” didn’t work (ofc) and after some searching around i found out the ‘src.rpm’ is quite old (no devs nowadays?) and has very old java (1.6.x) as a part of package, resulting in unability to recompile / install package properly (even after recompilation it was failing on an odd deps, which yum seen as satisfied).

So what i did:

  1. recompile as normal user (not root!) and prepare you recompile env (if not done during previous src.rpm entanglements :])

yum install rpm-build.x86_64 rpm-libs.x86_64 rpmdevtools.noarch

  1. download and install src.rpm

rpm -i spark-2.6.3.src.rpm

  1. you’ll have to edit specfile because by default it doesnt work:

cd ~/rpmbuild/SPECS/

change this

Version: %{SPARK_VERSION}

Source: %{SPARK_SOURCE}

Source1: jre-dist.tar.gz

to:

Version: 2.6.3.12555

Source: spark_src_2.6.3.12555.tar.gz

Source1: jre8-dist.tar.gz

header explained:

just have a look into ~/rpmbuild/SOURCES and there you’ll see “spark_src_2.6.3.12555.tar.gz” package and “jre-dist.tar.gz package” as source packages. Particularly the “jre-dist.tar.gz” package contain old java 1.6.x which is quite old and prevented me from succesfull install

After unpacking “jre-dist.tar.gz” i found it contain only “jre” folder with old 1.6.x java - so what i did is, i just replaced this “jre” folder with new 1.8.x java:

  1. download “jdk-8u31-linux-x64.tar.gz” and unpack

tar -xzvf jdk-8u31-linux-x64.tar.gz

cd jdk1.8.0_31

tar -cvpv jre8-dist.tar jre/*

mv jre8-dist.tar.gz ~/rpmbuild/SOURCES (this name has to correspond with the name in the specfile header - you can basically name it as whatever you want)

this will replace the old 1.6.x JRE with the 1.8 JRE as the source for building new rpm.

  1. export java home

export JAVA_HOME=’/usr/java/jdk1.8.0_31’

  1. rebuild

cd ~/rpmbuild/SPECS

rpmbuild -bb spark.spec

  1. if rebuild fails, it is probably because some libraries or deps are missing - install missing via ‘yum’ until it completes successfully - e.g. i had to install:

yum install unixODBC alsa-lib libX11 libXau libXext libXi libXp libXtst libxcb

  1. install

yum localinstall ~/rpmbuild/RPMS/x86_64/Spark-2.6.3.12555-1.x86_64.rpm

Install
1 Package(s)

Total size: 185 M

Installed size: 185 M

Is this ok [y/N]: y

Running Transaction

Installing : Spark-2.6.3.12555-1.x86_64
1/1
Verifying : Spark-2.6.3.12555-1.x86_64
1/1

Installed:

Spark.x86_64 0:2.6.3.12555-1

Complete!

NOTE Problem:

with the old version of java (1.6.x) that is distributed with the src.rpm package by default i had trouble to install the recompiled rpm package and the “yum localinstall …” was ending with:

Error: Package: Spark-2.6.3.12555-1.x86_64 (/spark-2.6.3)

Requires: libodbcinst.so

Error: Package: Spark-2.6.3.12555-1.x86_64 (/spark-2.6.3)

Requires: libodbc.so

These packages are satisfied via ‘unixODBC’ package, but it still failed even with it installed. After repackaging with new java, it went ok.

hope it helps someone

cheers :]

hi,I follow your steps, problems were found in the fourth step, whether the command is wrong?

my env is: Centos 6.5 x64 jdk:jdk1.8.0_40 ant: 1.8.4

my step is:

[root@im test]# tar -zxvf jdk-8u40-linux-x64.gz

[root@im test]# cd jdk1.8.0_40/

[root@im jdk1.8.0_40]# tar -zcvf jre8-dist.tar.gz jre/*

[root@im jdk1.8.0_40]# mv jre8-dist.tar.gz ~/rpmbuild/SOURCES/

[root@im jdk1.8.0_40]# cd ~/rpmbuild/SPECS/

[root@im SOURCES]# chown j2ee-bamboo:j2ee-bamboo /root/rpmbuild/SOURCES /jre8-dist.tar.gz

[root@im SPECS]# yum install unixODBC alsa-lib libX11 libXau libXext libXi libXp libXtst libxcb

[root@im SPECS]# rpmbuild -bb spark.spec

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.3K4O0L

  • umask 022

  • cd /root/rpmbuild/BUILD

  • cd /root/rpmbuild/BUILD

  • rm -rf Spark-2.6.3.12555

  • /usr/bin/gzip -dc /root/rpmbuild/SOURCES/spark_src_2.6.3.12555.tar.gz

  • /bin/tar -xf -

  • STATUS=0

  • ‘[’ 0 -ne 0 ‘]’

  • cd Spark-2.6.3.12555

  • /bin/chmod -Rf a+rX,u+w,g-w,o-w .

  • exit 0

Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.Mb6lSm

  • umask 022

  • cd /root/rpmbuild/BUILD

  • cd Spark-2.6.3.12555

  • cd build

  • /opt/ant/bin/ant jar

Buildfile: /root/rpmbuild/BUILD/Spark-2.6.3.12555/build/build.xml

init:

BUILD FAILED

/root/rpmbuild/BUILD/Spark-2.6.3.12555/build/build.xml:169: Must use JDK 1.6.x or higher to build Spark

Total time: 0 seconds

error: Bad exit status from /var/tmp/rpm-tmp.Mb6lSm (%build)

RPM build errors:

Bad exit status from /var/tmp/rpm-tmp.Mb6lSm (%build)

waiting for some ideas,thxs!