diff --git a/src/packages/rpm/spec/hbase.spec b/src/packages/rpm/spec/hbase.spec index f4da5834405..1af874d59e6 100644 --- a/src/packages/rpm/spec/hbase.spec +++ b/src/packages/rpm/spec/hbase.spec @@ -86,28 +86,26 @@ if [ -d ${RPM_BUILD_DIR}%{_pid_dir} ]; then fi mkdir -p ${RPM_BUILD_DIR}%{_conf_dir} -mkdir -p ${RPM_BUILD_DIR}%{_bin_dir} -mkdir -p ${RPM_BUILD_DIR}%{_include_dir} -mkdir -p ${RPM_BUILD_DIR}%{_lib_dir} -mkdir -p ${RPM_BUILD_DIR}%{_libexec_dir} mkdir -p ${RPM_BUILD_DIR}%{_log_dir} mkdir -p ${RPM_BUILD_DIR}%{_conf_dir} -mkdir -p ${RPM_BUILD_DIR}%{_man_dir} mkdir -p ${RPM_BUILD_DIR}%{_pid_dir} -mkdir -p ${RPM_BUILD_DIR}%{_sbin_dir} mkdir -p ${RPM_BUILD_DIR}%{_share_dir} -mkdir -p ${RPM_BUILD_DIR}%{_src_dir} +mkdir -p ${RPM_BUILD_DIR}%{_share_dir}/sbin +mkdir -p ${RPM_BUILD_DIR}/etc/rc.d/init.d -cp ${RPM_BUILD_DIR}/%{_final_name}/src/packages/update-hbase-env.sh ${RPM_BUILD_DIR}/%{_final_name}/sbin/update-hbase-env.sh -cp ${RPM_BUILD_DIR}/%{_final_name}/src/packages/rpm/init.d/hbase-master ${RPM_BUILD_DIR}/%{_final_name}/sbin/hbase-master -cp ${RPM_BUILD_DIR}/%{_final_name}/src/packages/rpm/init.d/hbase-regionserver ${RPM_BUILD_DIR}/%{_final_name}/sbin/hbase-regionserver -chmod 0755 ${RPM_BUILD_DIR}/%{_final_name}/sbin/* -rm -f ${RPM_BUILD_DIR}/%{_final_name}/lib/hadoop-core* -rm -f ${RPM_BUILD_DIR}/%{_final_name}/lib/zookeeper* +cp ${RPM_BUILD_DIR}/%{_final_name}/src/packages/update-hbase-env.sh ${RPM_BUILD_DIR}%{_share_dir}/sbin/update-hbase-env.sh +cp ${RPM_BUILD_DIR}/%{_final_name}/src/packages/rpm/init.d/hbase-master ${RPM_BUILD_DIR}%{_share_dir}/sbin/hbase-master +cp ${RPM_BUILD_DIR}/%{_final_name}/src/packages/rpm/init.d/hbase-regionserver ${RPM_BUILD_DIR}%{_share_dir}/sbin/hbase-regionserver +chmod 0755 ${RPM_BUILD_DIR}%{_share_dir}/sbin/* +rm -f ${RPM_BUILD_DIR}/%{_final_name}/*.txt +rm -f ${RPM_BUILD_DIR}/%{_final_name}/pom.xml mv -f ${RPM_BUILD_DIR}/%{_final_name}/conf/* ${RPM_BUILD_DIR}%{_conf_dir} +rmdir ${RPM_BUILD_DIR}/%{_final_name}/conf +rm -rf ${RPM_BUILD_DIR}/%{_final_name}/src mv -f ${RPM_BUILD_DIR}/%{_final_name}/* ${RPM_BUILD_DIR}%{_share_dir} -rm -rf ${RPM_BUILD_DIR}/%{_final_name} +%install +cp -Rp ${RPM_BUILD_DIR} ${RPM_BUILD_ROOT} %preun ${RPM_INSTALL_PREFIX0}/share/hbase/sbin/update-hbase-env.sh \ diff --git a/src/packages/update-hbase-env.sh b/src/packages/update-hbase-env.sh index 60ab096169e..45276b288ea 100644 --- a/src/packages/update-hbase-env.sh +++ b/src/packages/update-hbase-env.sh @@ -108,8 +108,8 @@ if [ "${ARCH}" != "i386" ]; then LIB_DIR=${LIB_DIR}64 fi -. /etc/default/hadoop-env.sh -. /etc/default/zookeeper-env.sh +[ -f /etc/default/hadoop-env.sh ] && . /etc/default/hadoop-env.sh +[ -f /etc/default/zookeeper-env.sh ] && . /etc/default/zookeeper-env.sh if [ "${UNINSTALL}" -eq "1" ]; then # Remove symlinks @@ -149,11 +149,11 @@ else ln -sf ${CONF_DIR}/hbase-env.sh /etc/default/hbase-env.sh ln -sf ${CONF_DIR}/hbase-env.sh /etc/profile.d/hbase-env.sh - if [ -d ${HADOOP_HOME} ]; then + if [ -n "${HADOOP_HOME}" -a -d "${HADOOP_HOME}" ]; then HADOOP_JARS=`ls ${HADOOP_HOME}/*.jar | tr '\n' ':'` fi - if [ -d ${ZOOKEEPER_HOME}/share/zookeeper ]; then + if [ -n "${ZOOKEEPER_HOME}" -a -d "${ZOOKEEPER_HOME}/share/zookeeper" ]; then ZOOKEEPER_JARS=`ls ${ZOOKEEPER_HOME}/share/zookeeper/*.jar | tr '\n' ':'` fi