merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

bootstrap (1589B)


      1 #!/bin/sh
      2 
      3 set -eu
      4 
      5 if ! git --version >/dev/null; then
      6   echo "git not installed"
      7   exit 1
      8 fi
      9 
     10 if ! python3 --version >/dev/null; then
     11   echo "python3 not installed"
     12   exit 1
     13 fi
     14 
     15 # Make sure that "git pull" et al. also update
     16 # submodules to avoid accidental rollbacks.
     17 git config --local submodule.recurse true
     18 
     19 echo "$0: Updating submodules"
     20 # Caution: We do NOT want to fetch the latest version with --remote,
     21 # but instead always the one that's recorded in the repository.
     22 echo | git submodule update --init --force
     23 
     24 ./contrib/check-prebuilt
     25 
     26 
     27 # This is more portable than `which' but comes with
     28 # the caveat of not(?) properly working on busybox's ash:
     29 existence()
     30 {
     31     command -v "$1" >/dev/null 2>&1
     32 }
     33 
     34 
     35 if existence uncrustify; then
     36     echo "Installing uncrustify hook and configuration"
     37     # Install uncrustify format symlink (if possible)
     38     ln -s contrib/uncrustify.cfg uncrustify.cfg 2> /dev/null || true
     39     # Install pre-commit hook (if possible)
     40     ln -s ../../contrib/uncrustify_precommit .git/hooks/pre-commit 2> /dev/null || true
     41 else
     42     echo "Uncrustify not detected, hook not installed. Please install uncrustify if you plan on doing development"
     43 fi
     44 
     45 # Generate Makefile.am in contrib/
     46 cd contrib
     47 rm -f Makefile.am
     48 find wallet-core/backoffice/ -type f | sort | awk '{print "  " $1 " \\" }' > Makefile.am.ext
     49 # Remove extra '\' at the end of the file
     50 truncate -s -2 Makefile.am.ext
     51 cat Makefile.am.in Makefile.am.ext >> Makefile.am
     52 # Prevent accidental editing of the generated Makefile.am
     53 chmod -w Makefile.am
     54 cd ..
     55 
     56 echo "$0: Running autoreconf"
     57 autoreconf -if