Bladeren bron

Fixing mesh build

Bob Mottram 8 jaren geleden
bovenliggende
commit
d6ee4bcec1
2 gewijzigde bestanden met toevoegingen van 118 en 13 verwijderingen
  1. 57
    13
      src/freedombone-app-tox
  2. 61
    0
      src/freedombone-app-zeronet

+ 57
- 13
src/freedombone-app-tox Bestand weergeven

@@ -334,6 +334,43 @@ function install_tox_client {
334 334
 }
335 335
 
336 336
 function mesh_tox_node {
337
+	# obtain commits from the main file
338
+	TOXCORE_COMMIT_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXCORE_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
339
+	if [ ${#TOXCORE_COMMIT_MAIN} -gt 10 ]; then
340
+		TOXCORE_COMMIT=$TOXCORE_COMMIT_MAIN
341
+	fi
342
+	if [ ! $TOXCORE_COMMIT ]; then
343
+		echo $'No Tox commit was specified'
344
+		exit 76325
345
+	fi
346
+
347
+	TOXID_REPO_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
348
+	if [ ${#TOXID_REPO_MAIN} -gt 5 ]; then
349
+		TOXID_REPO=$TOXID_REPO_MAIN
350
+	fi
351
+	if [ ! $TOXID_REPO ]; then
352
+		echo $'No ToxID repo was specified'
353
+		exit 78252
354
+	fi
355
+
356
+	TOX_PORT_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOX_PORT=" | head -n 1 | awk -F '=' '{print $2}')
357
+	if [ ${#TOX_PORT_MAIN} -gt 2 ]; then
358
+		TOX_PORT=$TOX_PORT_MAIN
359
+	fi
360
+	if [ ! $TOX_PORT ]; then
361
+		echo $'No Tox port was specified'
362
+		exit 32856
363
+	fi
364
+
365
+	TOXCORE_REPO_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXCORE_REPO=" | head -n 1 | awk -F '"' '{print $2}')
366
+	if [ ${#TOXCORE_REPO_MAIN} -gt 10 ]; then
367
+		TOXCORE_REPO=$TOXCORE_REPO_MAIN
368
+	fi
369
+	if [ ! $TOXCORE_REPO ]; then
370
+		echo $'No Tox repo was specified'
371
+		exit 16865
372
+	fi
373
+
337 374
 	if [ ! $TOXCORE_COMMIT ]; then
338 375
 		echo $'No Tox commit was specified'
339 376
 		exit 76325
@@ -347,21 +384,27 @@ function mesh_tox_node {
347 384
 	chroot "$rootdir" apt-get -y install build-essential libtool autotools-dev
348 385
 	chroot "$rootdir" apt-get -y install automake checkinstall check git yasm
349 386
 	chroot "$rootdir" apt-get -y install libsodium13 libsodium-dev libcap2-bin
350
-	chroot "$rootdir" apt-get -y install libconfig9 libconfig-dev
387
+	chroot "$rootdir" apt-get -y install libconfig9 libconfig-dev autoconf
351 388
 
352 389
 	TEMP_SCRIPT_NAME=fbtmp37272.sh
353 390
 	TEMP_SCRIPT=/tmp/$TEMP_SCRIPT_NAME
354 391
 
355 392
 	mkdir -p ${rootdir}${INSTALL_DIR}
356 393
 	git clone ${TOXCORE_REPO} ${rootdir}${INSTALL_DIR}/toxcore
357
-	chroot "$rootdir" cd $INSTALL_DIR/toxcore && git checkout $TOXCORE_COMMIT -b $TOXCORE_COMMIT
358
-	chroot "$rootdir" cd $INSTALL_DIR/toxcore && autoreconf -i
359
-	chroot "$rootdir" cd $INSTALL_DIR/toxcore && ./configure --enable-daemon --disable-av
360
-	chroot "$rootdir" cd $INSTALL_DIR/toxcore && make
361 394
 	if [ ! "$?" = "0" ]; then
362
-		exit 429285
395
+		exit 429252
363 396
 	fi
364
-	chroot "$rootdir" cd $INSTALL_DIR/toxcore && make install
397
+	cd ${rootdir}$INSTALL_DIR/toxcore
398
+	git checkout $TOXCORE_COMMIT -b $TOXCORE_COMMIT
399
+
400
+	chroot "$rootdir" /bin/bash -x <<EOF
401
+cd ${INSTALL_DIR}/toxcore
402
+autoreconf -i
403
+./configure --enable-daemon --disable-av
404
+make
405
+make install
406
+EOF
407
+
365 408
 	cp $rootdir/usr/local/lib/libtoxcore* $rootdir/usr/lib/
366 409
 	cp ${rootdir}${INSTALL_DIR}/toxcore/other/bootstrap_daemon/tox-bootstrapd.service $rootdir/etc/systemd/system/
367 410
 	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 {
447 490
 		echo $'Unable to clone toxid repo'
448 491
 		exit 768352
449 492
 	fi
450
-	chroot "$rootdir" cd $INSTALL_DIR/toxid && make
451
-	if [ ! "$?" = "0" ]; then
452
-		echo $'Unable to make toxid'
453
-		exit 386823
454
-	fi
455
-	chroot "$rootdir" cd $INSTALL_DIR/toxid && make install
493
+
494
+	chroot "$rootdir" /bin/bash -x <<EOF
495
+cd ${INSTALL_DIR}/toxid
496
+make
497
+make install
498
+EOF
499
+
456 500
 	if [ ! -f $rootdir/usr/local/bin/toxavahi ]; then
457 501
 	  exit 3621729
458 502
 	fi

+ 61
- 0
src/freedombone-app-zeronet Bestand weergeven

@@ -30,6 +30,8 @@
30 30
 
31 31
 VARIANTS='mesh'
32 32
 
33
+MESH_INSTALL_DIR=/var/lib
34
+
33 35
 ZERONET_REPO="https://github.com/HelloZeroNet/ZeroNet.git"
34 36
 ZERONET_COMMIT='675bd462556c541d65e2d95f91f899146a373aad'
35 37
 ZERONET_BLOG_REPO="https://github.com/HelloZeroNet/ZeroBlog"
@@ -461,6 +463,33 @@ function install_zeronet_main {
461 463
 }
462 464
 
463 465
 function mesh_zeronet {
466
+	ZERONET_REPO_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_REPO=" | head -n 1 | awk -F '"' '{print $2}')
467
+	if [ ${#ZERONET_REPO_MAIN} -gt 4 ]; then
468
+		ZERONET_REPO=$ZERONET_REPO_MAIN
469
+	fi
470
+	if [ ! $ZERONET_REPO ]; then
471
+		echo $'No ZeroNet repo was specified'
472
+		exit 723539
473
+	fi
474
+
475
+	ZERONET_COMMIT_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
476
+	if [ ${#ZERONET_COMMIT_MAIN} -gt 4 ]; then
477
+		ZERONET_COMMIT=$ZERONET_COMMIT_MAIN
478
+	fi
479
+	if [ ! $ZERONET_COMMIT ]; then
480
+		echo $'No ZeroNet commit was specified'
481
+		exit 490439
482
+	fi
483
+
484
+	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}')
485
+	if [ ${#MESH_INSTALL_DIR_MAIN} -gt 4 ]; then
486
+		MESH_INSTALL_DIR=$MESH_INSTALL_DIR_MAIN
487
+	fi
488
+	if [ ! $MESH_INSTALL_DIR ]; then
489
+		echo $'No mesh install dir was specified'
490
+		exit 432052
491
+	fi
492
+
464 493
 	chroot "$rootdir" apt-get -y install python python-msgpack python-gevent
465 494
 	chroot "$rootdir" apt-get -y install python-pip bittornado
466 495
 	chroot "$rootdir" pip install msgpack-python --upgrade
@@ -535,6 +564,14 @@ function mesh_zeronet {
535 564
 function mesh_zeronet_blog {
536 565
 	ZERONET_BLOG_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_BLOG_REPO=" | head -n 1 | awk -F '"' '{print $2}')
537 566
 	ZERONET_BLOG_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_BLOG_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
567
+	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}')
568
+	if [ ${#MESH_INSTALL_DIR_MAIN} -gt 4 ]; then
569
+		MESH_INSTALL_DIR=$MESH_INSTALL_DIR_MAIN
570
+	fi
571
+	if [ ! $MESH_INSTALL_DIR ]; then
572
+		echo $'No mesh install dir was specified'
573
+		exit 432052
574
+	fi
538 575
 
539 576
 	git clone $ZERONET_BLOG_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroBlog
540 577
 	if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroBlog ]; then
@@ -549,6 +586,14 @@ function mesh_zeronet_blog {
549 586
 function mesh_zeronet_mail {
550 587
 	ZERONET_MAIL_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_MAIL_REPO=" | head -n 1 | awk -F '"' '{print $2}')
551 588
 	ZERONET_MAIL_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_MAIL_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
589
+	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}')
590
+	if [ ${#MESH_INSTALL_DIR_MAIN} -gt 4 ]; then
591
+		MESH_INSTALL_DIR=$MESH_INSTALL_DIR_MAIN
592
+	fi
593
+	if [ ! $MESH_INSTALL_DIR ]; then
594
+		echo $'No mesh install dir was specified'
595
+		exit 432052
596
+	fi
552 597
 
553 598
 	git clone $ZERONET_MAIL_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroMail
554 599
 	if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroMail ]; then
@@ -563,6 +608,14 @@ function mesh_zeronet_mail {
563 608
 function mesh_zeronet_forum {
564 609
 	ZERONET_FORUM_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_FORUM_REPO=" | head -n 1 | awk -F '"' '{print $2}')
565 610
 	ZERONET_FORUM_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_FORUM_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
611
+	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}')
612
+	if [ ${#MESH_INSTALL_DIR_MAIN} -gt 4 ]; then
613
+		MESH_INSTALL_DIR=$MESH_INSTALL_DIR_MAIN
614
+	fi
615
+	if [ ! $MESH_INSTALL_DIR ]; then
616
+		echo $'No mesh install dir was specified'
617
+		exit 432052
618
+	fi
566 619
 
567 620
 	git clone $ZERONET_FORUM_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroTalk
568 621
 	if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroTalk ]; then
@@ -577,6 +630,14 @@ function mesh_zeronet_forum {
577 630
 function mesh_zeronet_id {
578 631
 	ZERONET_ID_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_ID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
579 632
 	ZERONET_ID_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_ID_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
633
+	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}')
634
+	if [ ${#MESH_INSTALL_DIR_MAIN} -gt 4 ]; then
635
+		MESH_INSTALL_DIR=$MESH_INSTALL_DIR_MAIN
636
+	fi
637
+	if [ ! $MESH_INSTALL_DIR ]; then
638
+		echo $'No mesh install dir was specified'
639
+		exit 432052
640
+	fi
580 641
 
581 642
 	git clone $ZERONET_ID_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroID
582 643
 	if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroID ]; then