This is an automated email from the ASF dual-hosted git repository.

iwasakims pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bigtop.git


The following commit(s) were added to refs/heads/master by this push:
     new 4066896bd BIGTOP-4149. Support Livy in bigtop-select and pkgSuffix and 
parentDir build arguments. (#1282)
4066896bd is described below

commit 4066896bdd549a74560229edd8a6a2a86561761b
Author: William Horn <[email protected]>
AuthorDate: Mon Jul 1 04:52:14 2024 -0400

    BIGTOP-4149. Support Livy in bigtop-select and pkgSuffix and parentDir 
build arguments. (#1282)
    
    Co-authored-by: Paul Yakovlev <[email protected]>
    Co-authored-by: Carmen Blaine <[email protected]>
---
 .../src/common/bigtop-select/conf-select           |  2 +-
 .../src/common/bigtop-select/distro-select         |  5 ++-
 bigtop-packages/src/rpm/livy/SPECS/livy.spec       | 42 +++++++++++-----------
 bigtop.bom                                         |  1 +
 4 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/bigtop-packages/src/common/bigtop-select/conf-select 
b/bigtop-packages/src/common/bigtop-select/conf-select
index 60b7a886e..b1189712f 100644
--- a/bigtop-packages/src/common/bigtop-select/conf-select
+++ b/bigtop-packages/src/common/bigtop-select/conf-select
@@ -31,7 +31,7 @@ vconfroot = 'etc'
 lib_root = "usr/lib"
 vconf_name = "conf.dist"
 packages = ("hadoop", "hbase", "hive", "hive-hcatalog",
-            "kafka", "spark", "tez",
+            "kafka", "spark", "tez", "livy",
             "zookeeper", "zeppelin", "flink", "solr", "ranger-admin", 
"ranger-usersync", "ranger-tagsync")
 ''' conf link
 /usr/bigtop/3.2.0/usr/lib/${pname}/conf -> /etc/${pname}/conf -> 
/etc/alternatives/${pname}-conf -> /usr/bigtop/3.2.0/etc/${pname}/conf.dist.0
diff --git a/bigtop-packages/src/common/bigtop-select/distro-select 
b/bigtop-packages/src/common/bigtop-select/distro-select
index 4d9c388db..3383fca2f 100644
--- a/bigtop-packages/src/common/bigtop-select/distro-select
+++ b/bigtop-packages/src/common/bigtop-select/distro-select
@@ -70,6 +70,8 @@ leaves = {
            "ranger-admin" : "ranger-admin",
            "ranger-usersync" : "ranger-usersync",
            "ranger-tagsync" : "ranger-tagsync",
+           "livy-server" : "livy",
+           "livy-client" : "livy"
            "alluxio": "alluxio",
            "alluxio-master": "alluxio",
            "alluxio-worker": "alluxio"
@@ -85,7 +87,8 @@ aliases = {
               "phoenix-client",
               "zookeeper-client",
               "flink-client",
-              "spark-client"],
+              "spark-client",
+              "livy-client"],
   "hadoop-hdfs-server": ["hadoop-hdfs-datanode",
                          "hadoop-hdfs-journalnode",
                          "hadoop-hdfs-namenode",
diff --git a/bigtop-packages/src/rpm/livy/SPECS/livy.spec 
b/bigtop-packages/src/rpm/livy/SPECS/livy.spec
index 6be0afd3f..8ff2bbe4e 100644
--- a/bigtop-packages/src/rpm/livy/SPECS/livy.spec
+++ b/bigtop-packages/src/rpm/livy/SPECS/livy.spec
@@ -13,15 +13,17 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-%define lib_livy /usr/lib/%{name}
-%define etc_livy %{_sysconfdir}/%{name}
+%define livy_name livy
+%define livy_pkg_name %{livy_name}%{pkg_name_suffix}
+%define lib_livy %{parent_dir}/usr/lib/%{livy_name}
+%define etc_livy %{_sysconfdir}/%{livy_name}
 %define config_livy %{etc_livy}/conf
 %define livy_services server
-%define var_lib_livy /var/lib/%{name}
-%define var_run_livy /var/run/%{name}
-%define var_log_livy /var/log/%{name}
+%define var_lib_livy /var/lib/%{livy_name}
+%define var_run_livy /var/run/%{livy_name}
+%define var_log_livy /var/log/%{livy_name}
 
-Name: livy
+Name: %{livy_pkg_name}
 Version: %{livy_version}
 Release: %{livy_release}
 BuildArch: noarch
@@ -29,9 +31,9 @@ Summary: Livy Server
 URL: http://livy.incubator.apache.org/
 Group: Development/Libraries
 License: ASL 2.0
-Source0: %{name}-%{livy_base_version}.zip
+Source0: %{livy_name}-%{livy_base_version}.zip
 Source1: do-component-build
-Source2: install_%{name}.sh
+Source2: install_%{livy_name}.sh
 Source3: livy-server.svc
 Source4: bigtop.bom
 Source6: init.d.tmpl
@@ -72,7 +74,7 @@ Requires: /lib/lsb/init-functions
 %__rm -rf $RPM_BUILD_ROOT
 
 %prep
-%setup -n %{name}-%{version}
+%setup -n %{livy_name}-%{version}
 #BIGTOP_PATCH_COMMANDS
 
 %build
@@ -82,22 +84,22 @@ bash %{SOURCE1}
 # Init.d scripts
 %__install -d -m 0755 $RPM_BUILD_ROOT/%{initd_dir}/
 
-bash -x %{SOURCE2} --prefix=$RPM_BUILD_ROOT --build-dir=build
+bash -x %{SOURCE2} --prefix=$RPM_BUILD_ROOT --build-dir=build 
--lib-dir=%{lib_livy}
 
 for service in %{livy_services}
 do
   # Install init script
-  initd_script=$RPM_BUILD_ROOT/%{initd_dir}/%{name}-${service}
-  bash %{SOURCE6} $RPM_SOURCE_DIR/%{name}-${service}.svc rpm $initd_script
+  initd_script=$RPM_BUILD_ROOT/%{initd_dir}/%{livy_name}-${service}
+  bash %{SOURCE6} $RPM_SOURCE_DIR/%{livy_name}-${service}.svc rpm $initd_script
 done
 
 %preun
 for service in %{livy_services}; do
-  /sbin/service %{name}-${service} status > /dev/null 2>&1
+  /sbin/service %{livy_name}-${service} status > /dev/null 2>&1
   if [ $? -eq 0 ]; then
-    /sbin/service %{name}-${service} stop > /dev/null 2>&1
+    /sbin/service %{livy_name}-${service} stop > /dev/null 2>&1
   fi
-  chkconfig --del %{name}-${service}
+  chkconfig --del %{livy_name}-${service}
 done
 
 %pre
@@ -106,19 +108,19 @@ getent passwd livy >/dev/null || useradd -c "Livy" -s 
/sbin/nologin -g livy -r -
 
 %post
 install --owner livy --group livy --directory --mode=0755 %{var_log_livy}
-%{alternatives_cmd} --install %{config_livy} %{name}-conf %{config_livy}.dist 
30
+%{alternatives_cmd} --install %{config_livy} %{livy_name}-conf 
%{config_livy}.dist 30
 for service in %{livy_services}; do
-  chkconfig --add %{name}-${service}
+  chkconfig --add %{livy_name}-${service}
 done
 
 %postun
 for service in %{livy_services}; do
   if [ $1 -ge 1 ]; then
-    service %{name}-${service} condrestart >/dev/null 2>&1
+    service %{livy_name}-${service} condrestart >/dev/null 2>&1
   fi
 done
 
-%{alternatives_cmd} --remove %{name}-conf %{config_livy}.dist
+%{alternatives_cmd} --remove %{livy_name}-conf %{config_livy}.dist
 
 %files
 %defattr(-,root,root)
@@ -127,4 +129,4 @@ done
 %attr(0755,livy,livy) %{var_lib_livy}
 %attr(0755,livy,livy) %{var_run_livy}
 %attr(0755,livy,livy) %{var_log_livy}
-%attr(0755,root,root) %{initd_dir}/%{name}*
+%attr(0755,root,root) %{initd_dir}/%{livy_name}*
diff --git a/bigtop.bom b/bigtop.bom
index 7f86328fb..52587fd39 100644
--- a/bigtop.bom
+++ b/bigtop.bom
@@ -325,6 +325,7 @@ bigtop {
     }
     'livy' {
       name    = 'livy'
+      rpm_pkg_suffix = "_" + bigtop.base_version.replace(".", "_")
       relNotes = 'Apache Livy'
       version { base = '0.8.0'; pkg = base; release = 1 }
       tarball { destination = "${name}-${version.base}.zip"

Reply via email to