Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mydir="/home/jm/lfs"
- mycores="-j4"
- set -euf -o pipefail # https://sipb.mit.edu/doc/safe-shell/ safe scripting tutorial
- function createLFS() {
- echo "into lfs"
- ! [ -d "$mydir" ] && mkdir "$mydir"
- echo "tracing error"
- }
- function build_nasm
- {
- cd "$mydir"
- wget -nc http://www.nasm.us/pub/nasm/releasebuilds/2.13.01/nasm-2.13.01.tar.bz2
- if ! [ -d "$mydir/nasm-2.13.01" ]; then
- tar xjvf nasm-2.13.01.tar.bz2
- fi
- cd nasm-2.13.01
- ./configure
- make "$mycores"
- sudo make install
- }
- #################################
- function build_yasm
- {
- cd "$mydir"
- wget -nc http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
- if ! [ -d "$mydir/yasm-1.3.0" ]; then
- echo "yasm no exist"
- tar xzvf yasm-1.3.0.tar.gz
- fi
- cd yasm-1.3.0
- ./configure && make "$mycores" && sudo make install
- }
- ##############################
- ##############################
- function build_texinfo6
- {
- cd "$mydir"
- wget -nc ftp://ftp.gnu.org/gnu/texinfo/texinfo-6.5.tar.gz
- if ! [ -d "$mydir/texinfo-6.5" ]; then
- tar zxvf texinfo-6.5.tar.gz
- fi
- cd texinfo-6.5
- ./configure
- make "$mycores" && sudo make install
- }
- ##############################
- function build_libff
- {
- cd "$mydir"
- echo "installing libff"
- if ! [ -d "$mydir/libff" ]; then
- git clone --recursive https://github.com/scipr-lab/libff.git
- cd libff && mkdir build
- cd build
- cmake ..
- make -j4
- sudo make install
- else
- cd libff && sudo rm -rf build
- git pull
- mkdir build && cd build
- cmake ..
- make -j4
- sudo make install
- fi
- }
- ######################################
- ######################################
- ######## download and pull github repos only #####
- function downloadreposonly {
- if ! [ -d "$mydir" ]; then
- mkdir -p "$mydir"
- fi
- cd "$mydir"
- git clone --recursive https://github.com/scipr-lab/libff.git
- git clone --recursive https://gitlab.com/procps-ng/procps.git
- git clone --recursive git://git.savannah.gnu.org/libtool.git
- git clone --recursive https://github.com/scipr-lab/libsnark
- git clone --recursive https://github.com/fukuchi/libqrencode.git
- wget -nc https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/help2man/help2man-1.43.3.tar.gz
- wget -nc https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2
- }
- ##################################################
- ################################
- ##### HUSH COIN ####
- function build_help2man {
- cd "$mydir"
- wget -nc https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/help2man/help2man-1.43.3.tar.gz
- if ! [ -d "$mydir/help2man-1.43.3" ]; then
- tar zxvf help2man-1.43.3.tar.gz
- fi
- cd help2man-1.43.3
- ./configure && make "$mycores" && sudo make install
- cd ..
- }
- ############################################
- function build_procps
- {
- cd "$mydir"
- echo "procps build"
- if ! [ -d "$mydir/procps" ]; then
- git clone --recursive https://gitlab.com/procps-ng/procps.git
- cd procps && ./autogen.sh
- ./configure && make "$mycores"
- sudo make install
- else
- cd procps && git pull
- ./autogen.sh
- echo "on ubuntu error, does not accept the ncurses installed"
- ./configure --without-ncurses && make "$mycores"
- sudo make install
- fi
- }
- #########################
- function build_libqrencode {
- cd "$mydir"
- if ! [ -d "$mydir/libqrencode" ];then
- git clone --recursive https://github.com/fukuchi/libqrencode.git
- fi
- cd libqrencode && ./autogen.sh
- ./configure --enable-static && make "$mycores"
- sudo make install && sudo ldconfig
- }
- ##########
- function libtool
- {
- cd "$mydir"
- if ! [ -d "$mydir/libtool" ]; then
- git clone --recursive git://git.savannah.gnu.org/libtool.git
- fi
- cd libtool
- ./bootstrap
- ./configure && make "$mycores"
- sudo make install
- }
- #################################
- function build_gmp
- {
- cd "$mydir"
- wget -nc https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2
- if ! [ -d "$mydir/gmp-6.1.2" ]; then
- tar xjvf gmp-6.1.2.tar.bz2
- fi
- cd gmp-6.1.2
- # ./autogen.sh
- ./configure && make "$mycores"
- sudo make install
- }
- function libsnarkdirect {
- echo 'Hunting for libsnark include directory...'
- LIBSNARK_INCDIR="$(echo "$CPPFLAGS" | sed 's,^.*-I\([^ ]*/include\).*$,\1/libsnark,')"
- if test -d "$LIBSNARK_INCDIR"; then
- echo "Found libsnark include directory: $LIBSNARK_INCDIR"
- fi
- }
- ########################################
- function build_berkeleydb48() {
- cd "$mydir"
- if ! [ -d "$mydir/db-4.8.30" ]; then
- wget -nc http://download.oracle.com/berkeley-db/db-4.8.30.tar.gz
- tar zxvf db-4.8.30.tar.gz
- fi
- cd db-4.8.30
- cd build_unix
- ../dist/configure --prefix=/usr --enable-compat185 --enable-static --enable-cxx
- make -j4 && sudo make install
- sudo make docdir=/usr/share/doc/db-4.8.30 install
- 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
- }
- echo " try and see what is going on"
- #################################
- function build_libsodium {
- ### https://download.libsodium.org/doc/
- cd "$mydir"
- git clone --recursive https://github.com/jedisct1/libsodium.git
- cd libsodium
- ./autogen.sh
- ./configure --enable-static && make -j4
- sudo make install
- }
- ##############################
- function build_zcash() {
- echo "zcash"
- ### https://download.libsodium.org/doc/
- cd "$mydir"
- if ! [ -d "$mydir/zcash" ];then
- echo "this is my zcash"
- git clone --recursive https://github.com/zcash/zcash.git
- cd zcash && cd zcutil
- ./build.sh -j4
- ./fetch-params.sh
- else
- cd zcash
- git pull
- cd zcutil
- ./build.sh -j4
- ./fetch-params.sh
- fi
- }
- ###################
- function build_qpidproton() {
- cd "$mydir"
- if ! [ -d "$mydir/qpid-proton" ]; then
- git clone --recursive https://github.com/apache/qpid-proton.git
- cd qpid-proton && mkdir build
- cd build && cmake ..
- sudo make -j4 && sudo make install
- else
- cd qpid-proton && rm -rf build
- mkdir build
- cd build && cmake ..
- make -j4 && sudo make install
- sudo ldconfig
- fi
- }
- function build_libsnark {
- echo "BOOST is dependency"
- cd "$mydir"
- if ! [ -d "$mydir/libsnark" ];then
- git clone --recursive https://github.com/scipr-lab/libsnark
- cd libsnark && mkdir build
- cd build && cmake ..
- make -j4 && sudo make install
- else
- cd libsnark
- [ -d "$mydir/libsnark/build" ] && rm -rf build
- mkdir build
- cd build && cmake ..
- make -j4 && sudo make install
- fi
- }
- function build_Boost {
- echo "building BOOST"
- cd "$mydir"
- if ! [ -d "$mydir/build" ];then
- git clone --recursive https://github.com/boostorg/build.git
- cd build
- sudo ./bootstrap.sh
- sudo ./b2 install
- else
- cd build
- sudo ./bootstrap.sh
- sudo ./b2 install
- fi
- }
- function build_zencash {
- cd "$mydir"
- echo " Run ./src/zend"
- echo "DO NOT RUN AS ROOT https://github.com/zcash/zcash/issues/2304"
- echo " second last line of build.sh script comment out -Werror -g "
- #exit
- if ! [ -d "$mydir/zen" ]; then
- git clone --recursive https://github.com/ZencashOfficial/zen.git
- cd zen && cd zcutil
- ./build.sh -j4
- ./fetch-params.sh
- else
- echo "doing git pull on zencash"
- cd zen
- git pull && cd zcutil
- ./build.sh -j4
- ./fetch-params.sh
- fi
- }
- function build_zcashclassic {
- cd "$mydir"
- echo " Run ./src/zend"
- echo "remove wget flag second last line if compile fails .... build.sh"
- echo "DO NOT RUN AS ROOT https://github.com/zcash/zcash/issues/2304"
- echo " second last line of build.sh script comment out -Werror -g "
- #exit
- if ! [ -d "$mydir/zclassic" ]; then
- git clone --recursive https://github.com/z-classic/zclassic.git
- cd zclassic && cd zcutil
- ./build.sh -j4
- ./fetch-params.sh
- else
- echo "doing git pull on zcash classic"
- cd zclassic
- git pull && cd zcutil
- ./build.sh -j4
- ./fetch-params.sh
- fi
- }
- function build_gobyte {
- cd "$mydir"
- echo "gobyte compile "; echo "install the berkeleydb 4.8 first"
- if ! [ -d "$mydir/gobyte" ]; then
- git clone --recursive https://github.com/gobytecoin/gobyte.git
- cd gobyte
- ./autogen.sh && ./configure # leave qt5 out of this --with-gui=qt5
- make "$mycores" && sudo make install
- else
- cd gobyte
- git pull && make clean
- ./autogen.sh && ./configure
- make "$mycores" && sudo make install
- fi
- }
- function build_linuxGpuMining {
- cd "$mydir"
- if ! [ -d "$mydir/linux_gpu_mining" ]; then
- git clone https://github.com/createthis/linux_gpu_mining.git
- cd linux_gpu_mining
- fi
- }
- function build_ewbfminer {
- cd "$mydir"
- if ! [ -d "$mydir/v0.3.34b" ]; then
- wget -nc https://github.com/nanopool/ewbf-miner/archive/v0.3.4b.tar.gz
- tar zxvf ewbf-miner-0.3.4b.tar.gz
- cd ewbf-miner-0.3.4b
- echo "ewbf miner downloaded to lfs folder"
- echo "don't run the undervoltage script!"
- fi
- }
- function build_zclassicGuiWallet {
- cd "$mydir"
- if ! [ -d "$mydir/v0.3.34b" ]; then
- git clone https://github.com/z-classic/zclassic-swing-wallet-ui.git
- cd zclassic-swing-wallet-ui
- echo "zclassic gui"
- fi
- }
- function build_nheqminer {
- cd "$mydir"
- if ! [ -d "$mydir/v0.3.34b" ]; then
- git clone https://github.com/ocminer/nheqminer
- cd nheqminer
- echo "zclassic gui"
- fi
- }
- function c2man {
- # fribidi deps
- # http://nixdoc.net/man-pages/linux/man1/c2man.1.html
- cd "$mydir"
- #sudo apt-get install byacc flex
- if [ ! -d "$mydir/c2man-2.41-18" ]; then
- wget -nc https://answers.launchpad.net/ubuntu/+archive/primary/+files/c2man_2.41.orig.tar.gz
- tar -xf c2man_2.41.orig.tar.gz
- mv c2man-2.41.orig c2man-2.41-18
- cd c2man-2.41-18
- # zcat c2man_2.41-18.diff.gz| patch -p1
- ./Configure -d
- make && sudo make install
- else
- cd c2man-2.41-18
- # zcat c2man_2.41-18.diff.gz| patch -p1
- ./Configure -d
- make && sudo make install
- fi
- }
- function buildFribidi {
- cd "$mydir"
- if [ ! -d "$mydir/fribidi" ]; then
- git clone --recursive https://github.com/fribidi/fribidi.git
- cd fribidi
- ./bootstrap && ./configure
- make -j4 && sudo make install
- else
- cd fribidi
- git pull
- ./bootstrap && ./configure
- make -j4 && sudo make install
- fi
- }
- function mpvBuild {
- #depends on fribidi
- cd "$mydir"
- if [ ! -d "$mydir/mpv-build" ]; then
- git clone --recursive https://github.com/mpv-player/mpv-build.git
- cd mpv-build
- ./rebuild -j4
- sudo install
- else
- cd mpv-build
- git pull
- ./rebuild -j4
- sudo ./install
- fi
- }
- function etcherinstall {
- cd "$mydir"
- if [ ! -d "$mydir/etcher" ]; then
- git clone https://github.com/resin-io/etcher.git
- cd etcher
- else
- cd etcher
- fi
- }
- function jqinstall {
- # https://stedolan.github.io/jq/
- # 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,
- # grep and friends let you play with text
- cd "$mydir"
- if [ ! -d "$mydir/jq" ]; then
- git clone https://github.com/stedolan/jq.git
- cd jq
- autoreconf -i
- ./configure --disable-maintainer-mode
- make && sudo make install
- else
- cd jq
- git pull
- autoreconf -i
- ./configure --disable-maintainer-mode
- make && sudo make install
- fi
- }
- #libsnarkdirect
- # build_linuxGpuMining
- # :<<'removeme'
- function install_deb_packages() {
- # sudo apt install -y qtbase5-dev openssh-server #don't install as gobyte will compile with it.
- sudo apt install -y gedit vim ssh gparted libonig-dev
- sudo apt install -y rar unrar p7zip p7zip-full
- sudo apt install -y libtool cmake libprocps4-dev autoconf
- sudo apt install -y autopoint libboost-all-dev libevent-dev build-essential
- sudo apt install -y pkg-config libc6-dev m4 g++-multilib
- sudo apt install -y autoconf libtool ncurses-dev unzip git python
- sudo apt install -y zlib1g-dev wget bsdmainutils automake byacc flex
- sudo apt install -y libcurl4-openssl-dev libssl-dev libjansson-dev automake autotools-dev build-essential
- sudo apt install -y libncurses5-dev libncursesw5-dev
- }
- function ccminer_build() {
- # https://www.reddit.com/r/MoneroMining/comments/6lhbmw/old_problem_with_ccminer/
- echo "USE kernel v4.4-wily to compile ont btc+ asrock mining boards, about the only board that multi gpu works with"
- echo " /usr/local/cuda-8.0/bin must be in PATH under .profile in home directory. "
- echo " if you have cuda 8 and 9 , make a symbolic link for nvcc or set cuda path (run ./configure --help) "
- echo " type "which nvcc" and symlink to it. "
- echo " https://github.com/tpruvot/ccminer/blob/linux/INSTALL COMPILE With gcc5 "
- echo " run which gcc to get the gcc compiler used at present. "
- echo " set the correct ARCH flag for gtx1070 (61) in the file Makefile.am"
- echo "see https://github.com/tpruvot/ccminer/wiki/Compatibility for details gtx1060,70,80 the line with 61 is uncommented"
- echo " https://github.com/tpruvot/ccminer/blob/linux/INSTALL COMPILE With gcc5 "
- echo "edit this script and remove the exit1 below this line after the ARCH flags are set"
- exit 1
- cd "$mydir"
- if [ ! -d "$mydir/ccminer" ]; then
- git clone https://github.com/tpruvot/ccminer.git
- cd ccminer
- ./autogen.sh
- ./configure --with-cuda=/usr/local/cuda-8.0 #for cuda 8
- ## ./configure --with-cuda=/usr/local/cuda-9.0 #for cuda 9
- make && sudo make install
- else
- cd ccminer
- git pull && make clean
- ./autogen.sh
- ./configure --with-cuda=/usr/local/cuda-8.0 #for cuda 8
- make && sudo make install
- fi
- }
- ######################
- ######################
- ### # sudo pacman -S boost manjaro
- #### comments remove ####
- echo "for some reason script exists after doing debs install"
- install_deb_packages
- echo "build "
- createLFS
- echo "build yasm"
- build_yasm
- build_nasm
- build_texinfo6
- ####### #downloadreposonly
- build_help2man
- jqinstall
- #### libtool
- # build_Boost #not detected by many packages if instlalled from source. Use apt get
- #build_berkeleydb48
- echo "not executing gmp exits scripthere for some reason"
- echo "get status of variable"
- build_gmp
- build_libff
- build_procps
- build_libqrencode
- #build_libsodium
- build_qpidproton
- #####build_libsnark #can't get to compile
- #removeme
- build_zcash
- build_zencash
- build_zcashclassic
- build_gobyte
- #ccminer_build
- #####build_ewbfminer
- ### build_zclassicGuiWallet
- ## build_nheqminer
- # removeme
- #c2man #fribidi depends
- #buildFribidi #mpvBuild depends
- #etcherinstall
- #mpvBuild
- # https://pastebin.com/4AW3mBv6
- # raspberry
- # 192.168.1.19/24
- # dns server 196.22.218.248
Add Comment
Please, Sign In to add comment