Skip to content

Commit

Permalink
Merge pull request cmu-db#506 from dvanaken/master
Browse files Browse the repository at this point in the history
Added RHEL 7 packages to the existing package script
  • Loading branch information
apavlo authored Jan 18, 2017
2 parents aa81dfe + aae0fdc commit e187418
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 3 deletions.
90 changes: 88 additions & 2 deletions script/installation/packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,57 @@ if [ "$UNAME" == "linux" ]; then
# If available, use LSB to identify distribution
if [ -f /etc/lsb-release -o -d /etc/lsb-release.d ]; then
export DISTRO=$(lsb_release -i | cut -d: -f2 | sed s/'^\t'//)
DISTRO_VER=$(lsb_release -r | cut -d: -f2 | sed s/'^\t'//)
# Otherwise, use release info file
else
export DISTRO=$(ls -d /etc/[A-Za-z]*[_-][rv]e[lr]* | grep -v "lsb" | cut -d'/' -f3 | cut -d'-' -f1 | cut -d'_' -f1)
DISTRO_VER=$(cat /etc/*-release | grep "VERSION_ID" | cut -d'=' -f2 | tr -d '"')
fi
fi
# For everything else (or if above failed), just use generic identifier
[ "$DISTRO" == "" ] && export DISTRO=$UNAME
unset UNAME
DISTRO=${DISTRO^^}
TMPDIR=/tmp

function install_repo_package() {
if [ "$#" -ne 1 ]; then
echo "The download path is required."
exit 1
else
dpath=$(basename "$1")
fi
pushd $TMPDIR
wget -nc "$1"
sudo yum install -y "$dpath"
popd
return 0
}

function install_package() {
if [ "$#" -lt 1 ]; then
echo "The download path is required."
exit 1
fi

pushd $TMPDIR
wget -nc "$1"
tpath=$(basename "$1")
dpath=$(tar --exclude='*/*' -tf "$tpath")
tar xzf $tpath
pushd $dpath
if [ -e "bootstrap.sh" ]; then
./bootstrap.sh
sudo ./b2 install
else
./configure
make
sudo make install
fi
popd; popd
return 0
}


## ------------------------------------------------
## UBUNTU
Expand All @@ -39,7 +81,7 @@ if [ "$DISTRO" = "UBUNTU" ]; then
lcov \
postgresql-client
## ------------------------------------------------
## FEDORA/REDHAT
## FEDORA
## ------------------------------------------------
elif [[ "$DISTRO" == *"FEDORA"* ]]; then
sudo dnf install -y git \
Expand All @@ -56,6 +98,47 @@ elif [[ "$DISTRO" == *"FEDORA"* ]]; then
lcov \
postgresql
## ------------------------------------------------
## REDHAT
## ------------------------------------------------
elif [[ "$DISTRO" == *"REDHAT"* ]] && [[ "${DISTRO_VER%.*}" == "7" ]]; then
# Package download paths
PKG_REPOS=(
"https://download.postgresql.org/pub/repos/yum/9.3/redhat/rhel-7-x86_64/pgdg-redhat93-9.3-3.noarch.rpm"
)
PKGS=(
"https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz"
"http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz"
"https://github.com/schuhschuh/gflags/archive/v2.0.tar.gz"
"https://sourceforge.net/projects/boost/files/boost/1.54.0/boost_1_54_0.tar.gz"
)

# Add required repos
for repo_path in ${PKG_REPOS[@]}; do
install_repo_package $repo_path
done

# Simple installations via yum
sudo yum install -y \
git \
gcc-c++ \
cmake \
flex \
protobuf-devel \
jemalloc-devel \
valgrind \
lcov \
m4 \
doxygen \
graphviz \
postgresql93

# Manually download some packages to guarantee
# version compatibility
for pkg_path in ${PKGS[@]}; do
install_package $pkg_path
done

## ------------------------------------------------
## UNKNOWN
## ------------------------------------------------
else
Expand All @@ -67,4 +150,7 @@ else
echo "https://github.com/cmu-db/peloton/issues"
echo
exit 1
fi
fi



2 changes: 1 addition & 1 deletion src/wire/libevent_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ LibeventServer::LibeventServer() {
LibeventServer::CreateNewConn(listen_fd, EV_READ | EV_PERSIST,
master_thread.get(), CONN_LISTENING);

LOG_INFO("Listening on port %" PRIu64, port_);
LOG_INFO("Listening on port %lu", port_);
event_base_dispatch(base);
event_free(evstop);
event_base_free(base);
Expand Down

0 comments on commit e187418

Please sign in to comment.