forked from kuebk/node-zookeeper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libzk-build.sh
49 lines (45 loc) · 1.06 KB
/
libzk-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
ROOT=`pwd`
BUILD=$ROOT/build/zk
BUILD_TMP=$BUILD/tmp
PLATFORM=`uname`
ZK=zookeeper-3.4.3
ZK_FILE=/$BUILD_TMP/$ZK.tar.gz
ZK_URL=http://apache.mirrors.tds.net/zookeeper/$ZK/$ZK.tar.gz
if [ "$PLATFORM" != "SunOS" ]; then
mkdir -p $BUILD_TMP
if [ ! -e "$ZK_FILE" ] ; then
echo "Downloading $ZK from $ZK_URL"
curl --silent --output $ZK_FILE $ZK_URL || wget $ZK_URL -O $ZK_FILE
if [ $? != 0 ] ; then
echo "Unable to download zookeeper library"
exit 1
fi
fi
cd $BUILD_TMP
tar -zxf $ZK_FILE && \
cd $ZK/src/c && \
./configure \
--without-syncapi \
--enable-static \
--disable-shared \
--with-pic \
--libdir=$BUILD/lib \
--prefix=$BUILD && \
make && \
make install
if [ $? != 0 ] ; then
echo "Unable to build zookeeper library"
exit 1
fi
cd $ROOT
else
if [ `uname -v` =~ "joyent_.*" ] ; then
pkgin list | grep zookeeper-client-3.4.3
if [ $? != 0] ; then
echo "You must install zookeeper before installing this module. Try:"
echo "pkgin install zookeeper-client-3.4.3"
exit 1
fi
fi
fi