summaryrefslogtreecommitdiff
path: root/user/rrdtool
diff options
context:
space:
mode:
Diffstat (limited to 'user/rrdtool')
-rw-r--r--user/rrdtool/APKBUILD29
-rw-r--r--user/rrdtool/disable-rpn2.patch35
-rw-r--r--user/rrdtool/signedness.patch32
-rw-r--r--user/rrdtool/time64.patch51
4 files changed, 97 insertions, 50 deletions
diff --git a/user/rrdtool/APKBUILD b/user/rrdtool/APKBUILD
index bec89b8ca..2800b01b8 100644
--- a/user/rrdtool/APKBUILD
+++ b/user/rrdtool/APKBUILD
@@ -1,8 +1,8 @@
# Contributor: Valery Kartel <valery.kartel@gmail.com>
-# Maintainer:
+# Maintainer: Zach van Rijn <me@zv.io>
pkgname=rrdtool
-pkgver=1.7.2
-pkgrel=0
+pkgver=1.8.0
+pkgrel=1
pkgdesc="Data logging and graphing application"
url="https://oss.oetiker.ch/rrdtool/"
arch="all"
@@ -13,13 +13,13 @@ makedepends="cairo-dev freetype-dev groff libart-lgpl-dev libpng-dev
libxml2-dev pango-dev perl-dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang perl-rrd:perl_rrd
$pkgname-cached $pkgname-cgi $pkgname-utils librrd:libs"
-source="https://oss.oetiker.ch/$pkgname/pub/$pkgname-$pkgver.tar.gz
- disable-rpn2.patch
+source="https://github.com/oetiker/$pkgname-${pkgver%%.*}.x/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz
rrdcached.initd
+ signedness.patch
+ time64.patch
"
build() {
- cd "$builddir"
./configure \
--build=$CBUILD \
--host=$CHOST \
@@ -33,12 +33,10 @@ build() {
}
check() {
- cd "$builddir"
LANG=C.UTF-8 LC_ALL=C.UTF-8 TZ=UTC make check
}
package() {
- cd "$builddir"
export INSTALLDIRS=vendor
make DESTDIR="$pkgdir" install
find "$pkgdir" -name '.packlist' -delete
@@ -52,7 +50,7 @@ dev() {
}
perl_rrd() {
- depends=
+ depends=""
pkgdesc="Perl interface for rrdtool"
mkdir -p "$subpkgdir"/usr/lib \
"$pkgdir"/usr/share
@@ -61,7 +59,7 @@ perl_rrd() {
}
cached() {
- depends=
+ depends=""
pkgdesc="RRDtool data caching daemon"
mkdir -p "$subpkgdir"/usr/sbin \
"$subpkgdir"/var/lib/rrdcached/db \
@@ -71,14 +69,14 @@ cached() {
}
cgi() {
- depends=
+ depends=""
pkgdesc="Create web pages containing RRD graphs based on templates"
mkdir -p "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/rrdcgi "$subpkgdir"/usr/bin
}
utils() {
- depends=
+ depends=""
pkgdesc="RRDtool standalone utilities"
mkdir -p "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/rrdinfo \
@@ -87,6 +85,7 @@ utils() {
"$subpkgdir"/usr/bin
}
-sha512sums="453230efc68aeb4a12842d20a9d246ba478a79c2f6bfd9693a91837c1c1136abe8af177be64fe29aa40bf84ccfce7f2f15296aefe095e89b8b62aef5a7623e29 rrdtool-1.7.2.tar.gz
-47fbfa1ee974d607c15d7a49b1007ccfb6dcd2764f82236f8741b96fe1c3cdec8535f570116a2b24767e09c018177bd5ace4f2ceb39342b2baf3baec01a35dc1 disable-rpn2.patch
-c0c27b2c2dfa8e7ec1cb1160d2bda8d7996bbea67f4ce7779da029f583c35e5e415cf46e2a1e5cb8ed2e63d2c58a68fd7471ee6bd820db4c0f4eeeb5c252f8a3 rrdcached.initd"
+sha512sums="8ae6f94d119e8d0e1ba7f2d0738f1ba008a4880d1022f1c0c5436f662d961fceec5c42e01c241493ece3d6f55c60fd7d1d264f93e678f3cf1251201dcde027c1 rrdtool-1.8.0.tar.gz
+c0c27b2c2dfa8e7ec1cb1160d2bda8d7996bbea67f4ce7779da029f583c35e5e415cf46e2a1e5cb8ed2e63d2c58a68fd7471ee6bd820db4c0f4eeeb5c252f8a3 rrdcached.initd
+da1218051c10c86bf19a1e2435f69dc072f231d22513bc474491bd7901427921be5ba1ff889166e9f9b3a95473055d64dfbc53d477da8b6446de2d5901ff78e6 signedness.patch
+aa119ea9a9b819b6d51b3a4351f26a34f0d4fdfeb28ee8f1b20a16ca8b9b1f6a6b85012fc53e40cc6ddee4dc0006b095476363f54e8c856b39da2ed7f4a0b8d9 time64.patch"
diff --git a/user/rrdtool/disable-rpn2.patch b/user/rrdtool/disable-rpn2.patch
deleted file mode 100644
index 1baed862c..000000000
--- a/user/rrdtool/disable-rpn2.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-https://github.com/oetiker/rrdtool-1.x/issues/1012
---- rrdtool-1.7.2/tests/Makefile.in.old 2019-05-27 18:46:42.000000000 +0000
-+++ rrdtool-1.7.2/tests/Makefile.in 2019-06-04 06:27:36.143871636 +0000
-@@ -537,7 +537,7 @@
- top_builddir = @top_builddir@
- top_srcdir = @top_srcdir@
- TESTS = modify1 modify2 modify3 modify4 modify5 \
-- tune1 tune2 graph1 rpn1 rpn2 \
-+ tune1 tune2 graph1 rpn1 \
- rrdcreate \
- dump-restore \
- create-with-source-1 create-with-source-2 create-with-source-3 \
-@@ -555,7 +555,7 @@
- rrdcreate \
- tune1-testa-mod1.dump tune1-testa-mod2.dump tune1-testorg.dump \
- tune2-testa-mod1.dump tune2-testorg.dump \
-- valgrind-supressions dcounter1 dcounter1.output graph1.output vformatter1 rpn1.output rpn2.output \
-+ valgrind-supressions dcounter1 dcounter1.output graph1.output vformatter1 rpn1.output \
- xport1.json.output xport1.xml.output \
- pdp-calc1 pdp-calc1-1-avg-60.output pdp-calc1-1-avg-300.output pdp-calc1-1-max-300.output
-
-@@ -820,13 +820,6 @@
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
-- "$$tst" $(AM_TESTS_FD_REDIRECT)
--rpn2.log: rpn2
-- @p='rpn2'; \
-- b='rpn2'; \
-- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
-- --log-file $$b.log --trs-file $$b.trs \
-- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
- rrdcreate.log: rrdcreate
- @p='rrdcreate'; \
diff --git a/user/rrdtool/signedness.patch b/user/rrdtool/signedness.patch
new file mode 100644
index 000000000..ad3451d9f
--- /dev/null
+++ b/user/rrdtool/signedness.patch
@@ -0,0 +1,32 @@
+From b74a0d64e00770384d025e40becdb2ed83c04c0c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= <c72578@yahoo.de>
+Date: Fri, 1 Apr 2022 19:14:49 +0200
+Subject: [PATCH] Fix unsigned integer overflow in rrdtool first
+
+This fixes a signed/unsigned conversion bug in the calculation of
+"then". Background info:
+pdp_cnt and pdp_step are both unsigned long, whereas timer is signed.
+When multiplying signed and unsigned integers (same size), a signed is
+implicitly typecast to unsigned.
+
+- A similar fix has already been applied to rrd_dump.c
+ in commit e193975
+- Resolves #1140
+---
+ src/rrd_first.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/rrd_first.c b/src/rrd_first.c
+index 0e93397c3..a696c5c38 100644
+--- a/src/rrd_first.c
++++ b/src/rrd_first.c
+@@ -113,7 +113,8 @@ time_t rrd_first_r(
+ then = (rrd.live_head->last_up -
+ rrd.live_head->last_up %
+ (rrd.rra_def[rraindex].pdp_cnt * rrd.stat_head->pdp_step)) +
+- (timer * rrd.rra_def[rraindex].pdp_cnt * rrd.stat_head->pdp_step);
++ (timer * (long) rrd.rra_def[rraindex].pdp_cnt *
++ (long) rrd.stat_head->pdp_step);
+ err_close:
+ rrd_close(rrd_file);
+ err_free:
diff --git a/user/rrdtool/time64.patch b/user/rrdtool/time64.patch
new file mode 100644
index 000000000..5f5eea43e
--- /dev/null
+++ b/user/rrdtool/time64.patch
@@ -0,0 +1,51 @@
+--- rrdtool-1.8.0/src/rrd_graph_helper.c.old 2022-03-14 14:30:12.000000000 +0000
++++ rrdtool-1.8.0/src/rrd_graph_helper.c 2022-12-10 23:14:10.132482183 +0000
+@@ -1901,7 +1901,7 @@
+ dprintf("SHIFTBY : %s (%i)\n", im->gdes[gdp->shidx].vname,
+ gdp->shidx);
+ } else {
+-#if defined _WIN32 && SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
++#if SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
+ dprintf("SHIFTBY : %lli\n", gdp->shval); /* argument 3 has type 'time_t {aka long long int}' */
+ #else
+ dprintf("SHIFTBY : %li\n", gdp->shval);
+--- rrdtool-1.8.0/src/rrd_lastupdate.c.old 2022-03-14 14:30:12.000000000 +0000
++++ rrdtool-1.8.0/src/rrd_lastupdate.c 2022-12-10 23:14:48.138375888 +0000
+@@ -77,7 +77,7 @@
+ printf(" %s", ds_names[i]);
+ printf ("\n\n");
+
+-#if defined _WIN32 && SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
++#if SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
+ printf ("%10llu:", last_update); /* argument 2 has type 'time_t {aka long long int} */
+ #else
+ printf ("%10lu:", last_update);
+--- rrdtool-1.8.0/src/rrd_tool.c.old 2022-03-14 14:30:12.000000000 +0000
++++ rrdtool-1.8.0/src/rrd_tool.c 2022-12-10 23:14:38.579408674 +0000
+@@ -723,7 +723,7 @@
+ else if (strcmp("resize", argv[1]) == 0)
+ rrd_resize(argc - 1, &argv[1]);
+ else if (strcmp("last", argv[1]) == 0)
+-#if defined _WIN32 && SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
++#if SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
+ printf("%lld\n", rrd_last(argc - 1, &argv[1]));
+ #else
+ printf("%ld\n", rrd_last(argc - 1, &argv[1]));
+@@ -731,7 +731,7 @@
+ else if (strcmp("lastupdate", argv[1]) == 0) {
+ rrd_lastupdate(argc - 1, &argv[1]);
+ } else if (strcmp("first", argv[1]) == 0)
+-#if defined _WIN32 && SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
++#if SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
+ printf("%lld\n", rrd_first(argc - 1, &argv[1]));
+ #else
+ printf("%ld\n", rrd_first(argc - 1, &argv[1]));
+@@ -753,7 +753,7 @@
+ printf("%20s", ds_namv[i]);
+ printf("\n\n");
+ for (ti = start + step; ti <= end; ti += step) {
+-#if defined _WIN32 && SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
++#if SIZEOF_TIME_T == 8 /* in case of __MINGW64__, _WIN64 and _MSC_VER >= 1400 (ifndef _USE_32BIT_TIME_T) */
+ printf("%10llu:", ti);
+ #else
+ printf("%10lu:", ti);