summaryrefslogtreecommitdiffstats
path: root/contrib/rhel/build-netdata-rpm.sh
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2018-03-27 21:28:27 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2018-03-27 21:28:27 +0000
commiteb7cc2640201f168bbd9a05799fd2dbe823bb57c (patch)
tree1f88da02b7ee3c16ced7b5f7dc4aadb190766e7c /contrib/rhel/build-netdata-rpm.sh
parentRelease v. 1.9.0+dfsg-1 to Unstable (diff)
parentNew upstream version 1.10.0+dfsg (diff)
downloadnetdata-eb7cc2640201f168bbd9a05799fd2dbe823bb57c.tar.xz
netdata-eb7cc2640201f168bbd9a05799fd2dbe823bb57c.zip
Update upstream source from tag 'upstream/1.10.0+dfsg'
Update to upstream version '1.10.0+dfsg' with Debian dir fa5485f3d9aea3038a19eff06ba33374ac5c5d7c
Diffstat (limited to 'contrib/rhel/build-netdata-rpm.sh')
-rwxr-xr-xcontrib/rhel/build-netdata-rpm.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/contrib/rhel/build-netdata-rpm.sh b/contrib/rhel/build-netdata-rpm.sh
new file mode 100755
index 000000000..051969091
--- /dev/null
+++ b/contrib/rhel/build-netdata-rpm.sh
@@ -0,0 +1,46 @@
+#!/usr/bin/env bash
+
+# docker run -it --rm centos:6.9 /bin/sh
+# yum -y install rpm-build redhat-rpm-config yum-utils autoconf automake curl gcc git libmnl-devel libuuid-devel make pkgconfig zlib-devel
+
+cd $(dirname $0)/../../ || exit 1
+source "installer/functions.sh" || exit 1
+
+set -e
+
+run ./autogen.sh
+run ./configure --enable-maintainer-mode
+run make dist
+
+version=$(grep PACKAGE_VERSION < config.h | cut -d '"' -f 2)
+if [ -z "${version}" ]
+then
+ echo >&2 "Cannot find netdata version."
+ exit 1
+fi
+
+tgz="netdata-${version}.tar.gz"
+if [ ! -f "${tgz}" ]
+then
+ echo >&2 "Cannot find the generated tar.gz file '${tgz}'"
+ exit 1
+fi
+
+srpm=$(run rpmbuild -ts "${tgz}" | cut -d ' ' -f 2)
+if [ -z "${srpm}" -o ! -f "${srpm}" ]
+then
+ echo >&2 "Cannot find the generated SRPM file '${srpm}'"
+ exit 1
+fi
+
+#if which yum-builddep 2>/dev/null
+#then
+# run yum-builddep "${srpm}"
+#elif which dnf 2>/dev/null
+#then
+# [ "${UID}" = 0 ] && run dnf builddep "${srpm}"
+#fi
+
+run rpmbuild --rebuild "${srpm}"
+
+echo >&2 "All done!"