Skip to content

Commit

Permalink
Update RPM script for Rocky Linux 9
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
teemuke-kk authored and JohnSully committed Mar 8, 2024
1 parent 011fdb4 commit 2cb5d71
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pkg/rpm/generate_rpms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 2cb5d71

Please sign in to comment.