From 07cef419a2d0d7bc536f830bf1fcb6328cfd2ae21e0556c50f99ec93b55bf8de Mon Sep 17 00:00:00 2001 From: Pascal Bleser Date: Tue, 15 Jun 2010 21:21:53 +0000 Subject: [PATCH] better ncurses patch, avoids autoreconf + patch to fix %u for size_t warnings OBS-URL: https://build.opensuse.org/package/show/server:monitoring/ftop?expand=0&rev=2 --- ftop-fix_printf_format.patch | 20 ++++++++++++++++++++ ftop-ncurses.patch | 28 ++++++++++++++++++++++++++++ ftop.changes | 13 +++++++++++++ ftop.spec | 4 ++-- 4 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 ftop-fix_printf_format.patch diff --git a/ftop-fix_printf_format.patch b/ftop-fix_printf_format.patch new file mode 100644 index 0000000..8d1772b --- /dev/null +++ b/ftop-fix_printf_format.patch @@ -0,0 +1,20 @@ +--- src/ftop.c.orig 2010-06-15 23:14:50.000000000 +0200 ++++ src/ftop.c 2010-06-15 23:15:52.000000000 +0200 +@@ -222,7 +222,7 @@ + p_eol(p, part); + + cols = snprintf(tmp_buf, sizeof(tmp_buf), +- "Processes: %u total, %u unreadable", ++ "Processes: %zu total, %zu unreadable", + s->num_processes + s->num_unreadable_processes, + s->num_unreadable_processes); + +@@ -244,7 +244,7 @@ + p_eol(p, part); + + snprintf(tmp_buf, sizeof(tmp_buf), +- "Open Files: %u regular, %u dir, %u chr, %u blk, %u pipe, %u sock, %u misc", ++ "Open Files: %zu regular, %zu dir, %zu chr, %zu blk, %zu pipe, %zu sock, %zu misc", + s->num_reg, s->num_dir, s->num_chr, s->num_blk, s->num_pipe, + s->num_sock, s->num_misc); + diff --git a/ftop-ncurses.patch b/ftop-ncurses.patch index 2a32491..36d7fae 100644 --- a/ftop-ncurses.patch +++ b/ftop-ncurses.patch @@ -9,3 +9,31 @@ # Checks for header files. AC_HEADER_STDC +--- configure.orig 2010-06-15 23:09:48.000000000 +0200 ++++ configure 2010-06-15 23:10:39.000000000 +0200 +@@ -3415,13 +3415,13 @@ + # Checks for libraries. + + +-{ echo "$as_me:$LINENO: checking for initscr in -lcurses" >&5 +-echo $ECHO_N "checking for initscr in -lcurses... $ECHO_C" >&6; } ++{ echo "$as_me:$LINENO: checking for initscr in -lncurses" >&5 ++echo $ECHO_N "checking for initscr in -lncurses... $ECHO_C" >&6; } + if test "${ac_cv_lib_curses_initscr+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lcurses $LIBS" ++LIBS="-lncurses $LIBS" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +@@ -3481,7 +3481,7 @@ + #define HAVE_LIBCURSES 1 + _ACEOF + +- LIBS="-lcurses $LIBS" ++ LIBS="-lncurses $LIBS" + + fi + diff --git a/ftop.changes b/ftop.changes index 2e9db9a..842ec40 100644 --- a/ftop.changes +++ b/ftop.changes @@ -1,5 +1,18 @@ +------------------------------------------------------------------- +Tue Jun 15 21:17:32 UTC 2010 - pascal.bleser@opensuse.org + +- rework the autoconf/ncurses patch to avoid calling autoreconf, + which is breaking on SLE + +- add a patch ("ftop-fix_printf_format.patch") to fix the improper + use of %u for formatting size_t variables in printf (must use %zu + instead): http://code.google.com/p/ftop/issues/detail?id=2 + ------------------------------------------------------------------- Tue Jun 15 19:26:30 UTC 2010 - pascal.bleser@opensuse.org - initial package (1.0) +- buffer overflow patch sent upstream: + http://code.google.com/p/ftop/issues/detail?id=1 + diff --git a/ftop.spec b/ftop.spec index f2c8829..e2f19d0 100644 --- a/ftop.spec +++ b/ftop.spec @@ -7,6 +7,7 @@ Summary: Open File Monitoring Source: http://ftop.googlecode.com/files/ftop-%{version}.tar.bz2 Patch1: ftop-ncurses.patch Patch2: ftop-fix_buffer_overflow.patch +Patch3: ftop-fix_printf_format.patch URL: http://code.google.com/p/ftop/ Group: System/Monitoring License: GNU General Public License version 3 (GPL v3) @@ -27,10 +28,9 @@ items are displayed in order from most to least active. %setup -q %patch1 %patch2 +%patch3 %build -autoreconf -fiv - export CFLAGS="%{optflags} -Wall -DHAVE_LIBCURSES=1" export CPPFLAGS="$CFLAGS" %configure