From: FingerlessGloves Date: Sun, 17 Aug 2025 23:08:04 +0000 (+0100) Subject: Add EL9 and EL10 support for both x86_64 and aarch64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4bf4f7d87ccf343c3bbe9cb65eb5a6133d168044;p=thirdparty%2Ftvheadend.git Add EL9 and EL10 support for both x86_64 and aarch64 --- diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index bd44d4c2e..85f5cc970 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -235,14 +235,17 @@ jobs: steps: - name: rpmfusion-free run: | - dnf install -y "https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-${{matrix.releasever}}.noarch.rpm" + dnf install -y "https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-${{ matrix.releasever }}.noarch.rpm" - name: dependencies run: | dnf install -y gcc-c++ gcc-c++ which rpm-build rpmdevtools git make cmake gettext-devel dbus-devel avahi-devel openssl-devel zlib-devel libdvbcsa-devel wget bzip2 uriparser-devel pcre2-devel python python-requests ccache systemd-units systemd-devel dnf install -y openssl-devel-engine || true - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + tags: true - name: Workaround safe directory - run: git config --global --add safe.directory /__w/tvheadend/tvheadend + run: git config --global --add safe.directory "$(pwd)" - name: build run: ./configure --disable-dvbscan --disable-libfdkaac_static --disable-ffmpeg_static --disable-hdhomerun_static --disable-libfdkaac_static --disable-libopus_static --disable-libtheora_static --disable-libvorbis_static --disable-libvpx_static --disable-libx264_static --disable-libx265_static --enable-libfdkaac --enable-hdhomerun_client --enable-libsystemd_daemon --python=/usr/bin/python3 && make -C rpm build -j$(nproc) || (echo "PARALLEL BUILD FAILED, DOING SINGLE THREADED BUILD" && make -C rpm build) - name: copy-result @@ -254,3 +257,41 @@ jobs: if-no-files-found: error - name: upload-cloudsmith run: support/cloudsmith.sh -n -f 'tvheadend*.rpm' + + build-el-rpm-native: + continue-on-error: true + name: Build on native almalinux:${{ matrix.releasever }} ${{ matrix.runner == 'ubuntu-latest' && 'x86_64' || 'aarch64' }} + strategy: + matrix: + releasever: ["9", "10"] + runner: ["ubuntu-latest", "ubuntu-24.04-arm"] + runs-on: ${{ matrix.runner }} + container: + image: "almalinux:${{ matrix.releasever }}" + steps: + - name: rpmfusion-free + run: | + dnf install -y dnf-plugins-core + dnf config-manager --set-enabled crb + dnf install -y "https://download1.rpmfusion.org/free/el/rpmfusion-free-release-${{ matrix.releasever }}.noarch.rpm" + - name: dependencies + run: | + dnf install -y gcc-c++ gcc-c++ which rpm-build rpmdevtools git make cmake gettext-devel dbus-devel avahi-devel openssl-devel zlib-devel libdvbcsa-devel wget bzip2 uriparser-devel pcre2-devel python python-requests ccache systemd-units systemd-devel + dnf install -y openssl-devel-engine || true + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + tags: true + - name: Workaround safe directory + run: git config --global --add safe.directory "$(pwd)" + - name: build + run: ./configure --disable-dvbscan --disable-libfdkaac_static --disable-ffmpeg_static --disable-hdhomerun_static --disable-libfdkaac_static --disable-libopus_static --disable-libtheora_static --disable-libvorbis_static --disable-libvpx_static --disable-libx264_static --disable-libx265_static --enable-libfdkaac --enable-hdhomerun_client --enable-libsystemd_daemon --python=/usr/bin/python3 && make -C rpm build -j$(nproc) + - name: copy-result + run: cp rpm/RPMS/*/tvheadend*.rpm . + - uses: actions/upload-artifact@v4 + with: + name: Tvheadend-el-${{ matrix.releasever }}-${{ matrix.runner == 'ubuntu-latest' && 'x86_64' || 'aarch64' }} + path: tvheadend*.rpm + if-no-files-found: error + - name: upload-cloudsmith + run: support/cloudsmith.sh -n -f 'tvheadend*.rpm' diff --git a/.github/workflows/build-cloudsmith.yml b/.github/workflows/build-cloudsmith.yml index c6c2c64db..1cf5391c5 100644 --- a/.github/workflows/build-cloudsmith.yml +++ b/.github/workflows/build-cloudsmith.yml @@ -246,14 +246,17 @@ jobs: steps: - name: rpmfusion-free run: | - dnf install -y "https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-${{matrix.releasever}}.noarch.rpm" + dnf install -y "https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-${{ matrix.releasever }}.noarch.rpm" - name: dependencies run: | dnf install -y gcc-c++ gcc-c++ which rpm-build rpmdevtools git make cmake gettext-devel dbus-devel avahi-devel openssl-devel zlib-devel libdvbcsa-devel wget bzip2 uriparser-devel pcre2-devel python python-requests ccache systemd-units systemd-devel dnf install -y openssl-devel-engine || true - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + tags: true - name: Workaround safe directory - run: git config --global --add safe.directory /__w/tvheadend/tvheadend + run: git config --global --add safe.directory "$(pwd)" - name: build run: ./configure --disable-dvbscan --disable-libfdkaac_static --disable-ffmpeg_static --disable-hdhomerun_static --disable-libfdkaac_static --disable-libopus_static --disable-libtheora_static --disable-libvorbis_static --disable-libvpx_static --disable-libx264_static --disable-libx265_static --enable-libfdkaac --enable-hdhomerun_client --enable-libsystemd_daemon --python=/usr/bin/python3 && make -C rpm build -j$(nproc) || (echo "PARALLEL BUILD FAILED, DOING SINGLE THREADED BUILD" && make -C rpm build) - name: copy-result @@ -270,3 +273,46 @@ jobs: CLOUDSMITH_REPO: ${{ vars.CLOUDSMITH_REPO }} CLOUDSMITH_OWNER: ${{ secrets.CLOUDSMITH_OWNER }} CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_KEY }} + + build-el-rpm-native: + continue-on-error: true + name: Build on native almalinux:${{ matrix.releasever }} ${{ matrix.runner == 'ubuntu-latest' && 'x86_64' || 'aarch64' }} + strategy: + matrix: + releasever: ["9", "10"] + runner: ["ubuntu-latest", "ubuntu-24.04-arm"] + runs-on: ${{ matrix.runner }} + container: + image: "almalinux:${{ matrix.releasever }}" + steps: + - name: rpmfusion-free + run: | + dnf install -y dnf-plugins-core + dnf config-manager --set-enabled crb + dnf install -y "https://download1.rpmfusion.org/free/el/rpmfusion-free-release-${{ matrix.releasever }}.noarch.rpm" + - name: dependencies + run: | + dnf install -y gcc-c++ gcc-c++ which rpm-build rpmdevtools git make cmake gettext-devel dbus-devel avahi-devel openssl-devel zlib-devel libdvbcsa-devel wget bzip2 uriparser-devel pcre2-devel python python-requests ccache systemd-units systemd-devel + dnf install -y openssl-devel-engine || true + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + tags: true + - name: Workaround safe directory + run: git config --global --add safe.directory "$(pwd)" + - name: build + run: ./configure --disable-dvbscan --disable-libfdkaac_static --disable-ffmpeg_static --disable-hdhomerun_static --disable-libfdkaac_static --disable-libopus_static --disable-libtheora_static --disable-libvorbis_static --disable-libvpx_static --disable-libx264_static --disable-libx265_static --enable-libfdkaac --enable-hdhomerun_client --enable-libsystemd_daemon --python=/usr/bin/python3 && make -C rpm build -j$(nproc) + - name: copy-result + run: cp rpm/RPMS/*/tvheadend*.rpm . + - uses: actions/upload-artifact@v4 + with: + name: Tvheadend-el-${{ matrix.releasever }}-${{ matrix.runner == 'ubuntu-latest' && 'x86_64' || 'aarch64' }} + path: tvheadend*.rpm + if-no-files-found: error + - name: upload-cloudsmith + run: support/cloudsmith.sh -f 'tvheadend*.rpm' + env: + CLOUDSMITH_ORG: ${{ vars.CLOUDSMITH_ORG }} + CLOUDSMITH_REPO: ${{ vars.CLOUDSMITH_REPO }} + CLOUDSMITH_OWNER: ${{ secrets.CLOUDSMITH_OWNER }} + CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_KEY }} diff --git a/Autobuild.sh b/Autobuild.sh index e9ec2d4c7..1322f67a4 100755 --- a/Autobuild.sh +++ b/Autobuild.sh @@ -61,7 +61,7 @@ if [[ -z $TARGET ]]; then if ! [[ -z $ARCHOVR ]]; then ARCH=$ARCHOVR fi - TARGET="$DISTRO-$ARCH" + TARGET="$CODENAME-$ARCH" fi TARGET=$OSPREFIX$TARGET diff --git a/Autobuild/identify-os.sh b/Autobuild/identify-os.sh index 4e55488c0..4057f800e 100644 --- a/Autobuild/identify-os.sh +++ b/Autobuild/identify-os.sh @@ -4,18 +4,24 @@ UNAME=$(uname | tr "[:upper:]" "[:lower:]") if [ "$UNAME" == "linux" ]; then # If available, use LSB to identify distribution if [ -x "$(command -v lsb_release)" ]; then - export DISTRO=$(lsb_release -c | cut -d: -f2 | sed s/'^\t'//) + export DISTRO=$(lsb_release -i | cut -d: -f2 | sed 's/^[[:space:]]*//' | tr "[:upper:]" "[:lower:]") + export CODENAME=$(lsb_release -c | cut -d: -f2 | sed s/'^\t'//) echo "OS identified using lsb_release command" elif [ -f /etc/lsb-release ]; then - export DISTRO=$(awk -F= '/^DISTRIB_CODENAME/{print $2}' /etc/lsb-release) + export DISTRO=$(awk -F= '/^DISTRIB_ID/{print $2}' /etc/lsb-release | tr "[:upper:]" "[:lower:]") + export CODENAME=$(awk -F= '/^DISTRIB_CODENAME/{print $2}' /etc/lsb-release) echo "OS identified using lsb_release file" # Otherwise, use release info file elif [ -f /etc/os-release ]; then - export DISTRO=$(awk -F= '/^VERSION_CODENAME/{print $2}' /etc/os-release) - # Fedora uses VERSION_ID - if [ "$DISTRO" == '""' ]; then - export DISTRO=$(awk -F= '/^VERSION_ID/{print $2}' /etc/os-release) + # Detect EL based + ID_LIKE=$(awk -F= '/^ID_LIKE=/{print $2}' /etc/os-release | tr -d '"') + if [[ "$ID_LIKE" == *rhel* ]]; then + export DISTRO="rhel" + else # default to ID + export DISTRO=$(awk -F= '/^ID=/{print $2}' /etc/os-release | tr -d '"') fi + export CODENAME=$(awk -F= '/^VERSION_CODENAME=/{print $2}' /etc/os-release) + export VERSION=$(awk -F= '/^VERSION_ID=/{print $2}' /etc/os-release | tr -d '"') echo "OS identified using os-release file" else export DISTRO=$(ls -d /etc/[A-Za-z]*[_-][rv]e[lr]* | grep -v "lsb" | cut -d'/' -f3 | cut -d'-' -f1 | cut -d'_' -f1) diff --git a/rpm/tvheadend.spec.in b/rpm/tvheadend.spec.in index 958713958..aa242ee28 100644 --- a/rpm/tvheadend.spec.in +++ b/rpm/tvheadend.spec.in @@ -53,7 +53,7 @@ SAT>IP and various other clients using these protocols. %build echo %{version}-%{release} > %{_builddir}/%{buildsubdir}/rpm/version -%ifarch %arm +%ifarch %arm aarch64 %configure --disable-lockowner --disable-ffmpeg_static %else %configure --disable-lockowner --enable-ffmpeg_static --enable-libx265 --nowerror diff --git a/support/cloudsmith.sh b/support/cloudsmith.sh index f8143862f..823ed211e 100755 --- a/support/cloudsmith.sh +++ b/support/cloudsmith.sh @@ -13,6 +13,7 @@ OSPREFIX="" OS="" FILE="" DRYRUN="0" +PKGMGR="apt" YELLOW='\033[1;33m' GREEN='\033[1;32m' @@ -45,32 +46,72 @@ fi if [[ -z $TARGET ]]; then source Autobuild/identify-os.sh - TARGET="$DISTRO" fi -case $OSPREFIX$TARGET in - bookworm|bullseye|buster|sid|stretch|jessie|trixie|forky) - OS="debian";; - trusty|xenial|bionic|focal|impish|jammy|kinetic|lunar|mantic|noble) - OS="ubuntu";; +if [ -n "$OSPREFIX" ]; then + DISTRO=$OSPREFIX +fi + +case $DISTRO in + debian|raspbian*) + case $CODENAME in + bookworm|bullseye|buster|sid|stretch|jessie|trixie|forky) + OS="debian" + TARGET=$CODENAME;; + *) + echo -e "${RED}Debian release $CODENAME could not be recognized${NC}" + exit 1;; + esac;; + ubuntu) + case $CODENAME in + trusty|xenial|bionic|focal|impish|jammy|kinetic|lunar|mantic|noble) + OS="ubuntu" + TARGET=$CODENAME;; + *) + echo -e "${RED}Ubuntu release $CODENAME could not be recognized${NC}" + exit 1;; + esac;; raspios*) - OS="raspbian";; - 37|38|39|40|41|42) - OS="fedora";; - 43|44) - echo -e "${YELLOW}Fedora 43 (current rawhide) is not (yet) supported by Cloudsmith${NC}" && exit;; - *) echo -e "${RED}OS $OSPREFIX$TARGET could not be recognized${NC}" && exit 1;; + OS="raspbian" + TARGET=$CODENAME;; + rhel) + PKGMGR="dnf" + OS="rhel" + TARGET="${VERSION%%.*}";; + fedora) + case $VERSION in + 37|38|39|40|41|42) + PKGMGR="dnf" + OS="fedora" + TARGET=$VERSION;; + 43|44) + echo -e "${YELLOW}Fedora 43 (current rawhide) is not (yet) supported by Cloudsmith${NC}" + exit 0;; + *) + echo -e "${RED}Fedora release $VERSION could not be recognized${NC}" + exit 1;; + esac;; + *) + echo -e "${RED}OS $DISTRO $TARGET could not be recognized${NC}" + exit 1;; esac +echo "OS Detected as $DISTRO $TARGET" + export LC_ALL=C.UTF-8 export LANG=C.UTF-8 -if [ $OS == "fedora" ]; then - dnf install -y curl +if ! command -v curl &> /dev/null; then + echo "curl not found, installing..." + if [ "$PKGMGR" == "dnf" ]; then + dnf install -y curl + else + export DEBIAN_FRONTEND=noninteractive + apt update + apt install -y curl + fi else - export DEBIAN_FRONTEND=noninteractive - apt update - apt install -y curl + echo "curl is already installed." fi FILEARRAY=($FILE)