Bob Mottram 8 anni fa
parent
commit
d6ee4bcec1
2 ha cambiato i file con 118 aggiunte e 13 eliminazioni
  1. 57
    13
      src/freedombone-app-tox
  2. 61
    0
      src/freedombone-app-zeronet

+ 57
- 13
src/freedombone-app-tox Vedi File

334
 }
334
 }
335
 
335
 
336
 function mesh_tox_node {
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
 	if [ ! $TOXCORE_COMMIT ]; then
374
 	if [ ! $TOXCORE_COMMIT ]; then
338
 		echo $'No Tox commit was specified'
375
 		echo $'No Tox commit was specified'
339
 		exit 76325
376
 		exit 76325
347
 	chroot "$rootdir" apt-get -y install build-essential libtool autotools-dev
384
 	chroot "$rootdir" apt-get -y install build-essential libtool autotools-dev
348
 	chroot "$rootdir" apt-get -y install automake checkinstall check git yasm
385
 	chroot "$rootdir" apt-get -y install automake checkinstall check git yasm
349
 	chroot "$rootdir" apt-get -y install libsodium13 libsodium-dev libcap2-bin
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
 	TEMP_SCRIPT_NAME=fbtmp37272.sh
389
 	TEMP_SCRIPT_NAME=fbtmp37272.sh
353
 	TEMP_SCRIPT=/tmp/$TEMP_SCRIPT_NAME
390
 	TEMP_SCRIPT=/tmp/$TEMP_SCRIPT_NAME
354
 
391
 
355
 	mkdir -p ${rootdir}${INSTALL_DIR}
392
 	mkdir -p ${rootdir}${INSTALL_DIR}
356
 	git clone ${TOXCORE_REPO} ${rootdir}${INSTALL_DIR}/toxcore
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
 	if [ ! "$?" = "0" ]; then
394
 	if [ ! "$?" = "0" ]; then
362
-		exit 429285
395
+		exit 429252
363
 	fi
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
 	cp $rootdir/usr/local/lib/libtoxcore* $rootdir/usr/lib/
408
 	cp $rootdir/usr/local/lib/libtoxcore* $rootdir/usr/lib/
366
 	cp ${rootdir}${INSTALL_DIR}/toxcore/other/bootstrap_daemon/tox-bootstrapd.service $rootdir/etc/systemd/system/
409
 	cp ${rootdir}${INSTALL_DIR}/toxcore/other/bootstrap_daemon/tox-bootstrapd.service $rootdir/etc/systemd/system/
367
 	sed -i 's|ExecStart=.*|ExecStart=/usr/local/bin/tox-bootstrapd --config /etc/tox-bootstrapd.conf|g' $rootdir/etc/systemd/system/tox-bootstrapd.service
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
 		echo $'Unable to clone toxid repo'
490
 		echo $'Unable to clone toxid repo'
448
 		exit 768352
491
 		exit 768352
449
 	fi
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
 	if [ ! -f $rootdir/usr/local/bin/toxavahi ]; then
500
 	if [ ! -f $rootdir/usr/local/bin/toxavahi ]; then
457
 	  exit 3621729
501
 	  exit 3621729
458
 	fi
502
 	fi

+ 61
- 0
src/freedombone-app-zeronet Vedi File

30
 
30
 
31
 VARIANTS='mesh'
31
 VARIANTS='mesh'
32
 
32
 
33
+MESH_INSTALL_DIR=/var/lib
34
+
33
 ZERONET_REPO="https://github.com/HelloZeroNet/ZeroNet.git"
35
 ZERONET_REPO="https://github.com/HelloZeroNet/ZeroNet.git"
34
 ZERONET_COMMIT='675bd462556c541d65e2d95f91f899146a373aad'
36
 ZERONET_COMMIT='675bd462556c541d65e2d95f91f899146a373aad'
35
 ZERONET_BLOG_REPO="https://github.com/HelloZeroNet/ZeroBlog"
37
 ZERONET_BLOG_REPO="https://github.com/HelloZeroNet/ZeroBlog"
461
 }
463
 }
462
 
464
 
463
 function mesh_zeronet {
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
 	chroot "$rootdir" apt-get -y install python python-msgpack python-gevent
493
 	chroot "$rootdir" apt-get -y install python python-msgpack python-gevent
465
 	chroot "$rootdir" apt-get -y install python-pip bittornado
494
 	chroot "$rootdir" apt-get -y install python-pip bittornado
466
 	chroot "$rootdir" pip install msgpack-python --upgrade
495
 	chroot "$rootdir" pip install msgpack-python --upgrade
535
 function mesh_zeronet_blog {
564
 function mesh_zeronet_blog {
536
 	ZERONET_BLOG_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_BLOG_REPO=" | head -n 1 | awk -F '"' '{print $2}')
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
 	ZERONET_BLOG_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_BLOG_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
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
 	git clone $ZERONET_BLOG_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroBlog
576
 	git clone $ZERONET_BLOG_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroBlog
540
 	if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroBlog ]; then
577
 	if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroBlog ]; then
549
 function mesh_zeronet_mail {
586
 function mesh_zeronet_mail {
550
 	ZERONET_MAIL_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_MAIL_REPO=" | head -n 1 | awk -F '"' '{print $2}')
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
 	ZERONET_MAIL_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_MAIL_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
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
 	git clone $ZERONET_MAIL_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroMail
598
 	git clone $ZERONET_MAIL_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroMail
554
 	if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroMail ]; then
599
 	if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroMail ]; then
563
 function mesh_zeronet_forum {
608
 function mesh_zeronet_forum {
564
 	ZERONET_FORUM_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_FORUM_REPO=" | head -n 1 | awk -F '"' '{print $2}')
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
 	ZERONET_FORUM_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_FORUM_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
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
 	git clone $ZERONET_FORUM_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroTalk
620
 	git clone $ZERONET_FORUM_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroTalk
568
 	if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroTalk ]; then
621
 	if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroTalk ]; then
577
 function mesh_zeronet_id {
630
 function mesh_zeronet_id {
578
 	ZERONET_ID_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_ID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
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
 	ZERONET_ID_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_ID_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
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
 	git clone $ZERONET_ID_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroID
642
 	git clone $ZERONET_ID_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroID
582
 	if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroID ]; then
643
 	if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroID ]; then