install_debian.sh 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #!/bin/bash
  2. # This will download, package and install the latest version of Searx-Qt on
  3. # Debian based systems. To install git development version set SEARXQT_GIT to
  4. # anything but 0.
  5. VERSION="0.3-beta1"
  6. TMP_PATH="/tmp/searx-qt-tmp-build/"
  7. SEARXQT_GIT=${SEARXQT_GIT:=0}
  8. DEP_BUILD="python3-stdeb gettext pyqt5-dev-tools"
  9. if [[ $SEARXQT_GIT -eq 0 ]]; then
  10. DEP_BUILD+=" wget"
  11. else
  12. DEP_BUILD+=" git"
  13. fi
  14. # Install dependencies ########################################################
  15. #-- Build dependencies -----------------------------------------
  16. echo "# Install build dependencies:"
  17. sudo apt install $DEP_BUILD
  18. if [[ $? -ne 0 ]]; then
  19. echo "Failed to install build dependencies."
  20. exit 1
  21. fi
  22. #-- Run dependencies -------------------------------------------
  23. echo "# Install runtime dependencies:"
  24. sudo apt install python3 python3-requests python3-pyqt5 python3-socks
  25. if [[ $? -ne 0 ]]; then
  26. echo "Failed to install runtime dependencies."
  27. exit 1
  28. fi
  29. # Create and cd into tmp dir ##################################################
  30. # -- Delete tmp path --------------------------------------------
  31. if [ -d "$TMP_PATH" ]; then
  32. rm -rf "$TMP_PATH"
  33. fi
  34. # -- Create tmp path
  35. mkdir "$TMP_PATH"
  36. if [[ $? -ne 0 ]]; then
  37. echo "Failed to create temporary build path."
  38. exit 1
  39. fi
  40. cd "$TMP_PATH"
  41. # Download and extract the source #####################################
  42. if [[ $SEARXQT_GIT -eq 0 ]]; then
  43. wget "https://notabug.org/CYBERDEViL/searx-qt/archive/$VERSION.tar.gz"
  44. if [[ $? -ne 0 ]]; then
  45. echo "Failed to download the source."
  46. exit 1
  47. fi
  48. # -- Extract the source -------------------------------------
  49. tar -xvf "$VERSION.tar.gz"
  50. if [[ $? -ne 0 ]]; then
  51. echo "Failed to extract the source."
  52. exit 1
  53. fi
  54. cd searx-qt
  55. else
  56. git clone "https://notabug.org/CYBERDEViL/searx-qt"
  57. if [[ $? -ne 0 ]]; then
  58. echo "Failed to download the source from git."
  59. exit 1
  60. fi
  61. cd searx-qt
  62. VERSION=$(python -c "from searxqt.version import __version__; print(__version__)")
  63. fi
  64. # Create .deb package #########################################################
  65. ./utils/gen_deb.sh
  66. if [[ $? -ne 0 ]]; then
  67. echo "Failed to create package."
  68. exit 1
  69. fi
  70. # Install .deb package ########################################################
  71. sudo dpkg -i "./deb_dist/python3-searx-qt_$VERSION-1_all.deb"
  72. if [[ $? -ne 0 ]]; then
  73. echo "Failed to install package."
  74. exit 1
  75. fi
  76. # Cleanup #####################################################################
  77. rm -rf "$TMP_PATH"
  78. echo "Searx-Qt $VERSION installed succesfully!"