diff --git a/.gitignore b/.gitignore index 41799de..fe4d6ba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ htop-0.8.3.tar.gz /htop-0.9.tar.gz +/htop-1.0.tar.gz diff --git a/htop-0.9-system-plpa.patch b/htop-0.9-system-plpa.patch deleted file mode 100644 index 7422cad..0000000 --- a/htop-0.9-system-plpa.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff -up htop-0.8.3/acinclude.m4.noplpa htop-0.8.3/acinclude.m4 ---- htop-0.8.3/acinclude.m4.noplpa 2010-03-04 15:35:47.457908679 -0500 -+++ htop-0.8.3/acinclude.m4 2010-03-04 15:35:50.721919708 -0500 -@@ -1 +0,0 @@ --m4_include(plpa-1.3.2/plpa.m4) -diff -up htop-0.8.3/Makefile.am.noplpa htop-0.8.3/Makefile.am ---- htop-0.8.3/Makefile.am.noplpa 2009-06-02 15:17:57.000000000 -0400 -+++ htop-0.8.3/Makefile.am 2010-03-04 15:34:41.579909477 -0500 -@@ -1,8 +1,4 @@ - --if HAVE_PLPA --SUBDIRS = plpa-1.3.2 --endif -- - ACLOCAL_AMFLAGS=-I m4 - - bin_PROGRAMS = htop -@@ -35,9 +35,6 @@ - - BUILT_SOURCES = $(myhtopheaders) - htop_SOURCES = $(myhtopheaders) $(myhtopsources) config.h debug.h --if HAVE_PLPA --htop_LDADD = $(top_builddir)/plpa-1.3.2/src/libplpa/libplpa_included.la --endif - - profile: - $(MAKE) all CFLAGS="-pg -O2" ---- htop-0.9/configure.ac.orig 2011-03-05 13:45:09.000000000 +0100 -+++ htop-0.9/configure.ac 2011-03-05 13:45:29.000000000 +0100 -@@ -104,14 +104,7 @@ - AC_CHECK_FILE($PROCDIR/stat,,AC_MSG_ERROR(Cannot find /proc/stat. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help.)) - AC_CHECK_FILE($PROCDIR/meminfo,,AC_MSG_ERROR(Cannot find /proc/meminfo. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help.)) - --AC_ARG_ENABLE(plpa, [AC_HELP_STRING([--enable-plpa], [enable PLPA support for CPU affinity])], ,enable_plpa="yes") --PLPA_INCLUDED --PLPA_INIT([plpa-1.3.2], [plpa_happy=yes], [plpa_happy=no]) --AM_CONDITIONAL([HAVE_PLPA], [test "$plpa_happy" = "yes" && test "$enable_plpa" = "yes"]) --if test "$plpa_happy" = "yes" && test "$enable_plpa" = "yes" --then -- AC_DEFINE([HAVE_PLPA], [1], [Have plpa]) --fi -+AC_CHECK_LIB([plpa], [plpa_sched_getaffinity], [], [missing_libraries="$missing_libraries libplpa"]) - - AC_CONFIG_FILES([Makefile htop.1]) - AC_OUTPUT diff --git a/htop-0.9-libpagemap.patch b/htop-1.0-libpagemap.patch similarity index 72% rename from htop-0.9-libpagemap.patch rename to htop-1.0-libpagemap.patch index b7cc27f..051e815 100644 --- a/htop-0.9-libpagemap.patch +++ b/htop-1.0-libpagemap.patch @@ -1,7 +1,7 @@ -diff -ru --exclude=config.h htop-0.9/configure.ac htop-0.9-patched/configure.ac ---- htop-0.9/configure.ac 2010-11-23 16:56:32.000000000 +0100 -+++ htop-0.9-patched/configure.ac 2011-03-09 16:58:38.471801331 +0100 -@@ -18,11 +18,13 @@ +diff -Naur htop-1.0/configure.ac.orig htop-1.0/configure.ac +--- htop-1.0/configure.ac.orig 2011-11-21 03:46:48.000000000 +0100 ++++ htop-1.0/configure.ac 2012-02-07 17:21:59.098852884 +0100 +@@ -23,11 +23,13 @@ # Checks for libraries. AC_CHECK_LIB([m], [ceil], [], [missing_libraries="$missing_libraries libm"]) @@ -15,36 +15,36 @@ diff -ru --exclude=config.h htop-0.9/configure.ac htop-0.9-patched/configure.ac +AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h curses.h pthread.h],[:],[ missing_headers="$missing_headers $ac_header" ]) - -diff -ru --exclude=config.h htop-0.9/htop.1 htop-0.9-patched/htop.1 ---- htop-0.9/htop.1 2010-11-23 17:34:04.000000000 +0100 -+++ htop-0.9-patched/htop.1 2011-03-09 16:44:07.065449472 +0100 -@@ -25,6 +25,9 @@ - \fB\-u USERNAME\fR - Show only processes of a given user + AC_CHECK_HEADERS([execinfo.h],[:],[:]) +diff -Naur htop-1.0/htop.1.orig htop-1.0/htop.1 +--- htop-1.0/htop.1.orig 2012-02-07 17:28:48.935889755 +0100 ++++ htop-1.0/htop.1 2012-02-07 17:27:44.087881744 +0100 +@@ -32,6 +32,9 @@ + \fB\-u \-\-user=USERNAME\fR + Show only the processes of a given user .TP +\fB\-p\fR +Start working thread for pagemap memory stats +.TP - \fB\-\-sort\-key COLUMN\fR - Sort by this column (use --sort-key help for a column list) - .PP -diff -ru --exclude=config.h htop-0.9/htop.1.in htop-0.9-patched/htop.1.in ---- htop-0.9/htop.1.in 2010-06-17 21:03:41.000000000 +0200 -+++ htop-0.9-patched/htop.1.in 2011-03-09 16:44:07.066449478 +0100 -@@ -25,6 +25,9 @@ - \fB\-u USERNAME\fR - Show only processes of a given user + \fB\-s \-\-sort\-key COLUMN\fR + Sort by this column (use \-\-sort\-key help for a column list) + .TP +diff -Naur htop-1.0/htop.1.in.orig htop-1.0/htop.1.in +--- htop-1.0/htop.1.in.orig 2011-09-27 01:59:36.000000000 +0200 ++++ htop-1.0/htop.1.in 2012-02-07 17:25:23.161867112 +0100 +@@ -32,6 +32,9 @@ + \fB\-u \-\-user=USERNAME\fR + Show only the processes of a given user .TP +\fB\-p\fR +Start working thread for pagemap memory stats +.TP - \fB\-\-sort\-key COLUMN\fR - Sort by this column (use --sort-key help for a column list) - .PP -diff -ru --exclude=config.h htop-0.9/htop.c htop-0.9-patched/htop.c ---- htop-0.9/htop.c 2010-11-24 19:45:38.000000000 +0100 -+++ htop-0.9-patched/htop.c 2011-03-09 16:44:07.067449482 +0100 + \fB\-s \-\-sort\-key COLUMN\fR + Sort by this column (use \-\-sort\-key help for a column list) + .TP +diff -Naur htop-1.0/htop.c.orig htop-1.0/htop.c +--- htop-1.0/htop.c.orig 2011-11-21 03:48:11.000000000 +0100 ++++ htop-1.0/htop.c 2012-02-07 17:36:15.348965585 +0100 @@ -13,6 +13,7 @@ #include #include @@ -53,7 +53,7 @@ diff -ru --exclude=config.h htop-0.9/htop.c htop-0.9-patched/htop.c #include "ProcessList.h" #include "CRT.h" -@@ -52,6 +53,9 @@ +@@ -51,6 +52,9 @@ "-C --no-color Use a monochrome color scheme\n" "-d --delay=DELAY Set the delay between updates, in tenths of seconds\n" "-h --help Print this help screen\n" @@ -63,7 +63,7 @@ diff -ru --exclude=config.h htop-0.9/htop.c htop-0.9-patched/htop.c "-s --sort-key=COLUMN Sort by COLUMN (try --sort-key=help for a list)\n" "-u --user=USERNAME Show only processes of a given user\n" "-v --version Print version info\n" -@@ -244,12 +248,23 @@ +@@ -238,6 +242,16 @@ ProcessList_printHeader(pl, Panel_getHeader(panel)); } @@ -77,17 +77,18 @@ diff -ru --exclude=config.h htop-0.9/htop.c htop-0.9-patched/htop.c +} +#endif + - int main(int argc, char** argv) { - - int delay = -1; + typedef struct IncBuffer_ { + char buffer[INCSEARCH_MAX]; + int index; +@@ -255,6 +269,7 @@ bool userOnly = false; uid_t userId = 0; int usecolors = 1; + int pagemap_enable = 0; + TreeType treeType = TREE_TYPE_AUTO; int opt, opti=0; - static struct option long_opts[] = -@@ -261,6 +276,9 @@ +@@ -267,6 +282,9 @@ {"user", required_argument, 0, 'u'}, {"no-color", no_argument, 0, 'C'}, {"no-colour",no_argument, 0, 'C'}, @@ -97,16 +98,16 @@ diff -ru --exclude=config.h htop-0.9/htop.c htop-0.9-patched/htop.c {0,0,0,0} }; int sortKey = 0; -@@ -272,7 +290,7 @@ - setlocale(LC_CTYPE, getenv("LC_ALL")); +@@ -280,7 +298,7 @@ + setlocale(LC_CTYPE, ""); /* Parse arguments */ -- while ((opt = getopt_long_only(argc, argv, "hvCs:d:u:", long_opts, &opti))) { -+ while ((opt = getopt_long_only(argc, argv, "hpvCs:d:u:", long_opts, &opti))) { +- while ((opt = getopt_long(argc, argv, "hvCs:d:u:", long_opts, &opti))) { ++ while ((opt = getopt_long(argc, argv, "hpvCs:d:u:", long_opts, &opti))) { if (opt == EOF) break; switch (opt) { case 'h': -@@ -305,6 +323,11 @@ +@@ -320,6 +338,11 @@ case 'C': usecolors=0; break; @@ -115,11 +116,11 @@ diff -ru --exclude=config.h htop-0.9/htop.c htop-0.9-patched/htop.c + pagemap_enable=1; + break; +#endif + default: + exit(1); } - } - -@@ -379,6 +402,18 @@ - int ch = 0; +@@ -432,6 +455,18 @@ + int ch = ERR; int closeTimeout = 0; +#ifdef HAVE_LIBPAGEMAP @@ -137,7 +138,7 @@ diff -ru --exclude=config.h htop-0.9/htop.c htop-0.9-patched/htop.c while (!quit) { gettimeofday(&tv, NULL); newTime = ((double)tv.tv_sec * 10) + ((double)tv.tv_usec / 100000); -@@ -817,6 +852,12 @@ +@@ -912,6 +947,12 @@ if (settings->changed) Settings_write(settings); Header_delete(header); @@ -148,8 +149,8 @@ diff -ru --exclude=config.h htop-0.9/htop.c htop-0.9-patched/htop.c + } +#endif ProcessList_delete(pl); - FunctionBar_delete((Object*)searchBar); - FunctionBar_delete((Object*)defaultBar); + FunctionBar_delete((Object*)incFilter.bar); + FunctionBar_delete((Object*)incSearch.bar); diff -ru --exclude=config.h htop-0.9/htop.h htop-0.9-patched/htop.h --- htop-0.9/htop.h 2010-11-24 19:45:40.000000000 +0100 +++ htop-0.9-patched/htop.h 2011-03-09 16:48:37.672644570 +0100 @@ -163,9 +164,9 @@ diff -ru --exclude=config.h htop-0.9/htop.h htop-0.9-patched/htop.h #include "ProcessList.h" #include "CRT.h" -diff -ru --exclude=config.h htop-0.9/Process.c htop-0.9-patched/Process.c ---- htop-0.9/Process.c 2010-11-23 16:56:32.000000000 +0100 -+++ htop-0.9-patched/Process.c 2011-03-09 16:44:07.069449489 +0100 +diff -Naur htop-1.0/Process.c.orig htop-1.0/Process.c +--- htop-1.0/Process.c.orig 2011-11-21 03:47:49.000000000 +0100 ++++ htop-1.0/Process.c 2012-02-07 17:41:02.322032224 +0100 @@ -72,6 +72,9 @@ #ifdef HAVE_CGROUP CGROUP, @@ -215,14 +216,14 @@ diff -ru --exclude=config.h htop-0.9/Process.c htop-0.9-patched/Process.c "*** report bug! ***" }; -@@ -393,6 +405,32 @@ - case M_SIZE: Process_printLargeNumber(this, str, this->m_size * PAGE_SIZE_KB); return; - case M_RESIDENT: Process_printLargeNumber(this, str, this->m_resident * PAGE_SIZE_KB); return; - case M_SHARE: Process_printLargeNumber(this, str, this->m_share * PAGE_SIZE_KB); return; +@@ -440,6 +452,32 @@ + case M_SIZE: Process_humanNumber(this, str, this->m_size * PAGE_SIZE_KB); return; + case M_RESIDENT: Process_humanNumber(this, str, this->m_resident * PAGE_SIZE_KB); return; + case M_SHARE: Process_humanNumber(this, str, this->m_share * PAGE_SIZE_KB); return; + #ifdef HAVE_LIBPAGEMAP + case M_USS: + if (Process_getuid == 0 && this->pl->pagemap_table != NULL) { -+ Process_printLargeNumber(this, str, this->m_uss * PAGE_SIZE_KB); ++ Process_humanNumber(this, str, this->m_uss * PAGE_SIZE_KB); + return; + } else { + snprintf(buffer, n, " - "); @@ -230,7 +231,7 @@ diff -ru --exclude=config.h htop-0.9/Process.c htop-0.9-patched/Process.c + break; + case M_PSS: + if (Process_getuid == 0 && this->pl->pagemap_table != NULL) { -+ Process_printLargeNumber(this, str, this->m_pss * PAGE_SIZE_KB); ++ Process_humanNumber(this, str, this->m_pss * PAGE_SIZE_KB); + return; + } else { + snprintf(buffer, n, " - "); @@ -238,7 +239,7 @@ diff -ru --exclude=config.h htop-0.9/Process.c htop-0.9-patched/Process.c + break; + case M_SWAP: + if ((Process_getuid == 0 || Process_getuid == this->st_uid) && this->pl->pagemap_table != NULL) { -+ Process_printLargeNumber(this, str, this->m_swap * PAGE_SIZE_KB); ++ Process_humanNumber(this, str, this->m_swap * PAGE_SIZE_KB); + return; + } else { + snprintf(buffer, n, " - "); @@ -248,7 +249,7 @@ diff -ru --exclude=config.h htop-0.9/Process.c htop-0.9-patched/Process.c case ST_UID: snprintf(buffer, n, "%4d ", this->st_uid); break; case USER: { if (Process_getuid != (int) this->st_uid) -@@ -583,6 +621,14 @@ +@@ -677,6 +715,14 @@ return (p2->m_resident - p1->m_resident); case M_SHARE: return (p2->m_share - p1->m_share); @@ -295,9 +296,9 @@ diff -ru --exclude=config.h htop-0.9/Process.h htop-0.9-patched/Process.h uid_t st_uid; float percent_cpu; float percent_mem; -diff -ru --exclude=config.h htop-0.9/ProcessList.c htop-0.9-patched/ProcessList.c ---- htop-0.9/ProcessList.c 2010-11-26 17:50:25.000000000 +0100 -+++ htop-0.9-patched/ProcessList.c 2011-03-09 16:44:07.071449495 +0100 +diff -Naur htop-1.0/ProcessList.c.orig htop-1.0/ProcessList.c +--- htop-1.0/ProcessList.c.orig 2011-11-21 03:47:37.000000000 +0100 ++++ htop-1.0/ProcessList.c 2012-02-07 17:43:52.289077822 +0100 @@ -10,6 +10,9 @@ #include "config.h" #endif @@ -316,28 +317,28 @@ diff -ru --exclude=config.h htop-0.9/ProcessList.c htop-0.9-patched/ProcessList. #include "debug.h" #include -@@ -125,6 +129,10 @@ - bool highlightThreads; - bool detailedCPUTime; +@@ -148,6 +152,10 @@ + bool countCPUsFromZero; + const char **treeStr; +#ifdef HAVE_LIBPAGEMAP + pagemap_tbl * pagemap_table; +#endif + } ProcessList; - }*/ -@@ -177,6 +185,9 @@ - this->highlightBaseName = false; - this->highlightMegabytes = false; + }*/ +@@ -230,6 +238,9 @@ this->detailedCPUTime = false; + this->countCPUsFromZero = false; + this->treeStr = NULL; +#ifdef HAVE_LIBPAGEMAP + this->pagemap_table = NULL; -+#endif ++#endif return this; } -@@ -429,6 +440,29 @@ +@@ -496,6 +507,29 @@ return (num == 7); } @@ -367,7 +368,7 @@ diff -ru --exclude=config.h htop-0.9/ProcessList.c htop-0.9-patched/ProcessList. #ifdef HAVE_OPENVZ static void ProcessList_readOpenVZData(Process* process, const char* dirname, const char* name) { -@@ -589,6 +623,11 @@ +@@ -660,6 +694,11 @@ if (! ProcessList_readStatmFile(process, dirname, name)) goto errorReadingProcess; @@ -379,9 +380,9 @@ diff -ru --exclude=config.h htop-0.9/ProcessList.c htop-0.9-patched/ProcessList. process->show = ! ((hideKernelThreads && Process_isKernelThread(process)) || (hideUserlandThreads && Process_isUserlandThread(process))); char command[MAX_NAME+1]; -diff -ru --exclude=config.h htop-0.9/ProcessList.h htop-0.9-patched/ProcessList.h ---- htop-0.9/ProcessList.h 2010-11-26 17:51:25.000000000 +0100 -+++ htop-0.9-patched/ProcessList.h 2011-03-09 16:44:07.072449499 +0100 +diff -Naur htop-1.0/ProcessList.h.orig htop-1.0/ProcessList.h +--- htop-1.0/ProcessList.h.orig 2011-11-21 03:49:01.000000000 +0100 ++++ htop-1.0/ProcessList.h 2012-02-07 17:45:46.224110828 +0100 @@ -14,6 +14,9 @@ #include "config.h" #endif @@ -400,9 +401,9 @@ diff -ru --exclude=config.h htop-0.9/ProcessList.h htop-0.9-patched/ProcessList. #include "debug.h" #include -@@ -125,6 +129,10 @@ - bool highlightThreads; - bool detailedCPUTime; +@@ -150,6 +154,10 @@ + bool countCPUsFromZero; + const char **treeStr; +#ifdef HAVE_LIBPAGEMAP + pagemap_tbl * pagemap_table; @@ -410,8 +411,8 @@ diff -ru --exclude=config.h htop-0.9/ProcessList.h htop-0.9-patched/ProcessList. + } ProcessList; - ProcessList* ProcessList_new(UsersTable* usersTable); -@@ -145,6 +153,10 @@ + +@@ -175,6 +183,10 @@ #endif diff --git a/htop.spec b/htop.spec index 4526b01..ccd8714 100644 --- a/htop.spec +++ b/htop.spec @@ -1,14 +1,12 @@ Name: htop -Version: 0.9 -Release: 4%{?dist} +Version: 1.0 +Release: 1%{?dist} Summary: Interactive process viewer Group: Applications/System License: GPL+ URL: http://htop.sourceforge.net/ Source0: http://download.sourceforge.net/htop/%{name}-%{version}.tar.gz -# Use system plpa -Patch3: htop-0.9-system-plpa.patch # Patch by Petr Holasek (pholasek@redhat.com) # Filed into upstream bugtracker: # http://sourceforge.net/tracker/?func=detail&aid=3169589&group_id=108839&atid=651635 @@ -16,7 +14,7 @@ Patch4: htop-0.9-libpagemap.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: desktop-file-utils -BuildRequires: ncurses-devel, python, libtool, plpa-devel, libpagemap-devel +BuildRequires: ncurses-devel, python, libtool, libpagemap-devel %description htop is an interactive text-mode process viewer for Linux, similar to @@ -24,16 +22,13 @@ top(1). %prep %setup -q -%patch3 -p1 -b .noplpa -%patch4 -p1 +%patch4 -p1 -b.pgmap sed -i s#"INSTALL_DATA = @INSTALL_DATA@"#"INSTALL_DATA = @INSTALL_DATA@ -p"# Makefile.in -# We will use the plpa system copy instead. -rm -rf plpa-1.1/ -autoreconf -i %build -%configure +%configure --enable-openvz --enable-vserver --enable-taskstats \ + --enable-unicode --enable-native-affinity --enable-cgroup make %{?_smp_mflags} %install @@ -49,13 +44,19 @@ rm -rf $RPM_BUILD_ROOT%{_datadir}/applications/ %files %defattr(-,root,root,-) -%doc AUTHORS COPYING ChangeLog README TODO +%doc AUTHORS COPYING ChangeLog README %{_bindir}/htop %{_datadir}/pixmaps/htop.png %{_mandir}/man1/htop.1* %changelog +* Tue Feb 07 2012 Miloš Jakubíček - 1.0-1 +- Update to 1.0 +- Build with --enable-openvz --enable-vserver --enable-taskstats + --enable-unicode --enable-native-affinity --enable-cgroup +- Drop htop-0.9-system-plpa.patch (no PLPA needed anymore) + * Fri Jan 13 2012 Fedora Release Engineering - 0.9-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild diff --git a/sources b/sources index f78e644..cc11c26 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -7c5507f35f363f3f40183a2ba3c561f8 htop-0.9.tar.gz +325112ca7947ea1f6d6441f631e00384 htop-1.0.tar.gz