install_wadtools.sh 953 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. # Set superuser privileges command if not set
  3. if [[ -z $su ]]; then
  4. export su="sudo"
  5. fi
  6. $su pacman -Sy --noconfirm --needed autoconf gcc
  7. application=wadtools
  8. repository="https://github.com/makise-homura/wadtools.git"
  9. export compile=
  10. mkdir -p ~/src
  11. cd ~/src || return
  12. if [ ! -d $application ]; then
  13. git clone $repository
  14. cd $application || return
  15. export compile=true
  16. else
  17. cd $application || return
  18. #git pull
  19. pwd
  20. git fetch
  21. LOCAL=$(git rev-parse HEAD)
  22. REMOTE=$(git rev-parse @{u})
  23. if [ ! $LOCAL = $REMOTE ]; then
  24. pwd
  25. echo "Need to pull"
  26. git pull
  27. export compile=true
  28. fi
  29. fi
  30. if [ "$compile" = "true" ]; then
  31. cd ~/src/$application || return
  32. mkdir -p build
  33. cd build || return
  34. gcc ../wadbuild.c -o wadbuild
  35. gcc ../wadxtract.c -o wadxtract
  36. gcc ../wadfindthing.c -o wadfindthing
  37. #gcc ../wadpack.c -o wadpack # compiling error
  38. #$su cp wadbuild wadxtract wadpack wadfindthing /usr/local/bin
  39. fi