From 2cb5d710734849599697cd3405db1d2cd46b1bbc Mon Sep 17 00:00:00 2001 From: Teemu Kekkonen Date: Fri, 2 Jun 2023 16:43:13 +0300 Subject: [PATCH] Update RPM script for Rocky Linux 9 This uses the 'dist' RPM macro instead of relying on the version information of CentOS packages. This approach works on CentOS 7 and 8 as well. --- pkg/rpm/generate_rpms.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/rpm/generate_rpms.sh b/pkg/rpm/generate_rpms.sh index be5d67a7c..ba4cd17c8 100755 --- a/pkg/rpm/generate_rpms.sh +++ b/pkg/rpm/generate_rpms.sh @@ -5,10 +5,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" version=$(grep KEYDB_REAL_VERSION $DIR/../../src/version.h | awk '{ printf $3 }' | tr -d \") release=1 # by default this will always be 1 for keydb version structure. If build release version needs to be update you can modify here arch=$(uname -m) -dist=el$(rpm -q --queryformat '%{VERSION}' centos-release | cut -d. -f1) -if [[ "$dist" == "elpackage centos-release is not installed" ]]; then - dist=el$(rpm -q --queryformat '%{VERSION}' centos-linux-release | cut -d. -f1) -fi +dist=$(rpm --eval '%{?dist}') if [[ "$arch" != "aarch64" ]] && [[ "$arch" != "x86_64" ]]; then echo "This script is only valid and tested for aarch64 and x86_64 architectures. You are trying to use: $arch" @@ -39,8 +36,8 @@ sed -i -E "1a\Version : $version" $DIR/keydb_build/keydb.spec sed -i '3d' $DIR/keydb_build/keydb.spec sed -i -E "2a\Release : $release%{?dist}" $DIR/keydb_build/keydb.spec -mkdir -p /root/rpmbuild/BUILDROOT/keydb-$version-$release.$dist.$arch -cp -r $DIR/keydb_build/keydb_rpm/* /root/rpmbuild/BUILDROOT/keydb-$version-$release.$dist.$arch/ +mkdir -p /root/rpmbuild/BUILDROOT/keydb-$version-$release$dist.$arch +cp -r $DIR/keydb_build/keydb_rpm/* /root/rpmbuild/BUILDROOT/keydb-$version-$release$dist.$arch/ rpmbuild -bb $DIR/keydb_build/keydb.spec mv /root/rpmbuild/RPMS/$arch/* $DIR/rpm_files_generated