provision: Add provision support for Fedora 38.

Tweaked provision script to run successfully in Fedora 38 and
included a script to build the groonga libs from source because
the packages in Fedora repos are outdated.

There is a major version jump from the last supported version (F34)
which is EOL so references and support for older versions were
removed.

Fixes: #20635
This commit is contained in:
shu.chen 2023-08-22 19:26:29 +01:00 committed by GitHub
parent 5efe78205d
commit 321776ac49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 8 deletions

View File

@ -22,7 +22,7 @@ are:
- Ubuntu 20.04, 22.04 - Ubuntu 20.04, 22.04
- Debian 11, 12 - Debian 11, 12
- CentOS 7 (beta) - CentOS 7 (beta)
- Fedora 33 and 34 (beta) - Fedora 38 (beta)
- RHEL 7 (beta) - RHEL 7 (beta)
**Note**: You should not use the `root` user to run the installation. **Note**: You should not use the `root` user to run the installation.

18
scripts/lib/build-groonga Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euxo pipefail
version="13.0.5"
sha256=f49c4b2bd24f60a3237495dda241017c42076f4d2012bc523fcfa4f349f069a0
tmpdir="$(mktemp -d)"
trap 'rm -r "$tmpdir"' EXIT
cd "$tmpdir"
tarball="groonga-$version.tar.gz"
curl -fLO --retry 3 "https://github.com/groonga/groonga/releases/download/v$version/$tarball"
sha256sum -c <<<"$sha256 $tarball"
tar -xzf "$tarball"
cd "groonga-$version"
./configure --prefix=/usr
make -j "$(nproc)"
make install

View File

@ -88,10 +88,8 @@ elif vendor == "ubuntu" and os_version == "22.04": # jammy
POSTGRESQL_VERSION = "14" POSTGRESQL_VERSION = "14"
elif vendor == "neon" and os_version == "20.04": # KDE Neon elif vendor == "neon" and os_version == "20.04": # KDE Neon
POSTGRESQL_VERSION = "12" POSTGRESQL_VERSION = "12"
elif vendor == "fedora" and os_version == "33": elif vendor == "fedora" and os_version == "38":
POSTGRESQL_VERSION = "13" POSTGRESQL_VERSION = "15"
elif vendor == "fedora" and os_version == "34":
POSTGRESQL_VERSION = "13"
elif vendor == "rhel" and os_version.startswith("7."): elif vendor == "rhel" and os_version.startswith("7."):
POSTGRESQL_VERSION = "10" POSTGRESQL_VERSION = "10"
elif vendor == "centos" and os_version == "7": elif vendor == "centos" and os_version == "7":
@ -160,6 +158,7 @@ COMMON_YUM_DEPENDENCIES = [
# Puppeteer dependencies end here. # Puppeteer dependencies end here.
] ]
BUILD_GROONGA_FROM_SOURCE = False
BUILD_PGROONGA_FROM_SOURCE = False BUILD_PGROONGA_FROM_SOURCE = False
if vendor == "debian" and os_version in ["12"] or vendor == "ubuntu" and os_version in []: if vendor == "debian" and os_version in ["12"] or vendor == "ubuntu" and os_version in []:
# For platforms without a PGroonga release, we need to build it # For platforms without a PGroonga release, we need to build it
@ -213,10 +212,10 @@ elif "fedora" in os_families():
f"postgresql{POSTGRESQL_VERSION}", f"postgresql{POSTGRESQL_VERSION}",
f"postgresql{POSTGRESQL_VERSION}-devel", f"postgresql{POSTGRESQL_VERSION}-devel",
# Needed to build PGroonga from source # Needed to build PGroonga from source
"groonga-devel",
"msgpack-devel", "msgpack-devel",
*VENV_DEPENDENCIES, *VENV_DEPENDENCIES,
] ]
BUILD_GROONGA_FROM_SOURCE = True
BUILD_PGROONGA_FROM_SOURCE = True BUILD_PGROONGA_FROM_SOURCE = True
if "fedora" in os_families(): if "fedora" in os_families():
@ -246,6 +245,8 @@ def install_system_deps() -> None:
# For some platforms, there aren't published PGroonga # For some platforms, there aren't published PGroonga
# packages available, so we build them from source. # packages available, so we build them from source.
if BUILD_GROONGA_FROM_SOURCE:
run_as_root(["./scripts/lib/build-groonga"])
if BUILD_PGROONGA_FROM_SOURCE: if BUILD_PGROONGA_FROM_SOURCE:
run_as_root(["./scripts/lib/build-pgroonga"]) run_as_root(["./scripts/lib/build-pgroonga"])
@ -329,11 +330,16 @@ def install_yum_deps(deps_to_install: List[str]) -> None:
# Later steps will ensure PostgreSQL is started # Later steps will ensure PostgreSQL is started
# Link in tsearch data files # Link in tsearch data files
if vendor == "fedora":
# Since F36 dictionary files were moved away from /usr/share/myspell
tsearch_source_prefix = "/usr/share/hunspell"
else:
tsearch_source_prefix = "/usr/share/myspell"
run_as_root( run_as_root(
[ [
"ln", "ln",
"-nsf", "-nsf",
"/usr/share/myspell/en_US.dic", os.path.join(tsearch_source_prefix, "en_US.dic"),
f"/usr/pgsql-{POSTGRESQL_VERSION}/share/tsearch_data/en_us.dict", f"/usr/pgsql-{POSTGRESQL_VERSION}/share/tsearch_data/en_us.dict",
] ]
) )
@ -341,7 +347,7 @@ def install_yum_deps(deps_to_install: List[str]) -> None:
[ [
"ln", "ln",
"-nsf", "-nsf",
"/usr/share/myspell/en_US.aff", os.path.join(tsearch_source_prefix, "en_US.aff"),
f"/usr/pgsql-{POSTGRESQL_VERSION}/share/tsearch_data/en_us.affix", f"/usr/pgsql-{POSTGRESQL_VERSION}/share/tsearch_data/en_us.affix",
] ]
) )
@ -365,6 +371,11 @@ def main(options: argparse.Namespace) -> NoReturn:
with open("scripts/lib/setup-yum-repo", "rb") as fb: with open("scripts/lib/setup-yum-repo", "rb") as fb:
sha_sum.update(fb.read()) sha_sum.update(fb.read())
# hash the content of build-pgroonga if Groonga is built from source
if BUILD_GROONGA_FROM_SOURCE:
with open("scripts/lib/build-groonga", "rb") as fb:
sha_sum.update(fb.read())
# hash the content of build-pgroonga if PGroonga is built from source # hash the content of build-pgroonga if PGroonga is built from source
if BUILD_PGROONGA_FROM_SOURCE: if BUILD_PGROONGA_FROM_SOURCE:
with open("scripts/lib/build-pgroonga", "rb") as fb: with open("scripts/lib/build-pgroonga", "rb") as fb: