-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·75 lines (61 loc) · 1.58 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
set -e
. ./pdns_version
BUILD_PDNS=${BUILD_PDNS:-no}
PREFIX=$HOME/opt/pdns
if [ "$PDNS_CONFIG_OPT_ENV" != "" ]; then
PDNS_CONFIG_OPT=$PDNS_CONFIG_OPT_ENV
else
PDNS_CONFIG_OPT='--prefix='$PREFIX
fi
if [ ! -d "./mruby/src" ]; then
echo "mruby Downloading ..."
git submodule init
git submodule update
echo "mruby Downloading ... Done"
fi
cd mruby
if [ -d "./build" ]; then
echo "mruby Cleaning ..."
./minirake clean
echo "mruby Cleaning ... Done"
fi
cd ..
if [ $PDNS_SRC_ENV ]; then
PDNS_SRC=$PDNS_SRC_ENV
else
echo "powedns Downloading ..."
if [ -d "./build" ]; then
echo "build directory was found"
else
mkdir build
fi
cd build
if [ -e pdns-src ]; then
unlink pdns-src
fi
ln -s ${PDNS_SRC_VER} pdns-src
if [ ! -e ${PDNS_SRC_VER} ]; then
wget https://downloads.powerdns.com/releases/${PDNS_SRC_VER}.tar.bz2
echo "powerdns Downloading ... Done"
tar --bzip2 -xf ${PDNS_SRC_VER}.tar.bz2
fi
cd ..
fi
echo "mruby building ..."
cp build_config.rb mruby
(cd mruby && ./minirake)
echo "mruby building ... Done"
echo "pdns configure ..."
( cd build/${PDNS_SRC_VER} && ./configure ${PDNS_CONFIG_OPT} )
echo "pdns configure ... Done"
if [ "${BUILD_PDNS}" = "yes" ]; then
echo "pdns building ... "
( cd build/${PDNS_SRC_VER} && make && make install )
echo "pdns building ... Done"
fi
echo "mrubybackend building ..."
( cd src && ./minibuild.sh )
#cp src/libmrubybackend.so $PREFIX/lib/pdns/
echo "mrubybackend building ... Done"
echo "build.sh ... successful"