Skip to content

Commit 2e73cd5

Browse files
Chnages
2 parents 835a0d2 + fb05502 commit 2e73cd5

File tree

3 files changed

+134
-5
lines changed

3 files changed

+134
-5
lines changed

bigtop-packages/src/common/ranger/install_ranger.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ else
146146
COMPONENT_LIB_DIR=${PREFIX}/${RANGER_COMPONENT_DIR}/tomcat/webapps/kylin/WEB-INF/lib
147147
elif [ "${RANGER_COMPONENT}" = "elasticsearch" ]; then
148148
COMPONENT_LIB_DIR=${PREFIX}/${RANGER_COMPONENT_DIR}/plugins
149-
elif [ "${RANGER_COMPONENT}" = "presto" ]; then
149+
elif [ "${RANGER_COMPONENT}" = "trino" ]; then
150150
COMPONENT_LIB_DIR=${PREFIX}/${RANGER_COMPONENT_DIR}/plugin/ranger
151151
if [ ! -d "${COMPONENT_LIB_DIR}" ]; then
152152
echo "INFO: Creating ${COMPONENT_LIB_DIR}"

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
%define usr_lib_sqoop %{parent_dir}/usr/lib/sqoop
3232
%define usr_lib_kylin %{parent_dir}/usr/lib/kylin
3333
%define usr_lib_elasticsearch %{parent_dir}/usr/lib/elasticsearch
34-
%define usr_lib_presto %{parent_dir}/usr/lib/presto
34+
%define usr_lib_trino %{parent_dir}/usr/lib/trino
3535

3636
%define doc_dir %{parent_dir}/%{_docdir}
3737

@@ -409,17 +409,22 @@ AutoReq: no
409409
%description elasticsearch-plugin
410410
Ranger ELASTICSEARCH plugin component runs within elasticsearch to provide enterprise security using ranger framework
411411

412-
%package presto-plugin
413-
Summary: ranger plugin for presto
412+
%package trino-plugin
413+
Summary: ranger plugin for trino
414414
Group: System/Daemons
415415
# On Rocky 8, find-requires picks up /usr/bin/python, but it's not provided by any package.
416416
# So installing ranger-*-plugin fails with a "nothing provides /usr/bin/python" message,
417417
# even when python3 is installed and /usr/bin/python is created as a symlink to python3.
418418
# Therefore we disable find-requires for each plugins with the following option.
419419
AutoReq: no
420420

421+
<<<<<<< HEAD
421422
%description presto-plugin
422423
Ranger presto plugin component runs within presto to provide enterprise security using ranger framework
424+
=======
425+
%description trino-plugin
426+
Ranger trino plugin component runs within trino to provide enterprise security using ranger framework
427+
>>>>>>> fb055028b8c3541998e92f1066ff7a3eb3c0666a
423428

424429

425430
%prep
@@ -438,7 +443,7 @@ bash %{SOURCE1}
438443
#########################
439444
%install
440445
%__rm -rf $RPM_BUILD_ROOT
441-
for comp in admin usersync kms tagsync hdfs-plugin yarn-plugin hive-plugin hbase-plugin knox-plugin storm-plugin kafka-plugin atlas-plugin sqoop-plugin solr-plugin kylin-plugin elasticsearch-plugin presto-plugin
446+
for comp in admin usersync kms tagsync hdfs-plugin yarn-plugin hive-plugin hbase-plugin knox-plugin storm-plugin kafka-plugin atlas-plugin sqoop-plugin solr-plugin kylin-plugin elasticsearch-plugin trino-plugin
442447
do
443448
env RANGER_VERSION=%{ranger_base_version} /bin/bash %{SOURCE2} \
444449
--prefix=$RPM_BUILD_ROOT \

install_trino.sh

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
#!/bin/bash
2+
3+
# Licensed to the Apache Software Foundation (ASF) under one or more
4+
# contributor license agreements. See the NOTICE file distributed with
5+
# this work for additional information regarding copyright ownership.
6+
# The ASF licenses this file to You under the Apache License, Version 2.0
7+
# (the "License"); you may not use this file except in compliance with
8+
# the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
set -e
19+
20+
usage() {
21+
echo "
22+
usage: $0 <options>
23+
Required not-so-options:
24+
--build-dir=DIR path to dist.dir
25+
--source-dir=DIR path to package shared files dir
26+
--prefix=PREFIX path to install into
27+
Optional options:
28+
--doc-dir=DIR path to install docs into [/usr/share/doc/trino]
29+
--lib-dir=DIR path to install trino home [/usr/lib/trino]
30+
--installed-lib-dir=DIR path where lib-dir will end up on target system
31+
--bin-dir=DIR path to install bins [/usr/bin]
32+
... [ see source for more similar options ]
33+
"
34+
exit 1
35+
}
36+
37+
OPTS=$(getopt \
38+
-n $0 \
39+
-o '' \
40+
-l 'prefix:' \
41+
-l 'lib-dir:' \
42+
-l 'installed-lib-dir:' \
43+
-l 'bin-dir:' \
44+
-l 'trino-version:' \
45+
-l 'source-dir:' \
46+
-l 'cli-dir:' \
47+
-l 'build-dir:' -- "$@")
48+
49+
if [ $? != 0 ] ; then
50+
usage
51+
fi
52+
53+
eval set -- "$OPTS"
54+
while true ; do
55+
case "$1" in
56+
--prefix)
57+
PREFIX=$2 ; shift 2
58+
;;
59+
--build-dir)
60+
BUILD_DIR=$2 ; shift 2
61+
;;
62+
--source-dir)
63+
SOURCE_DIR=$2 ; shift 2
64+
;;
65+
--cli-dir)
66+
CLI_BUILD_DIR=$2 ; shift 2
67+
;;
68+
--lib-dir)
69+
LIB_DIR=$2 ; shift 2
70+
;;
71+
--installed-lib-dir)
72+
INSTALLED_LIB_DIR=$2 ; shift 2
73+
;;
74+
--bin-dir)
75+
BIN_DIR=$2 ; shift 2
76+
;;
77+
--)
78+
shift ; break
79+
;;
80+
*)
81+
echo "Unknown option: $1"
82+
usage
83+
exit 1
84+
;;
85+
esac
86+
done
87+
88+
for var in PREFIX BUILD_DIR SOURCE_DIR ; do
89+
if [ -z "$(eval "echo \$$var")" ]; then
90+
echo Missing param: $var
91+
usage
92+
fi
93+
done
94+
95+
if [ -f "$SOURCE_DIR/bigtop.bom" ]; then
96+
. $SOURCE_DIR/bigtop.bom
97+
fi
98+
99+
MAN_DIR=${MAN_DIR:-/usr/share/man}/man1
100+
DOC_DIR=${DOC_DIR:-/usr/share/doc/trino}
101+
CLI_DIR=${CLI_DIR:-/usr/lib/trino-cli}
102+
LIB_DIR=${TRINO_DIR:-/usr/lib/trino}
103+
VAR_DIR=${VAR_DIR:-/var/lib/trino}
104+
LOG_DIR=${LOG_DIR:-/var/log/trino}
105+
RUN_DIR=${RUN_DIR:-/var/run/trino}
106+
INSTALLED_LIB_DIR=${INSTALLED_LIB_DIR:-/usr/lib/trino}
107+
BIN_DIR=${BIN_DIR:-/usr/bin}
108+
CONF_DIR=${CONF_DIR:-/etc/trino}
109+
CONF_DIST_DIR=${CONF_DIST_DIR:-/etc/trino.dist}
110+
DEFAULT_DIR=${DEFAULT_DIR:-/etc/default}
111+
112+
install -d -m 0755 $PREFIX/$CONF_DIST_DIR
113+
install -d -m 0755 $PREFIX/$LIB_DIR
114+
install -d -m 0755 $PREFIX/$CLI_DIR
115+
install -d -m 0755 $PREFIX/$DOC_DIR
116+
install -d -m 0755 $PREFIX/$VAR_DIR
117+
install -d -m 0755 $PREFIX/$LOG_DIR
118+
install -d -m 0755 $PREFIX/$RUN_DIR
119+
install -d -m 0755 $PREFIX/$DEFAULT_DIR
120+
121+
cp -ra ${BUILD_DIR}/* $PREFIX/$LIB_DIR/
122+
cp -ra ${CLI_BUILD_DIR}/* $PREFIX/$CLI_DIR/
123+
124+
chmod +x $PREFIX/$LIB_DIR/bin/launcher

0 commit comments

Comments
 (0)