From 80f7b658047a3541697ef5ae1aae897817b3f43c Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 9 Mar 2020 01:37:26 +0100 Subject: [PATCH] searx.sh: add buildhost cmd, installs OS packages for builds Signed-off-by: Markus Heiser --- docs/admin/buildhosts.rst | 3 ++- utils/lxc.sh | 2 +- utils/makefile.python | 1 + utils/searx.sh | 48 ++++++++++++++++++++++++++++++--------- 4 files changed, 41 insertions(+), 13 deletions(-) diff --git a/docs/admin/buildhosts.rst b/docs/admin/buildhosts.rst index 27784764f..a6820aa61 100644 --- a/docs/admin/buildhosts.rst +++ b/docs/admin/buildhosts.rst @@ -104,7 +104,8 @@ For PDF output you also need: $ sudo dnf install \ texlive-collection-fontsrecommended texlive-collection-latex \ - dejavu-sans-fonts dejavu-serif-fonts dejavu-sans-mono-fonts + dejavu-sans-fonts dejavu-serif-fonts dejavu-sans-mono-fonts \ + ImageMagick .. _sh lint: diff --git a/utils/lxc.sh b/utils/lxc.sh index f9dd453ee..3c4d2016e 100755 --- a/utils/lxc.sh +++ b/utils/lxc.sh @@ -236,7 +236,7 @@ main() { shift lxc_exec_cmd "${name}" "$@" ;; - *) usage "uknown or missing container $2"; exit 42;; + *) usage "uknown or missing container $1"; exit 42;; esac ;; install) diff --git a/utils/makefile.python b/utils/makefile.python index f6aa4470a..f7e4315c1 100644 --- a/utils/makefile.python +++ b/utils/makefile.python @@ -204,6 +204,7 @@ pyclean: pyenv: $(PY_ENV) $(PY_ENV): python-exe $(call cmd,virtualenv,$(PY_ENV)) + @$(PY_ENV_BIN)/pip install $(PIP_VERBOSE) -U wheel pip setuptools @$(PY_ENV_BIN)/pip install $(PIP_VERBOSE) -r requirements.txt PHONY += pylint-exe diff --git a/utils/searx.sh b/utils/searx.sh index 9d33dc31a..19cb41986 100755 --- a/utils/searx.sh +++ b/utils/searx.sh @@ -41,27 +41,47 @@ SEARX_UWSGI_SOCKET="/run/uwsgi/app/searx/socket" SEARX_PACKAGES_debian="\ python3-dev python3-babel python3-venv uwsgi uwsgi-plugin-python3 -git build-essential libxslt-dev zlib1g-dev libffi-dev libssl-dev -shellcheck" +git build-essential libxslt-dev zlib1g-dev libffi-dev libssl-dev" + +BUILD_PACKAGES_debian="\ +shellcheck graphviz imagemagick texlive-xetex librsvg2-bin +texlive-latex-recommended texlive-extra-utils ttf-dejavu" # pacman packages SEARX_PACKAGES_arch="\ python python-pip python-lxml python-babel uwsgi uwsgi-plugin-python -git base-devel libxml2 -shellcheck" +git base-devel libxml2" + +BUILD_PACKAGES_arch="\ +shellcheck graphviz imagemagick texlive-bin extra/librsvg +texlive-core texlive-latexextra ttf-dejavu" # dnf packages SEARX_PACKAGES_fedora="\ python python-pip python-lxml python-babel uwsgi uwsgi-plugin-python3 -git @development-tools libxml2 -ShellCheck" +git @development-tools libxml2" + +BUILD_PACKAGES_fedora="\ +ShellCheck graphviz graphviz-gd ImageMagick librsvg2-tools +texlive-xetex-bin texlive-collection-fontsrecommended +texlive-collection-latex dejavu-sans-fonts dejavu-serif-fonts +dejavu-sans-mono-fonts" case $DIST_ID in - ubuntu|debian) SEARX_PACKAGES="${SEARX_PACKAGES_debian}" ;; - arch) SEARX_PACKAGES="${SEARX_PACKAGES_arch}" ;; - fedora) SEARX_PACKAGES="${SEARX_PACKAGES_fedora}" ;; + ubuntu|debian) + SEARX_PACKAGES="${SEARX_PACKAGES_debian}" + BUILD_PACKAGES="${BUILD_PACKAGES_debian}" + ;; + arch) + SEARX_PACKAGES="${SEARX_PACKAGES_arch}" + BUILD_PACKAGES="${BUILD_PACKAGES_arch}" + ;; + fedora) + SEARX_PACKAGES="${SEARX_PACKAGES_fedora}" + BUILD_PACKAGES="${BUILD_PACKAGES_fedora}" + ;; esac # Apache Settings @@ -111,6 +131,7 @@ install / remove :uwsgi: install searx uWSGI application :settings: reinstall settings from ${REPO_ROOT}/searx/settings.yml :packages: install needed packages from OS package manager + :buildhost: install packages from OS package manager needed by buildhost update searx Update searx installation ($SERVICE_HOME) activate service @@ -172,7 +193,13 @@ main() { searx-src) clone_searx ;; settings) install_settings ;; uwsgi) install_searx_uwsgi;; - packages) pkg_install "$SEARX_PACKAGES" ;; + packages) + pkg_install "$SEARX_PACKAGES" + ;; + buildhost) + pkg_install "$SEARX_PACKAGES" + pkg_install "$BUILD_PACKAGES" + ;; *) usage "$_usage"; exit 42;; esac ;; update) @@ -730,4 +757,3 @@ EOF # ---------------------------------------------------------------------------- main "$@" # ---------------------------------------------------------------------------- -