-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
INTERNAL: Move a libevent dependency
- Loading branch information
1 parent
4b5e3b8
commit 40b5395
Showing
3 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.