Add BUILD_DATE patch

- Add upstream patch:
  rrdtool-1.8.0-BUILD_DATE-fix.patch
- Fixes null in the output of the build time:
  rrdtool
  RRDtool 1.8.0  Copyright by Tobias Oetiker <tobi@oetiker.ch>
                 Compiled 22 Mar 2022 00:00:00 (null)
This commit is contained in:
Wolfgang Stöggl 2022-03-27 10:06:40 +02:00
parent 81dce6ed7b
commit 441a49bca1
2 changed files with 62 additions and 1 deletions

View File

@ -0,0 +1,53 @@
From e59f703bbcc0af949ee365206426b6394c340c6f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= <c72578@yahoo.de>
Date: Wed, 23 Mar 2022 17:58:45 +0100
Subject: [PATCH] Fix BUILD_DATE in rrdtool help output
- This is a followup to #1102
- Fixes segfault when running "rrdtool --help"
- Change DATE_FMT to the same date format as the __DATE__ macro [1]:
mmm dd yyyy
[1] https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html
---
configure.ac | 2 +-
src/rrd_tool.c | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 4d234585..5169b0d4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -695,7 +695,7 @@ AC_MSG_RESULT(${COMP_PERL:-No Perl Modules will be built})
# Use reproducible build date and time
if test "$SOURCE_DATE_EPOCH"; then
- DATE_FMT="%d %b %Y %H:%M:%S"
+ DATE_FMT="%b %d %Y %H:%M:%S"
BUILD_DATE=$(LC_ALL=C date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT")
AC_DEFINE_UNQUOTED([BUILD_DATE], ["$BUILD_DATE"], [Use reproducible build date])
fi
diff --git a/src/rrd_tool.c b/src/rrd_tool.c
index 930d0827..cc6119d9 100644
--- a/src/rrd_tool.c
+++ b/src/rrd_tool.c
@@ -45,11 +45,19 @@ static void PrintUsage(
char *cmd)
{
+#ifdef BUILD_DATE
+ const char *help_main =
+ N_("RRDtool %s"
+ " Copyright by Tobias Oetiker <tobi@oetiker.ch>\n"
+ " Compiled %s\n\n"
+ "Usage: rrdtool [options] command command_options\n");
+#else
const char *help_main =
N_("RRDtool %s"
" Copyright by Tobias Oetiker <tobi@oetiker.ch>\n"
" Compiled %s %s\n\n"
"Usage: rrdtool [options] command command_options\n");
+#endif
const char *help_list =
N_

View File

@ -18,7 +18,7 @@
Summary: Round Robin Database Tool to store and display time-series data
Name: rrdtool
Version: 1.8.0
Release: 5%{?dist}
Release: 6%{?dist}
License: GPLv2+ with exceptions
URL: https://oss.oetiker.ch/rrdtool/
Source0: https://github.com/oetiker/rrdtool-1.x/releases/download/v%{version}/%{name}-%{version}.tar.gz
@ -29,6 +29,9 @@ Patch2: rrdtool-1.4.7-php55.patch
Patch3: rrdtool-1.6.0-ruby-2-fix.patch
# enable php bindings on ppc
Patch4: rrdtool-1.4.8-php-ppc-fix.patch
# Fix BUILD_DATE in rrdtool help output
# https://github.com/oetiker/rrdtool-1.x/commit/e59f703
Patch5: rrdtool-1.8.0-BUILD_DATE-fix.patch
BuildRequires: make
BuildRequires: gcc-c++
@ -177,6 +180,7 @@ The %{name}-lua package includes RRDtool bindings for Lua.
%patch3 -p1 -b .ruby-2-fix
%endif
%patch4 -p1 -b .php-ppc-fix
%patch5 -p1 -b .BUILD_DATE-fix
# Fix to find correct python dir on lib64
perl -pi -e 's|get_python_lib\(0,0,prefix|get_python_lib\(1,0,prefix|g' \
@ -405,6 +409,10 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} php -n \
%endif
%changelog
* Fri Dec 02 2022 Wolfgang Stöggl <c72578@yahoo.de> - 1.8.0-6
- Fix BUILD_DATE
Add patch: rrdtool-1.8.0-BUILD_DATE-fix.patch
* Thu Nov 24 2022 FeRD (Frank Dana) <ferdnyc@gmail.com> - 1.8.0-5
- Remove excludes for nonexistent .la files
- Fix Ruby directory lookup