Guest User

berkeleydb4.8 install

a guest
Apr 17th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mydir="/home/jm/lfs"
  2. mycores="-j4"
  3. set -euf -o pipefail   #  https://sipb.mit.edu/doc/safe-shell/     safe scripting tutorial
  4.  
  5. function createLFS() {
  6. echo "into lfs"
  7.  ! [ -d "$mydir" ] &&  mkdir "$mydir"
  8. echo "tracing error"
  9. }
  10.  
  11. function build_nasm
  12. {
  13.     cd "$mydir"
  14.     wget -nc http://www.nasm.us/pub/nasm/releasebuilds/2.13.01/nasm-2.13.01.tar.bz2
  15.     if ! [ -d "$mydir/nasm-2.13.01" ]; then
  16.       tar xjvf nasm-2.13.01.tar.bz2
  17.     fi
  18.     cd nasm-2.13.01
  19.     ./configure
  20.     make "$mycores"
  21.     sudo make install
  22. }
  23. #################################
  24. function build_yasm
  25. {
  26.     cd "$mydir"
  27.     wget -nc http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
  28.     if ! [ -d "$mydir/yasm-1.3.0" ]; then
  29.       echo "yasm no exist"
  30.       tar xzvf yasm-1.3.0.tar.gz
  31.     fi
  32.     cd yasm-1.3.0
  33.     ./configure &&  make "$mycores" &&  sudo make install
  34. }
  35.  
  36.  
  37. ##############################
  38. ##############################
  39. function build_texinfo6
  40. {
  41. cd "$mydir"
  42. wget -nc ftp://ftp.gnu.org/gnu/texinfo/texinfo-6.5.tar.gz
  43. if ! [ -d "$mydir/texinfo-6.5" ]; then
  44.   tar zxvf texinfo-6.5.tar.gz
  45. fi
  46. cd texinfo-6.5
  47. ./configure
  48. make "$mycores" && sudo make install
  49. }
  50.  
  51.  
  52. ##############################
  53. function build_libff
  54. {
  55. cd "$mydir"
  56. echo "installing  libff"
  57. if ! [ -d "$mydir/libff" ]; then
  58.  git clone --recursive https://github.com/scipr-lab/libff.git
  59.  cd libff && mkdir build
  60.  cd build
  61.  cmake ..
  62.  make -j4
  63.  sudo make install
  64. else
  65.  cd libff && sudo rm -rf build
  66.  git pull
  67.  mkdir build && cd build
  68.  cmake ..
  69.  make -j4
  70.  sudo make install
  71. fi
  72. }
  73. ######################################
  74. ######################################
  75.  
  76.  
  77. ######## download and pull github repos only #####
  78. function downloadreposonly {
  79. if ! [ -d "$mydir" ]; then
  80.    mkdir -p "$mydir"
  81. fi
  82. cd "$mydir"
  83. git clone --recursive https://github.com/scipr-lab/libff.git
  84. git clone --recursive https://gitlab.com/procps-ng/procps.git
  85. git clone --recursive git://git.savannah.gnu.org/libtool.git
  86. git clone --recursive https://github.com/scipr-lab/libsnark
  87. git clone --recursive https://github.com/fukuchi/libqrencode.git
  88. wget -nc https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/help2man/help2man-1.43.3.tar.gz
  89. wget -nc https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2
  90. }
  91. ##################################################
  92.  
  93.  
  94. ################################
  95. ##### HUSH COIN ####
  96. function build_help2man {
  97. cd "$mydir"
  98. wget -nc https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/help2man/help2man-1.43.3.tar.gz
  99. if ! [ -d "$mydir/help2man-1.43.3" ]; then
  100.      tar zxvf help2man-1.43.3.tar.gz
  101. fi
  102. cd help2man-1.43.3
  103. ./configure && make "$mycores" && sudo make install
  104. cd ..
  105. }
  106. ############################################
  107.  
  108. function build_procps
  109. {
  110.     cd "$mydir"
  111.     echo "procps build"
  112.     if ! [ -d "$mydir/procps" ]; then
  113.       git clone --recursive https://gitlab.com/procps-ng/procps.git
  114.       cd procps && ./autogen.sh
  115.       ./configure &&  make "$mycores"
  116.       sudo make install
  117.     else
  118.      cd procps && git pull
  119.      ./autogen.sh
  120.      echo "on ubuntu error, does not accept the ncurses installed"
  121.      ./configure --without-ncurses  &&  make "$mycores"
  122.     sudo make install
  123.     fi
  124. }
  125. #########################
  126. function build_libqrencode {
  127. cd "$mydir"
  128. if ! [ -d "$mydir/libqrencode" ];then
  129.   git clone --recursive https://github.com/fukuchi/libqrencode.git
  130. fi
  131. cd libqrencode && ./autogen.sh
  132. ./configure --enable-static && make "$mycores"
  133. sudo make install && sudo ldconfig
  134. }
  135. ##########
  136.  
  137. function libtool
  138. {
  139.     cd "$mydir"
  140.     if ! [ -d "$mydir/libtool" ]; then
  141.       git clone --recursive git://git.savannah.gnu.org/libtool.git
  142.     fi
  143.     cd libtool
  144.    ./bootstrap
  145.    ./configure &&  make "$mycores"
  146.     sudo make install
  147. }
  148. #################################
  149. function build_gmp
  150. {  
  151.     cd "$mydir"
  152.     wget -nc https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2
  153.     if ! [ -d "$mydir/gmp-6.1.2" ]; then
  154.       tar xjvf gmp-6.1.2.tar.bz2
  155.     fi
  156.     cd gmp-6.1.2
  157.    # ./autogen.sh
  158.     ./configure &&  make "$mycores"
  159.     sudo make install
  160. }
  161.  
  162.  
  163. function libsnarkdirect {
  164. echo 'Hunting for libsnark include directory...'
  165. LIBSNARK_INCDIR="$(echo "$CPPFLAGS" | sed 's,^.*-I\([^ ]*/include\).*$,\1/libsnark,')"
  166. if test -d "$LIBSNARK_INCDIR"; then
  167.    echo "Found libsnark include directory: $LIBSNARK_INCDIR"
  168. fi
  169. }
  170.  
  171.  
  172. ########################################
  173. function build_berkeleydb48() {
  174. cd "$mydir"
  175. if ! [ -d "$mydir/db-4.8.30" ]; then
  176.   wget -nc http://download.oracle.com/berkeley-db/db-4.8.30.tar.gz
  177.   tar zxvf db-4.8.30.tar.gz
  178. fi
  179. cd db-4.8.30
  180. cd build_unix        
  181. ../dist/configure --prefix=/usr   --enable-compat185  --enable-static  --enable-cxx      
  182. make -j4 && sudo make install
  183. sudo make docdir=/usr/share/doc/db-4.8.30 install
  184. sudo chown -v -R root:root  /usr/bin/db_*   /usr/include/db{,_185,_cxx}.h   /usr/lib/libdb*.{so,la}   /usr/share/doc/db-4.8.30
  185. }
  186. echo " try and see what is going on"
  187.  
  188. #################################
  189. function build_libsodium {
  190. ###   https://download.libsodium.org/doc/
  191. cd "$mydir"
  192. git clone --recursive https://github.com/jedisct1/libsodium.git
  193. cd libsodium
  194. ./autogen.sh
  195. ./configure --enable-static && make -j4
  196. sudo make install
  197. }
  198.  
  199.  
  200. ##############################
  201. function build_zcash() {
  202. echo "zcash"
  203. ###   https://download.libsodium.org/doc/
  204. cd "$mydir"
  205. if ! [ -d "$mydir/zcash" ];then
  206.  echo "this is my zcash"
  207.  git clone --recursive https://github.com/zcash/zcash.git
  208.  cd zcash && cd zcutil
  209.  ./build.sh -j4
  210.  ./fetch-params.sh
  211. else
  212.  cd zcash
  213.  git pull
  214.  cd zcutil
  215.  ./build.sh -j4
  216.  ./fetch-params.sh
  217. fi
  218. }
  219.  
  220.  
  221.  
  222. ###################
  223. function build_qpidproton() {
  224. cd "$mydir"
  225. if ! [ -d "$mydir/qpid-proton" ]; then
  226.  git clone --recursive https://github.com/apache/qpid-proton.git
  227.  cd qpid-proton && mkdir build
  228.  cd build && cmake ..
  229.  sudo make -j4 && sudo make install
  230. else
  231.  cd qpid-proton && rm -rf build
  232.  mkdir build
  233.  cd build && cmake ..
  234.  make -j4 && sudo make install
  235.  sudo ldconfig
  236. fi
  237. }
  238.  
  239.  
  240. function build_libsnark {
  241. echo "BOOST is dependency"
  242. cd "$mydir"
  243. if ! [ -d "$mydir/libsnark" ];then
  244.  git clone --recursive https://github.com/scipr-lab/libsnark
  245.  cd libsnark && mkdir build
  246.  cd build && cmake ..
  247.  make -j4 && sudo make install
  248. else
  249.  cd libsnark
  250.  [ -d "$mydir/libsnark/build" ] && rm -rf build
  251.  mkdir build
  252.  cd build && cmake ..
  253.  make -j4 && sudo make install
  254. fi
  255. }
  256.  
  257.  
  258. function build_Boost {
  259. echo "building BOOST"
  260. cd "$mydir"
  261. if ! [ -d "$mydir/build" ];then
  262.  git clone --recursive https://github.com/boostorg/build.git
  263.  cd build
  264.  sudo ./bootstrap.sh
  265.  sudo ./b2 install
  266. else
  267.  cd build
  268.  sudo ./bootstrap.sh
  269.  sudo ./b2 install
  270. fi
  271. }
  272.  
  273. function build_zencash {
  274. cd "$mydir"
  275. echo " Run   ./src/zend"
  276. echo "DO NOT RUN AS ROOT   https://github.com/zcash/zcash/issues/2304"
  277. echo " second last line of build.sh script comment out    -Werror -g "  
  278. #exit
  279. if ! [ -d "$mydir/zen" ]; then
  280.  git clone --recursive https://github.com/ZencashOfficial/zen.git
  281.  cd zen && cd zcutil
  282.  ./build.sh -j4
  283.  ./fetch-params.sh
  284. else
  285.  echo "doing git pull on zencash"
  286.  cd zen
  287.  git pull && cd zcutil
  288.  ./build.sh -j4
  289.  ./fetch-params.sh
  290. fi
  291. }
  292.  
  293.  
  294. function build_zcashclassic {
  295. cd "$mydir"
  296. echo " Run   ./src/zend"
  297. echo "remove wget flag second last line if compile fails ....  build.sh"
  298. echo "DO NOT RUN AS ROOT   https://github.com/zcash/zcash/issues/2304"
  299. echo " second last line of build.sh script comment out    -Werror -g "  
  300. #exit
  301. if ! [ -d "$mydir/zclassic" ]; then
  302.  git clone --recursive https://github.com/z-classic/zclassic.git
  303.  cd zclassic && cd zcutil
  304.  ./build.sh -j4
  305.  ./fetch-params.sh
  306. else
  307.  echo "doing git pull on zcash classic"
  308.  cd zclassic
  309.  git pull && cd zcutil
  310.  ./build.sh -j4
  311.  ./fetch-params.sh
  312. fi
  313. }
  314.  
  315.  
  316.  
  317. function build_gobyte {
  318. cd "$mydir"
  319. echo "gobyte compile "; echo "install the berkeleydb 4.8 first"
  320. if ! [ -d "$mydir/gobyte" ]; then
  321.   git clone --recursive https://github.com/gobytecoin/gobyte.git
  322.   cd gobyte
  323.  ./autogen.sh && ./configure           # leave qt5 out of this   --with-gui=qt5
  324.  
  325.  make "$mycores" && sudo make install
  326. else
  327.   cd gobyte
  328.   git pull && make clean
  329.  ./autogen.sh && ./configure
  330.  make "$mycores" && sudo make install
  331. fi
  332. }
  333.  
  334.  
  335. function build_linuxGpuMining {
  336. cd "$mydir"
  337. if ! [ -d "$mydir/linux_gpu_mining" ]; then
  338.    git clone https://github.com/createthis/linux_gpu_mining.git
  339.    cd linux_gpu_mining
  340. fi
  341. }
  342.  
  343.  
  344. function build_ewbfminer {
  345. cd "$mydir"
  346. if ! [ -d "$mydir/v0.3.34b" ]; then
  347.    wget -nc https://github.com/nanopool/ewbf-miner/archive/v0.3.4b.tar.gz
  348.    tar zxvf ewbf-miner-0.3.4b.tar.gz
  349.    cd ewbf-miner-0.3.4b
  350.    echo "ewbf miner downloaded to lfs folder"
  351.    echo "don't run the undervoltage script!"
  352. fi
  353. }
  354.  
  355. function build_zclassicGuiWallet {
  356. cd "$mydir"
  357. if ! [ -d "$mydir/v0.3.34b" ]; then
  358.    git clone https://github.com/z-classic/zclassic-swing-wallet-ui.git
  359.    cd zclassic-swing-wallet-ui
  360.    echo "zclassic gui"
  361. fi
  362. }
  363.  
  364. function build_nheqminer {
  365. cd "$mydir"
  366. if ! [ -d "$mydir/v0.3.34b" ]; then
  367.    git clone https://github.com/ocminer/nheqminer
  368.    cd nheqminer
  369.    echo "zclassic gui"
  370. fi
  371. }
  372.  
  373.  
  374. function c2man {
  375. # fribidi deps
  376. # http://nixdoc.net/man-pages/linux/man1/c2man.1.html
  377. cd "$mydir"
  378. #sudo apt-get install byacc flex
  379. if [ ! -d "$mydir/c2man-2.41-18" ]; then
  380.  wget -nc https://answers.launchpad.net/ubuntu/+archive/primary/+files/c2man_2.41.orig.tar.gz
  381.  tar -xf c2man_2.41.orig.tar.gz
  382.  mv c2man-2.41.orig c2man-2.41-18  
  383.  cd c2man-2.41-18
  384. # zcat c2man_2.41-18.diff.gz| patch -p1
  385.  ./Configure -d
  386.  make && sudo make install
  387. else
  388.  cd c2man-2.41-18
  389.  # zcat c2man_2.41-18.diff.gz| patch -p1
  390.  ./Configure -d
  391.  make && sudo make install
  392. fi
  393. }
  394.  
  395.  
  396.  
  397. function buildFribidi {
  398. cd "$mydir"
  399. if [ ! -d "$mydir/fribidi" ]; then
  400.  git clone --recursive https://github.com/fribidi/fribidi.git
  401.  cd fribidi
  402.  ./bootstrap && ./configure
  403.  make -j4 && sudo make install
  404. else
  405.  cd fribidi
  406.  git pull
  407.  ./bootstrap && ./configure
  408.  make -j4 && sudo make install
  409. fi
  410.  
  411.  
  412.  
  413. }
  414.  
  415. function mpvBuild {
  416. #depends on fribidi
  417. cd "$mydir"
  418.  
  419. if [ ! -d "$mydir/mpv-build" ]; then
  420.  git clone --recursive https://github.com/mpv-player/mpv-build.git
  421.  cd mpv-build
  422.  ./rebuild -j4
  423.  sudo install
  424. else
  425.  cd mpv-build
  426.  git pull
  427.  ./rebuild -j4
  428.  sudo ./install
  429. fi
  430. }
  431.  
  432. function etcherinstall {
  433. cd "$mydir"
  434. if [ ! -d "$mydir/etcher" ]; then
  435.  git clone https://github.com/resin-io/etcher.git
  436.  cd etcher
  437. else
  438.  cd etcher
  439. fi
  440. }
  441.  
  442.  
  443.  
  444. function jqinstall {
  445. # https://stedolan.github.io/jq/
  446. # jq is like sed for JSON data - you can use it to slice and filter and map and transform structured data with the same ease that sed, awk,
  447. # grep and friends let you play with text
  448. cd "$mydir"
  449. if [ ! -d "$mydir/jq" ]; then
  450.  git clone https://github.com/stedolan/jq.git
  451.  cd jq
  452.  autoreconf -i
  453.  ./configure --disable-maintainer-mode
  454.  make && sudo make install
  455. else
  456.  cd jq
  457.  git pull
  458.  autoreconf -i
  459.  ./configure --disable-maintainer-mode
  460.  make &&  sudo make install
  461. fi
  462. }
  463.  
  464.  
  465.  
  466.  
  467. #libsnarkdirect
  468. # build_linuxGpuMining
  469. # :<<'removeme'
  470.  
  471. function install_deb_packages() {
  472. # sudo apt install -y  qtbase5-dev openssh-server #don't install as gobyte will compile with it.
  473. sudo apt install -y gedit vim ssh gparted libonig-dev
  474. sudo apt install -y rar unrar p7zip p7zip-full
  475. sudo apt install -y  libtool cmake libprocps4-dev autoconf
  476. sudo apt install -y  autopoint  libboost-all-dev  libevent-dev build-essential
  477. sudo apt install -y  pkg-config libc6-dev m4 g++-multilib
  478. sudo apt install -y  autoconf libtool ncurses-dev unzip git python
  479. sudo apt install -y  zlib1g-dev wget bsdmainutils automake  byacc flex  
  480. sudo apt install -y  libcurl4-openssl-dev libssl-dev libjansson-dev automake autotools-dev build-essential
  481. sudo apt install -y  libncurses5-dev libncursesw5-dev
  482. }
  483.  
  484.  
  485. function ccminer_build() {
  486. # https://www.reddit.com/r/MoneroMining/comments/6lhbmw/old_problem_with_ccminer/
  487. echo "USE kernel v4.4-wily to compile ont btc+ asrock mining boards, about the only board that multi gpu works with"
  488. echo " /usr/local/cuda-8.0/bin  must be in PATH under .profile in home directory. "
  489. echo "  if you have cuda 8 and 9 , make a symbolic link for nvcc or set cuda path (run  ./configure --help)  "
  490. echo "  type     "which nvcc"     and symlink to it. "
  491. echo " https://github.com/tpruvot/ccminer/blob/linux/INSTALL    COMPILE With  gcc5  "
  492. echo " run   which gcc     to get the gcc compiler used at present. "
  493. echo " set the correct ARCH flag for gtx1070 (61) in the file  Makefile.am"
  494. echo "see  https://github.com/tpruvot/ccminer/wiki/Compatibility   for details gtx1060,70,80 the line with 61 is uncommented"
  495. echo " https://github.com/tpruvot/ccminer/blob/linux/INSTALL    COMPILE With  gcc5 "
  496. echo "edit this script and remove the exit1 below this line after the ARCH flags are set"
  497. exit 1
  498. cd "$mydir"
  499. if [ ! -d "$mydir/ccminer" ]; then
  500.  git clone https://github.com/tpruvot/ccminer.git
  501.  cd ccminer
  502.  ./autogen.sh
  503.  ./configure --with-cuda=/usr/local/cuda-8.0  #for cuda 8
  504.  ## ./configure --with-cuda=/usr/local/cuda-9.0  #for cuda 9
  505.  make && sudo make install
  506. else
  507.  cd ccminer
  508.  git pull && make clean
  509.  ./autogen.sh
  510.  ./configure --with-cuda=/usr/local/cuda-8.0  #for cuda 8
  511.   make &&  sudo make install
  512. fi
  513. }
  514.  
  515. ######################
  516. ######################
  517. ### # sudo pacman -S boost manjaro
  518. ####  comments remove    ####
  519. echo "for some reason script exists after doing debs install"
  520. install_deb_packages
  521. echo "build "
  522. createLFS
  523. echo "build yasm"
  524. build_yasm
  525. build_nasm
  526. build_texinfo6
  527. #######    #downloadreposonly
  528. build_help2man
  529. jqinstall
  530. #### libtool
  531. # build_Boost   #not detected by many packages if instlalled from source. Use apt get
  532. #build_berkeleydb48
  533. echo "not executing gmp exits scripthere for some reason"
  534. echo "get status of variable"
  535. build_gmp
  536. build_libff
  537. build_procps
  538. build_libqrencode
  539. #build_libsodium
  540. build_qpidproton
  541. #####build_libsnark  #can't get to compile
  542. #removeme
  543. build_zcash
  544. build_zencash  
  545. build_zcashclassic
  546. build_gobyte  
  547. #ccminer_build
  548. #####build_ewbfminer
  549. ### build_zclassicGuiWallet
  550. ## build_nheqminer
  551. # removeme
  552. #c2man  #fribidi depends
  553. #buildFribidi  #mpvBuild depends
  554. #etcherinstall
  555. #mpvBuild
  556. # https://pastebin.com/4AW3mBv6
  557. # raspberry
  558. # 192.168.1.19/24
  559. # dns server 196.22.218.248
Add Comment
Please, Sign In to add comment