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

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

commit 38616b66c75fb70da41724979d8d694a86a50912
Author: jialiang <[email protected]>
AuthorDate: Wed Jun 26 13:57:02 2024 +0800

    add parent dir for phoenix
---
 .../src/common/phoenix/install_phoenix.sh          |  8 ++++-
 bigtop-packages/src/rpm/phoenix/SPECS/phoenix.spec | 39 ++++++++++------------
 2 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/bigtop-packages/src/common/phoenix/install_phoenix.sh 
b/bigtop-packages/src/common/phoenix/install_phoenix.sh
index 1b8a77eaa..a0c2ec66c 100755
--- a/bigtop-packages/src/common/phoenix/install_phoenix.sh
+++ b/bigtop-packages/src/common/phoenix/install_phoenix.sh
@@ -27,6 +27,7 @@ usage: $0 <options>
   Optional options:
      --doc-dir=DIR               path to install docs into 
[/usr/share/doc/phoenix]
      --lib-dir=DIR               path to install phoenix home 
[/usr/lib/phoenix]
+     --var-dir=DIR               path to install phoenix contents 
[/var/lib/phoenix]
      --installed-lib-dir=DIR     path where lib-dir will end up on target 
system
      --bin-dir=DIR               path to install bins [/usr/bin]
      --examples-dir=DIR          path to install examples [doc-dir/examples]
@@ -43,6 +44,7 @@ OPTS=$(getopt \
   -l 'lib-dir:' \
   -l 'installed-lib-dir:' \
   -l 'bin-dir:' \
+  -l 'var-dir:' \
   -l 'examples-dir:' \
   -l 'conf-dir:' \
   -l 'build-dir:' -- "$@")
@@ -72,6 +74,9 @@ while true ; do
         --bin-dir)
         BIN_DIR=$2 ; shift 2
         ;;
+           --var-dir)
+               VAR_DIR=$2 ; shift 2
+               ;;
         --examples-dir)
         EXAMPLES_DIR=$2 ; shift 2
         ;;
@@ -100,6 +105,7 @@ MAN_DIR=${MAN_DIR:-/usr/share/man/man1}
 DOC_DIR=${DOC_DIR:-/usr/share/doc/phoenix}
 LIB_DIR=${LIB_DIR:-/usr/lib/phoenix}
 BIN_DIR=${BIN_DIR:-/usr/lib/phoenix/bin}
+VAR_DIR=${VAR_DIR:-/var/lib/phoenix}
 ETC_DIR=${ETC_DIR:-/etc/phoenix}
 CONF_DIR=${CONF_DIR:-${ETC_DIR}/conf.dist}
 
@@ -110,7 +116,7 @@ install -d -m 0755 $PREFIX/$DOC_DIR
 install -d -m 0755 $PREFIX/$MAN_DIR
 install -d -m 0755 $PREFIX/$ETC_DIR
 install -d -m 0755 $PREFIX/$CONF_DIR
-install -d -m 0755 $PREFIX/var/lib/phoenix
+install -d -m 0755 $PREFIX/$VAR_DIR
 install -d -m 0755 $PREFIX/var/log/phoenix
 
 cp $BUILD_DIR/*.jar $PREFIX/$LIB_DIR/
diff --git a/bigtop-packages/src/rpm/phoenix/SPECS/phoenix.spec 
b/bigtop-packages/src/rpm/phoenix/SPECS/phoenix.spec
index 76868e3d6..641d713a5 100644
--- a/bigtop-packages/src/rpm/phoenix/SPECS/phoenix.spec
+++ b/bigtop-packages/src/rpm/phoenix/SPECS/phoenix.spec
@@ -12,21 +12,23 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-%define phoenix_home /usr/lib/%{name}
+%define phoenix_home %{parent_dir}/usr/lib/%{name}
+%define phoenix_pkg_name phoenix%{pkg_name_suffix}
 %define bin_phoenix %{phoenix_home}/bin
 %define lib_phoenix %{phoenix_home}/lib
 %define examples_phoenix %{phoenix_home}/examples
-%define etc_phoenix_conf %{_sysconfdir}/%{name}/conf
-%define etc_phoenix_conf_dist %{etc_phoenix_conf}.dist
-%define var_lib_phoenix /var/lib/%{name}
+%define np_etc_phoenix = %{_sysconfdir}/%{name}
+%define etc_phoenix_conf = %{parent_dir}/%{_sysconfdir}/%{name}/conf
+%define etc_phoenix_conf_dist %{parent_dir}/%{np_etc_phoenix_conf}.dist
+%define var_lib_phoenix %{parent_dir}/var/lib/%{name}
 %define var_log_phoenix /var/log/%{name}
 %define man_dir %{_mandir}
-%define zookeeper_home /usr/lib/zookeeper
-%define hadoop_home /usr/lib/hadoop
-%define hadoop_mapreduce_home /usr/lib/hadoop-mapreduce
-%define hadoop_yarn_home /usr/lib/hadoop-yarn
-%define hadoop_hdfs_home /usr/lib/hadoop-hdfs
-%define hbase_home /usr/lib/hbase
+%define zookeeper_home %{parent_dir}/usr/lib/zookeeper
+%define hadoop_home %{parent_dir}/usr/lib/hadoop
+%define hadoop_mapreduce_home %{parent_dir}/usr/lib/hadoop-mapreduce
+%define hadoop_yarn_home %{parent_dir}/usr/lib/hadoop-yarn
+%define hadoop_hdfs_home %{parent_dir}/usr/lib/hadoop-hdfs
+%define hbase_home %{parent_dir}/usr/lib/hbase
 #BIGTOP_PATCH_FILES
 
 %if  %{?suse_version:1}0
@@ -73,7 +75,7 @@
 
 %endif
 
-Name: phoenix
+Name: %{phoenix_pkg_name}
 Version: %{phoenix_version}
 Release: %{phoenix_release}
 Summary: Phoenix is a SQL skin over HBase and client-embedded JDBC driver.
@@ -94,11 +96,7 @@ Requires: bsh-utils
 Requires: coreutils
 %endif
 
-%if  0%{?rhel} >= 8 || 0%{?openEuler}
-Requires: python3
-%else
-Requires: python
-%endif
+
 
 %description
 Phoenix is a SQL skin over HBase, delivered as a client-embedded JDBC driver.
@@ -121,6 +119,9 @@ bash %{SOURCE1}
 bash %{SOURCE2} \
   --build-dir=build \
   --doc-dir=%{doc_phoenix} \
+  --lib-dir=%{lib_phoenix}\
+  --bin-dir=%{bin_phoenix}\
+  --var-dir=%{var_lib_phoenix}\
   --prefix=$RPM_BUILD_ROOT
 
 %pre
@@ -130,11 +131,6 @@ getent passwd phoenix >/dev/null || useradd -c "Phoenix" 
-s /sbin/nologin -g pho
 %post
 %{alternatives_cmd} --install %{etc_phoenix_conf} %{name}-conf 
%{etc_phoenix_conf_dist} 30
 
-%if  0%{?rhel} >= 8
-%{alternatives_cmd} --set python /usr/bin/python3
-%endif
-
-
 %preun
 if [ "$1" = 0 ]; then
   %{alternatives_cmd} --remove %{name}-conf %{etc_phoenix_conf_dist} || :
@@ -148,6 +144,7 @@ fi
 %defattr(-,root,root,755)
 %doc %{doc_phoenix}
 %{phoenix_home}/phoenix-*.jar
+%{np_etc_phoenix}
 %{bin_phoenix}
 %{lib_phoenix}
 %{examples_phoenix}

Reply via email to