]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Add EL9 and EL10 support for both x86_64 and aarch64
authorFingerlessGloves <me@FingerlessGloves.me>
Sun, 17 Aug 2025 23:08:04 +0000 (00:08 +0100)
committerFlole <Flole998@users.noreply.github.com>
Sat, 23 Aug 2025 18:28:21 +0000 (20:28 +0200)
.github/workflows/build-ci.yml
.github/workflows/build-cloudsmith.yml
Autobuild.sh
Autobuild/identify-os.sh
rpm/tvheadend.spec.in
support/cloudsmith.sh

index bd44d4c2e985607afbd0db976309a85d72eb4718..85f5cc97042d0481df8d763c64ae921741525fe9 100644 (file)
@@ -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'
index c6c2c64dbcbee6351aa5c9b178170966613b00aa..1cf5391c57231bbf93e35937b518d91220a11d00 100644 (file)
@@ -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 }}
index e9ec2d4c7f38466fe9a9235c33b3bef797c0f3a4..1322f67a44c682f3e5925b23c6b58e32ce97ed8c 100755 (executable)
@@ -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
index 4e55488c081ef1dccea210e9104c221589cc400e..4057f800ee48342846f4052a0523d2aaadf0acf1 100644 (file)
@@ -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)
index 958713958972fc0f80a5e615d567f37a901be9d7..aa242ee28cfa5196348f8887a1aad1d1c4ccfafe 100644 (file)
@@ -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
index f8143862f9bb60d78d9a8957ad8f0482dc14a530..823ed211ef45e49b72fc974e1ad6786c11512c14 100755 (executable)
@@ -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)