Fixing mesh build

This commit is contained in:
Bob Mottram 2016-07-17 20:50:01 +01:00
parent 350ab2682f
commit d6ee4bcec1
2 changed files with 118 additions and 13 deletions

View File

@ -334,6 +334,43 @@ function install_tox_client {
} }
function mesh_tox_node { function mesh_tox_node {
# obtain commits from the main file
TOXCORE_COMMIT_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXCORE_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
if [ ${#TOXCORE_COMMIT_MAIN} -gt 10 ]; then
TOXCORE_COMMIT=$TOXCORE_COMMIT_MAIN
fi
if [ ! $TOXCORE_COMMIT ]; then
echo $'No Tox commit was specified'
exit 76325
fi
TOXID_REPO_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
if [ ${#TOXID_REPO_MAIN} -gt 5 ]; then
TOXID_REPO=$TOXID_REPO_MAIN
fi
if [ ! $TOXID_REPO ]; then
echo $'No ToxID repo was specified'
exit 78252
fi
TOX_PORT_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOX_PORT=" | head -n 1 | awk -F '=' '{print $2}')
if [ ${#TOX_PORT_MAIN} -gt 2 ]; then
TOX_PORT=$TOX_PORT_MAIN
fi
if [ ! $TOX_PORT ]; then
echo $'No Tox port was specified'
exit 32856
fi
TOXCORE_REPO_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXCORE_REPO=" | head -n 1 | awk -F '"' '{print $2}')
if [ ${#TOXCORE_REPO_MAIN} -gt 10 ]; then
TOXCORE_REPO=$TOXCORE_REPO_MAIN
fi
if [ ! $TOXCORE_REPO ]; then
echo $'No Tox repo was specified'
exit 16865
fi
if [ ! $TOXCORE_COMMIT ]; then if [ ! $TOXCORE_COMMIT ]; then
echo $'No Tox commit was specified' echo $'No Tox commit was specified'
exit 76325 exit 76325
@ -347,21 +384,27 @@ function mesh_tox_node {
chroot "$rootdir" apt-get -y install build-essential libtool autotools-dev chroot "$rootdir" apt-get -y install build-essential libtool autotools-dev
chroot "$rootdir" apt-get -y install automake checkinstall check git yasm chroot "$rootdir" apt-get -y install automake checkinstall check git yasm
chroot "$rootdir" apt-get -y install libsodium13 libsodium-dev libcap2-bin chroot "$rootdir" apt-get -y install libsodium13 libsodium-dev libcap2-bin
chroot "$rootdir" apt-get -y install libconfig9 libconfig-dev chroot "$rootdir" apt-get -y install libconfig9 libconfig-dev autoconf
TEMP_SCRIPT_NAME=fbtmp37272.sh TEMP_SCRIPT_NAME=fbtmp37272.sh
TEMP_SCRIPT=/tmp/$TEMP_SCRIPT_NAME TEMP_SCRIPT=/tmp/$TEMP_SCRIPT_NAME
mkdir -p ${rootdir}${INSTALL_DIR} mkdir -p ${rootdir}${INSTALL_DIR}
git clone ${TOXCORE_REPO} ${rootdir}${INSTALL_DIR}/toxcore git clone ${TOXCORE_REPO} ${rootdir}${INSTALL_DIR}/toxcore
chroot "$rootdir" cd $INSTALL_DIR/toxcore && git checkout $TOXCORE_COMMIT -b $TOXCORE_COMMIT
chroot "$rootdir" cd $INSTALL_DIR/toxcore && autoreconf -i
chroot "$rootdir" cd $INSTALL_DIR/toxcore && ./configure --enable-daemon --disable-av
chroot "$rootdir" cd $INSTALL_DIR/toxcore && make
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
exit 429285 exit 429252
fi fi
chroot "$rootdir" cd $INSTALL_DIR/toxcore && make install cd ${rootdir}$INSTALL_DIR/toxcore
git checkout $TOXCORE_COMMIT -b $TOXCORE_COMMIT
chroot "$rootdir" /bin/bash -x <<EOF
cd ${INSTALL_DIR}/toxcore
autoreconf -i
./configure --enable-daemon --disable-av
make
make install
EOF
cp $rootdir/usr/local/lib/libtoxcore* $rootdir/usr/lib/ cp $rootdir/usr/local/lib/libtoxcore* $rootdir/usr/lib/
cp ${rootdir}${INSTALL_DIR}/toxcore/other/bootstrap_daemon/tox-bootstrapd.service $rootdir/etc/systemd/system/ cp ${rootdir}${INSTALL_DIR}/toxcore/other/bootstrap_daemon/tox-bootstrapd.service $rootdir/etc/systemd/system/
sed -i 's|ExecStart=.*|ExecStart=/usr/local/bin/tox-bootstrapd --config /etc/tox-bootstrapd.conf|g' $rootdir/etc/systemd/system/tox-bootstrapd.service sed -i 's|ExecStart=.*|ExecStart=/usr/local/bin/tox-bootstrapd --config /etc/tox-bootstrapd.conf|g' $rootdir/etc/systemd/system/tox-bootstrapd.service
@ -447,12 +490,13 @@ function mesh_tox_avahi {
echo $'Unable to clone toxid repo' echo $'Unable to clone toxid repo'
exit 768352 exit 768352
fi fi
chroot "$rootdir" cd $INSTALL_DIR/toxid && make
if [ ! "$?" = "0" ]; then chroot "$rootdir" /bin/bash -x <<EOF
echo $'Unable to make toxid' cd ${INSTALL_DIR}/toxid
exit 386823 make
fi make install
chroot "$rootdir" cd $INSTALL_DIR/toxid && make install EOF
if [ ! -f $rootdir/usr/local/bin/toxavahi ]; then if [ ! -f $rootdir/usr/local/bin/toxavahi ]; then
exit 3621729 exit 3621729
fi fi

View File

@ -30,6 +30,8 @@
VARIANTS='mesh' VARIANTS='mesh'
MESH_INSTALL_DIR=/var/lib
ZERONET_REPO="https://github.com/HelloZeroNet/ZeroNet.git" ZERONET_REPO="https://github.com/HelloZeroNet/ZeroNet.git"
ZERONET_COMMIT='675bd462556c541d65e2d95f91f899146a373aad' ZERONET_COMMIT='675bd462556c541d65e2d95f91f899146a373aad'
ZERONET_BLOG_REPO="https://github.com/HelloZeroNet/ZeroBlog" ZERONET_BLOG_REPO="https://github.com/HelloZeroNet/ZeroBlog"
@ -461,6 +463,33 @@ function install_zeronet_main {
} }
function mesh_zeronet { function mesh_zeronet {
ZERONET_REPO_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_REPO=" | head -n 1 | awk -F '"' '{print $2}')
if [ ${#ZERONET_REPO_MAIN} -gt 4 ]; then
ZERONET_REPO=$ZERONET_REPO_MAIN
fi
if [ ! $ZERONET_REPO ]; then
echo $'No ZeroNet repo was specified'
exit 723539
fi
ZERONET_COMMIT_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
if [ ${#ZERONET_COMMIT_MAIN} -gt 4 ]; then
ZERONET_COMMIT=$ZERONET_COMMIT_MAIN
fi
if [ ! $ZERONET_COMMIT ]; then
echo $'No ZeroNet commit was specified'
exit 490439
fi
MESH_INSTALL_DIR_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "MESH_INSTALL_DIR=" | head -n 1 | awk -F "'" '{print $2}')
if [ ${#MESH_INSTALL_DIR_MAIN} -gt 4 ]; then
MESH_INSTALL_DIR=$MESH_INSTALL_DIR_MAIN
fi
if [ ! $MESH_INSTALL_DIR ]; then
echo $'No mesh install dir was specified'
exit 432052
fi
chroot "$rootdir" apt-get -y install python python-msgpack python-gevent chroot "$rootdir" apt-get -y install python python-msgpack python-gevent
chroot "$rootdir" apt-get -y install python-pip bittornado chroot "$rootdir" apt-get -y install python-pip bittornado
chroot "$rootdir" pip install msgpack-python --upgrade chroot "$rootdir" pip install msgpack-python --upgrade
@ -535,6 +564,14 @@ function mesh_zeronet {
function mesh_zeronet_blog { function mesh_zeronet_blog {
ZERONET_BLOG_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_BLOG_REPO=" | head -n 1 | awk -F '"' '{print $2}') ZERONET_BLOG_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_BLOG_REPO=" | head -n 1 | awk -F '"' '{print $2}')
ZERONET_BLOG_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_BLOG_COMMIT=" | head -n 1 | awk -F "'" '{print $2}') ZERONET_BLOG_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_BLOG_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
MESH_INSTALL_DIR_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "MESH_INSTALL_DIR=" | head -n 1 | awk -F "'" '{print $2}')
if [ ${#MESH_INSTALL_DIR_MAIN} -gt 4 ]; then
MESH_INSTALL_DIR=$MESH_INSTALL_DIR_MAIN
fi
if [ ! $MESH_INSTALL_DIR ]; then
echo $'No mesh install dir was specified'
exit 432052
fi
git clone $ZERONET_BLOG_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroBlog git clone $ZERONET_BLOG_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroBlog
if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroBlog ]; then if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroBlog ]; then
@ -549,6 +586,14 @@ function mesh_zeronet_blog {
function mesh_zeronet_mail { function mesh_zeronet_mail {
ZERONET_MAIL_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_MAIL_REPO=" | head -n 1 | awk -F '"' '{print $2}') ZERONET_MAIL_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_MAIL_REPO=" | head -n 1 | awk -F '"' '{print $2}')
ZERONET_MAIL_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_MAIL_COMMIT=" | head -n 1 | awk -F "'" '{print $2}') ZERONET_MAIL_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_MAIL_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
MESH_INSTALL_DIR_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "MESH_INSTALL_DIR=" | head -n 1 | awk -F "'" '{print $2}')
if [ ${#MESH_INSTALL_DIR_MAIN} -gt 4 ]; then
MESH_INSTALL_DIR=$MESH_INSTALL_DIR_MAIN
fi
if [ ! $MESH_INSTALL_DIR ]; then
echo $'No mesh install dir was specified'
exit 432052
fi
git clone $ZERONET_MAIL_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroMail git clone $ZERONET_MAIL_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroMail
if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroMail ]; then if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroMail ]; then
@ -563,6 +608,14 @@ function mesh_zeronet_mail {
function mesh_zeronet_forum { function mesh_zeronet_forum {
ZERONET_FORUM_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_FORUM_REPO=" | head -n 1 | awk -F '"' '{print $2}') ZERONET_FORUM_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_FORUM_REPO=" | head -n 1 | awk -F '"' '{print $2}')
ZERONET_FORUM_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_FORUM_COMMIT=" | head -n 1 | awk -F "'" '{print $2}') ZERONET_FORUM_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_FORUM_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
MESH_INSTALL_DIR_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "MESH_INSTALL_DIR=" | head -n 1 | awk -F "'" '{print $2}')
if [ ${#MESH_INSTALL_DIR_MAIN} -gt 4 ]; then
MESH_INSTALL_DIR=$MESH_INSTALL_DIR_MAIN
fi
if [ ! $MESH_INSTALL_DIR ]; then
echo $'No mesh install dir was specified'
exit 432052
fi
git clone $ZERONET_FORUM_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroTalk git clone $ZERONET_FORUM_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroTalk
if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroTalk ]; then if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroTalk ]; then
@ -577,6 +630,14 @@ function mesh_zeronet_forum {
function mesh_zeronet_id { function mesh_zeronet_id {
ZERONET_ID_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_ID_REPO=" | head -n 1 | awk -F '"' '{print $2}') ZERONET_ID_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_ID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
ZERONET_ID_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_ID_COMMIT=" | head -n 1 | awk -F "'" '{print $2}') ZERONET_ID_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_ID_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
MESH_INSTALL_DIR_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "MESH_INSTALL_DIR=" | head -n 1 | awk -F "'" '{print $2}')
if [ ${#MESH_INSTALL_DIR_MAIN} -gt 4 ]; then
MESH_INSTALL_DIR=$MESH_INSTALL_DIR_MAIN
fi
if [ ! $MESH_INSTALL_DIR ]; then
echo $'No mesh install dir was specified'
exit 432052
fi
git clone $ZERONET_ID_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroID git clone $ZERONET_ID_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroID
if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroID ]; then if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroID ]; then