Skip to content

Commit

Permalink
INTERNAL: Move a libevent dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ing-eoking committed Oct 20, 2023
1 parent 4b5e3b8 commit 40b5395
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
/config/Doxyfile-api
/configure
/depcomp
/deps/*.log
/doc/doxy
/doc/doxy-api
/doc/engine-interface.txt
Expand Down
58 changes: 58 additions & 0 deletions deps/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

install_path=$1
deps_path=$(dirname $0)

## Error handling
trap "stop_build" ERR

stop_build() {
printf "\nError has occurred. $0 has failed\n"
printf "Check $deps_path/build.log\n"
exit -1
}

## Get libevent version from libevent file name
libevent_file=$(basename $(find $deps_path -name "libevent*.tar.gz"))
libevent_version=$(sed -e 's/libevent-\(.*\)\.tar\.gz/\1/' <<< $libevent_file)

# Move to build.sh directory and
# convert relative path to absolute path
pushd $deps_path > build.log
deps_path=$PWD

## Information about installation
echo "---------------------------------------"
echo "ARCUS MEMCACHED DEPENDENCY BUILD: START"
echo "---------------------------------------"
echo "INSTALL PATH : $install_path"
echo "LOG PATH : $deps_path/build.log"
echo "LIBEVENT VERSION : $libevent_version"
echo "---------------------------------------"

## If libevent source directory already exists, remove it.
if test -d libevent-$libevent_version ; then
rm -rf libevent-$libevent_version
fi

## Install libevent
printf "[libevent decompression] .. START"
tar -xvf ./libevent-$libevent_version.tar.gz >> build.log 2>&1
printf "\r[libevent decompression] .. SUCCEED\n"
pushd libevent-$libevent_version >> ../build.log
printf "[libevent configure] .. START"
./configure --prefix=$install_path --disable-openssl >> ../build.log 2>&1
printf "\r[libevent configure] .. SUCCEED\n"
printf "[libevent make] .. START"
make >> ../build.log 2>&1
printf "\r[libevent make] .. SUCCEED\n"
printf "[libevent make install] .. START"
make install >> ../build.log 2>&1
printf "\r[libevent make install] .. SUCCEED\n"
popd >> build.log
rm -rf libevent-$libevent_version >> ./build.log 2>&1
popd >> $deps_path/build.log

echo "---------------------------------------"
echo "ARCUS MEMCACHED DEPENDENCY BUILD: END"
echo "---------------------------------------"
Binary file added deps/libevent-2.1.12-stable.tar.gz
Binary file not shown.

0 comments on commit 40b5395

Please sign in to comment.