Skip to content

Commit 4066896

Browse files
Danoripaulyakovlevcarmenblaine3
authored
BIGTOP-4149. Support Livy in bigtop-select and pkgSuffix and parentDir build arguments. (#1282)
Co-authored-by: Paul Yakovlev <yvpavel@gmail.com> Co-authored-by: Carmen Blaine <carmenblaine@gmail.com>
1 parent 9bd66b3 commit 4066896

File tree

4 files changed

+28
-22
lines changed

4 files changed

+28
-22
lines changed

bigtop-packages/src/common/bigtop-select/conf-select

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ vconfroot = 'etc'
3131
lib_root = "usr/lib"
3232
vconf_name = "conf.dist"
3333
packages = ("hadoop", "hbase", "hive", "hive-hcatalog",
34-
"kafka", "spark", "tez",
34+
"kafka", "spark", "tez", "livy",
3535
"zookeeper", "zeppelin", "flink", "solr", "ranger-admin", "ranger-usersync", "ranger-tagsync")
3636
''' conf link
3737
/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

bigtop-packages/src/common/bigtop-select/distro-select

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ leaves = {
7070
"ranger-admin" : "ranger-admin",
7171
"ranger-usersync" : "ranger-usersync",
7272
"ranger-tagsync" : "ranger-tagsync",
73+
"livy-server" : "livy",
74+
"livy-client" : "livy"
7375
"alluxio": "alluxio",
7476
"alluxio-master": "alluxio",
7577
"alluxio-worker": "alluxio"
@@ -85,7 +87,8 @@ aliases = {
8587
"phoenix-client",
8688
"zookeeper-client",
8789
"flink-client",
88-
"spark-client"],
90+
"spark-client",
91+
"livy-client"],
8992
"hadoop-hdfs-server": ["hadoop-hdfs-datanode",
9093
"hadoop-hdfs-journalnode",
9194
"hadoop-hdfs-namenode",

bigtop-packages/src/rpm/livy/SPECS/livy.spec

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,27 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
%define lib_livy /usr/lib/%{name}
17-
%define etc_livy %{_sysconfdir}/%{name}
16+
%define livy_name livy
17+
%define livy_pkg_name %{livy_name}%{pkg_name_suffix}
18+
%define lib_livy %{parent_dir}/usr/lib/%{livy_name}
19+
%define etc_livy %{_sysconfdir}/%{livy_name}
1820
%define config_livy %{etc_livy}/conf
1921
%define livy_services server
20-
%define var_lib_livy /var/lib/%{name}
21-
%define var_run_livy /var/run/%{name}
22-
%define var_log_livy /var/log/%{name}
22+
%define var_lib_livy /var/lib/%{livy_name}
23+
%define var_run_livy /var/run/%{livy_name}
24+
%define var_log_livy /var/log/%{livy_name}
2325

24-
Name: livy
26+
Name: %{livy_pkg_name}
2527
Version: %{livy_version}
2628
Release: %{livy_release}
2729
BuildArch: noarch
2830
Summary: Livy Server
2931
URL: http://livy.incubator.apache.org/
3032
Group: Development/Libraries
3133
License: ASL 2.0
32-
Source0: %{name}-%{livy_base_version}.zip
34+
Source0: %{livy_name}-%{livy_base_version}.zip
3335
Source1: do-component-build
34-
Source2: install_%{name}.sh
36+
Source2: install_%{livy_name}.sh
3537
Source3: livy-server.svc
3638
Source4: bigtop.bom
3739
Source6: init.d.tmpl
@@ -72,7 +74,7 @@ Requires: /lib/lsb/init-functions
7274
%__rm -rf $RPM_BUILD_ROOT
7375

7476
%prep
75-
%setup -n %{name}-%{version}
77+
%setup -n %{livy_name}-%{version}
7678
#BIGTOP_PATCH_COMMANDS
7779

7880
%build
@@ -82,22 +84,22 @@ bash %{SOURCE1}
8284
# Init.d scripts
8385
%__install -d -m 0755 $RPM_BUILD_ROOT/%{initd_dir}/
8486

85-
bash -x %{SOURCE2} --prefix=$RPM_BUILD_ROOT --build-dir=build
87+
bash -x %{SOURCE2} --prefix=$RPM_BUILD_ROOT --build-dir=build --lib-dir=%{lib_livy}
8688

8789
for service in %{livy_services}
8890
do
8991
# Install init script
90-
initd_script=$RPM_BUILD_ROOT/%{initd_dir}/%{name}-${service}
91-
bash %{SOURCE6} $RPM_SOURCE_DIR/%{name}-${service}.svc rpm $initd_script
92+
initd_script=$RPM_BUILD_ROOT/%{initd_dir}/%{livy_name}-${service}
93+
bash %{SOURCE6} $RPM_SOURCE_DIR/%{livy_name}-${service}.svc rpm $initd_script
9294
done
9395

9496
%preun
9597
for service in %{livy_services}; do
96-
/sbin/service %{name}-${service} status > /dev/null 2>&1
98+
/sbin/service %{livy_name}-${service} status > /dev/null 2>&1
9799
if [ $? -eq 0 ]; then
98-
/sbin/service %{name}-${service} stop > /dev/null 2>&1
100+
/sbin/service %{livy_name}-${service} stop > /dev/null 2>&1
99101
fi
100-
chkconfig --del %{name}-${service}
102+
chkconfig --del %{livy_name}-${service}
101103
done
102104

103105
%pre
@@ -106,19 +108,19 @@ getent passwd livy >/dev/null || useradd -c "Livy" -s /sbin/nologin -g livy -r -
106108

107109
%post
108110
install --owner livy --group livy --directory --mode=0755 %{var_log_livy}
109-
%{alternatives_cmd} --install %{config_livy} %{name}-conf %{config_livy}.dist 30
111+
%{alternatives_cmd} --install %{config_livy} %{livy_name}-conf %{config_livy}.dist 30
110112
for service in %{livy_services}; do
111-
chkconfig --add %{name}-${service}
113+
chkconfig --add %{livy_name}-${service}
112114
done
113115

114116
%postun
115117
for service in %{livy_services}; do
116118
if [ $1 -ge 1 ]; then
117-
service %{name}-${service} condrestart >/dev/null 2>&1
119+
service %{livy_name}-${service} condrestart >/dev/null 2>&1
118120
fi
119121
done
120122

121-
%{alternatives_cmd} --remove %{name}-conf %{config_livy}.dist
123+
%{alternatives_cmd} --remove %{livy_name}-conf %{config_livy}.dist
122124

123125
%files
124126
%defattr(-,root,root)
@@ -127,4 +129,4 @@ done
127129
%attr(0755,livy,livy) %{var_lib_livy}
128130
%attr(0755,livy,livy) %{var_run_livy}
129131
%attr(0755,livy,livy) %{var_log_livy}
130-
%attr(0755,root,root) %{initd_dir}/%{name}*
132+
%attr(0755,root,root) %{initd_dir}/%{livy_name}*

bigtop.bom

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ bigtop {
325325
}
326326
'livy' {
327327
name = 'livy'
328+
rpm_pkg_suffix = "_" + bigtop.base_version.replace(".", "_")
328329
relNotes = 'Apache Livy'
329330
version { base = '0.8.0'; pkg = base; release = 1 }
330331
tarball { destination = "${name}-${version.base}.zip"

0 commit comments

Comments
 (0)