From be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 04:57:58 +0200 Subject: Adding upstream version 1.44.3. Signed-off-by: Daniel Baumann --- packaging/repoconfig/build-rpm.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 packaging/repoconfig/build-rpm.sh (limited to 'packaging/repoconfig/build-rpm.sh') diff --git a/packaging/repoconfig/build-rpm.sh b/packaging/repoconfig/build-rpm.sh new file mode 100755 index 00000000..6c07c661 --- /dev/null +++ b/packaging/repoconfig/build-rpm.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +prefix='/root/rpmbuild' + +if command -v dnf > /dev/null ; then + dnf distro-sync -y --nodocs || exit 1 + dnf install -y --nodocs --setopt=install_weak_deps=False rpm-build || exit 1 +elif command -v yum > /dev/null ; then + yum distro-sync -y || exit 1 + yum install -y rpm-build || exit 1 +elif command -v zypper > /dev/null ; then + zypper update -y || exit 1 + zypper install -y rpm-build || exit 1 + prefix="/usr/src/packages" +fi + +mkdir -p "${prefix}/BUILD" "${prefix}/RPMS" "${prefix}/SRPMS" "${prefix}/SPECS" "${prefix}/SOURCES" || exit 1 +cp -a /netdata/packaging/repoconfig/netdata-repo.spec "${prefix}/SPECS" || exit 1 +cp -a /netdata/packaging/repoconfig/* "${prefix}/SOURCES/" || exit 1 + +rpmbuild -bb --rebuild "${prefix}/SPECS/netdata-repo.spec" || exit 1 + +[ -d /netdata/artifacts ] || mkdir -p /netdata/artifacts +find "${prefix}/RPMS/" -type f -name '*.rpm' -exec cp '{}' /netdata/artifacts \; || exit 1 + +chown -R --reference=/netdata /netdata/artifacts -- cgit v1.2.3