diff --git a/scripts/lib/build-tsearch-extras b/scripts/lib/build-tsearch-extras index 2db3f79543..bf74f575f9 100755 --- a/scripts/lib/build-tsearch-extras +++ b/scripts/lib/build-tsearch-extras @@ -2,14 +2,13 @@ set -x set -e -# Has only been tested on Red Hat systems; gmake is wrong for others. - cd "$(mktemp -d)" +distro=$(lsb_release -is) git clone https://github.com/zulip/tsearch_extras -(cd tsearch_extras && gmake && make install) - -PGVER=10 -# Link installed hunspell-en-US to tsearch data -ln -sf /usr/share/myspell/en_US.dic "/usr/pgsql-$PGVER/share/tsearch_data/en_us.dict" -ln -sf /usr/share/myspell/en_US.aff "/usr/pgsql-$PGVER/share/tsearch_data/en_us.affix" +if [ "$distro" = "Ubuntu" ] || [ "$distro" == "Debian" ]; then + make="make" +else + make="gmake" +fi +(cd tsearch_extras && "$make" && "$make" install) diff --git a/tools/lib/provision.py b/tools/lib/provision.py index a0ad7050b1..9afe0a7fd2 100755 --- a/tools/lib/provision.py +++ b/tools/lib/provision.py @@ -14,7 +14,8 @@ ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__f sys.path.append(ZULIP_PATH) from scripts.lib.zulip_tools import run, run_as_root, OKBLUE, ENDC, WARNING, \ - get_dev_uuid_var_path, FAIL, parse_lsb_release, file_or_package_hash_updated + get_dev_uuid_var_path, FAIL, parse_lsb_release, file_or_package_hash_updated, \ + overwrite_symlink from scripts.lib.setup_venv import ( VENV_DEPENDENCIES, REDHAT_VENV_DEPENDENCIES, THUMBOR_VENV_DEPENDENCIES, YUM_THUMBOR_VENV_DEPENDENCIES, @@ -338,6 +339,12 @@ def install_yum_deps(deps_to_install, retry=False): run_as_root(["cp", "-a", "puppet/zulip/files/postgresql/centos_pg_hba.conf", pg_hba_conf]) # Later steps will ensure postgres is started + # Link in tsearch data files + overwrite_symlink("/usr/share/myspell/en_US.dic", "/usr/pgsql-%s/share/tsearch_data/en_us.dict" + % (POSTGRES_VERSION,)) + overwrite_symlink("/usr/share/myspell/en_US.aff", "/usr/pgsql-%s/share/tsearch_data/en_us.affix" + % (POSTGRES_VERSION,)) + def main(options): # type: (Any) -> int