Unable to install spark-python package on CentOS8 due to lack of python package.
@@ -100,7 +100,11 @@ Server for Spark worker
%package -n spark-python
Summary: Python client for Spark
Group: Development/Libraries
+%if 0%{?rhel} >= 8
+Requires: spark-core = %{version}-%{release}, python2
+%else
Requires: spark-core = %{version}-%{release}, python
+%endif
%description -n spark-python
Includes PySpark, an interactive Python shell for Spark, and related libraries
@@ -160,11 +164,19 @@ bash $RPM_SOURCE_DIR/do-component-build
%__rm -rf $RPM_BUILD_ROOT
%__install -d -m 0755 $RPM_BUILD_ROOT/%{initd_dir}/
+%if 0%{?rhel} >= 8
+PYSPARK_PYTHON=python2 bash $RPM_SOURCE_DIR/install_spark.sh \
+ --build-dir=`pwd` \
+ --source-dir=$RPM_SOURCE_DIR \
+ --prefix=$RPM_BUILD_ROOT \
+ --doc-dir=%{doc_spark}
+%else
bash $RPM_SOURCE_DIR/install_spark.sh \
--build-dir=`pwd` \
--source-dir=$RPM_SOURCE_DIR \
--prefix=$RPM_BUILD_ROOT \
--doc-dir=%{doc_spark}
+%endif
%__rm -f $RPM_BUILD_ROOT/%{lib_spark}/jars/hadoop-*.jar
