Skip to content

Commit 2cb5d71

Browse files
teemuke-kkJohnSully
authored andcommitted
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.
1 parent 011fdb4 commit 2cb5d71

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Diff for: pkg/rpm/generate_rpms.sh

+3-6
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
55
version=$(grep KEYDB_REAL_VERSION $DIR/../../src/version.h | awk '{ printf $3 }' | tr -d \")
66
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
77
arch=$(uname -m)
8-
dist=el$(rpm -q --queryformat '%{VERSION}' centos-release | cut -d. -f1)
9-
if [[ "$dist" == "elpackage centos-release is not installed" ]]; then
10-
dist=el$(rpm -q --queryformat '%{VERSION}' centos-linux-release | cut -d. -f1)
11-
fi
8+
dist=$(rpm --eval '%{?dist}')
129

1310
if [[ "$arch" != "aarch64" ]] && [[ "$arch" != "x86_64" ]]; then
1411
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
3936
sed -i '3d' $DIR/keydb_build/keydb.spec
4037
sed -i -E "2a\Release : $release%{?dist}" $DIR/keydb_build/keydb.spec
4138

42-
mkdir -p /root/rpmbuild/BUILDROOT/keydb-$version-$release.$dist.$arch
43-
cp -r $DIR/keydb_build/keydb_rpm/* /root/rpmbuild/BUILDROOT/keydb-$version-$release.$dist.$arch/
39+
mkdir -p /root/rpmbuild/BUILDROOT/keydb-$version-$release$dist.$arch
40+
cp -r $DIR/keydb_build/keydb_rpm/* /root/rpmbuild/BUILDROOT/keydb-$version-$release$dist.$arch/
4441
rpmbuild -bb $DIR/keydb_build/keydb.spec
4542
mv /root/rpmbuild/RPMS/$arch/* $DIR/rpm_files_generated
4643

0 commit comments

Comments
 (0)