build.sh 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #!/bin/bash
  2. Version=1.0
  3. Release=01/Jan/2021
  4. author=wareck@gmail.com
  5. Boost_v=1_67_0
  6. DB_v=4.8.30 # can be 4.8.30.NC or 4.8.30
  7. Miniupnpc_v=2.1
  8. echo -e "\n\e[95mSystem Check:\e[0m"
  9. update_me=0
  10. ntp_i=""
  11. pv_i=""
  12. gcc_i=""
  13. xz_i=""
  14. pixz_i=""
  15. pwgen_i=""
  16. xz_i=""
  17. zram_i=""
  18. swap_i=""
  19. echo -e -n "Check PV installed : "
  20. if ! [ -x "$(command -v pv)" ];then echo -e "[\e[91m NO \e[0m]" && pv_i="pv" && update_me=1;else echo -e "[\e[92m OK \e[0m]";fi
  21. echo -e -n "Check NTP installed : "
  22. if ! [ -x "$(command -v ntpd)" ];then echo -e "[\e[91m NO \e[0m]" && ntp_i="ntp" && update_me=1;else echo -e "[\e[92m OK \e[0m]";fi
  23. echo -e -n "Check PIXZ installed : "
  24. if ! [ -x "$(command -v pixz)" ];then echo -e "[\e[91m NO \e[0m]" && pixz_i="pixz libbz2-dev liblzma-dev libzip-dev zlib1g-dev" && update_me=1;else echo -e "[\e[92m OK \e[0m]";fi
  25. echo -e -n "Check PWGEN installed : "
  26. if ! [ -x "$(command -v pwgen)" ];then echo -e "[\e[91m NO \e[0m]" && pwgen_i="pwgen" && update_me=1;else echo -e "[\e[92m OK \e[0m]";fi
  27. if ! [ -x "$(command -v htop)" ];then htop_i="htop" && update_me=1;fi
  28. if [ $update_me = 1 ]
  29. then
  30. echo -e "\n\e[95mRaspberry update:\e[0m"
  31. sudo apt-get update
  32. sudo apt-get install aptitude -y
  33. sudo apt install pv python-dev build-essential $htop_i $ntp_i $pwgen_i $pixz_i $zram_i $swap_i -y
  34. sudo apt install libevent-dev libssl-dev autogen autoconf libtool pkg-config -y
  35. sudo sed -i -e "s/# set const/set const/g" /etc/nanorc
  36. fi
  37. echo -e "\n\e[95mDownload/Expand Boost Library:\e[0m"
  38. if ! [ -d $MyDir/boost_$Boost_v ]
  39. then
  40. wget -c -q --show-progress http://wareck.free.fr/crypto/okcash/boost_$Boost_v.tar.xz
  41. tar xfJ boost_$Boost_v.tar.xz --checkpoint=.500
  42. fi
  43. echo -e "Done."
  44. echo -e "\n\e[95mDonwload/Expand Miniupnpc Library:\e[0m"
  45. if ! [ -d $MyDir/miniupnpc-$Miniupnpc_v ]
  46. then
  47. wget -c -q --show-progress http://wareck.free.fr/crypto/okcash/miniupnpc-$Miniupnpc_v.tar.xz
  48. tar xfJ miniupnpc-$Miniupnpc_v.tar.xz --checkpoint=.1
  49. fi
  50. echo -e "Done."
  51. echo -e "\n\e[95mDownload/Expand db-4.8.30.NC Library:\e[0m"
  52. if ! [ -d $MyDir/db-$DB_v ]
  53. then
  54. wget -c -q --show-progress http://wareck.free.fr/crypto/okcash/db-$DB_v.tar.xz
  55. tar xfJ db-$DB_v.tar.xz --checkpoint=.100
  56. fi
  57. echo -e "Done."
  58. echo -e "\n\e[95mDownload OkCash $OKcash_v Source Code:\e[0m"
  59. git clone https://github.com/Bitcoin-ABC/secp256k1.git
  60. #git clone https://github.com/litecoincash-project/litecoincash.git
  61. echo -e "Done."
  62. echo -e "\n\e[95mBuild DB-$DB_v:\e[0m"
  63. if [ -f /usr/share/man/man3/miniupnpc.3.gz ]; then sudo rm /usr/share/man/man3/miniupnpc.3.gz; fi
  64. cd db-$DB_v
  65. cd build_unix
  66. ../dist/configure --enable-cxx
  67. make -j$(nproc)
  68. sudo make install
  69. sudo ln -s /usr/local/BerkeleyDB.4.8/lib/libdb_cxx-4.8.so /usr/lib/ || true
  70. cd .. && cd ..
  71. echo -e "\n\e[95mBuild Boost $Boost_v:\e[0m"
  72. cd boost_$Boost_v
  73. ./bootstrap.sh
  74. sudo ./b2 --with-chrono --with-filesystem --with-program_options --with-system --with-thread --with-timer --with-test toolset=gcc variant=release link=static threading=multi runtime-link=static install
  75. cd ..
  76. echo -e "\n\e[95mBuild miniupnpc $Miniupnpc_v:\e[0m"
  77. cd miniupnpc-$Miniupnpc_v
  78. make -j$(nproc)
  79. sudo make install
  80. cd ..
  81. export CPATH="/usr/local/BerkeleyDB.4.8/include"
  82. export LIBRARY_PATH="/usr/local/BerkeleyDB.4.8/lib"
  83. cd secp256k1
  84. ./autogen.sh
  85. ./configure
  86. make
  87. sudo make install
  88. cd ..
  89. cd litecoincash
  90. ./autogen.sh
  91. ./configure CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768" --disable-tests --disable-bench --disable-gui-test
  92. make
  93. sudo make install