From c2b220ee26c39ff2cdbd60c1e844e75fd93cc68f Mon Sep 17 00:00:00 2001 From: Jaromir Capik Date: Wed, 7 Aug 2013 16:30:18 +0200 Subject: [PATCH] - Support for libselinux (#975459) - Support for systemd (#994457) - Support for 'Shmem' in free (#993271) --- procps-ng-3.3.8-free-shmem.patch | 38 +++++++++++++++++++++++++ procps-ng-3.3.8-libselinux.patch | 48 ++++++++++++++++++++++++++++++++ procps-ng.spec | 21 +++++++++++--- 3 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 procps-ng-3.3.8-free-shmem.patch create mode 100644 procps-ng-3.3.8-libselinux.patch diff --git a/procps-ng-3.3.8-free-shmem.patch b/procps-ng-3.3.8-free-shmem.patch new file mode 100644 index 0000000..6582934 --- /dev/null +++ b/procps-ng-3.3.8-free-shmem.patch @@ -0,0 +1,38 @@ +diff --git a/free.1 b/free.1 +index f7c2313..1e8e7ef 100644 +--- a/free.1 ++++ b/free.1 +@@ -11,8 +11,11 @@ free \- Display amount of free and used memory in the system + .SH DESCRIPTION + .B free + displays the total amount of free and used physical and swap memory in the +-system, as well as the buffers used by the kernel. The shared memory column +-should be ignored; it is obsolete. ++system, as well as the buffers used by the kernel. ++The shared memory column represents either the MemShared value (2.4 series ++kernels) or the Shmem value (2.6 series kernels and later) taken from the ++/proc/meminfo file. The value is zero if none of the entries is exported ++by the kernel. + .SH OPTIONS + .TP + \fB\-b\fR, \fB\-\-bytes\fR +diff --git a/proc/sysinfo.c b/proc/sysinfo.c +index 15cdb83..8e4aca2 100644 +--- a/proc/sysinfo.c ++++ b/proc/sysinfo.c +@@ -629,13 +629,14 @@ void meminfo(void){ + {"LowTotal", &kb_low_total}, + {"Mapped", &kb_mapped}, // kB version of vmstat nr_mapped + {"MemFree", &kb_main_free}, // important +- {"MemShared", &kb_main_shared}, // important, but now gone! ++ {"MemShared", &kb_main_shared}, // obsolete since kernel 2.6! (sharing the variable with Shmem replacement) + {"MemTotal", &kb_main_total}, // important + {"NFS_Unstable", &kb_nfs_unstable}, + {"PageTables", &kb_pagetables}, // kB version of vmstat nr_page_table_pages + {"ReverseMaps", &nr_reversemaps}, // same as vmstat nr_page_table_pages + {"SReclaimable", &kb_swap_reclaimable}, // "swap reclaimable" (dentry and inode structures) + {"SUnreclaim", &kb_swap_unreclaimable}, ++ {"Shmem", &kb_main_shared}, // sharing the output variable with obsolete MemShared (kernel 2.6 and later) + {"Slab", &kb_slab}, // kB version of vmstat nr_slab + {"SwapCached", &kb_swap_cached}, + {"SwapFree", &kb_swap_free}, // important diff --git a/procps-ng-3.3.8-libselinux.patch b/procps-ng-3.3.8-libselinux.patch new file mode 100644 index 0000000..e3f1246 --- /dev/null +++ b/procps-ng-3.3.8-libselinux.patch @@ -0,0 +1,48 @@ +diff -Naur procps-ng-3.3.8.orig/configure.ac procps-ng-3.3.8/configure.ac +--- procps-ng-3.3.8.orig/configure.ac 2013-05-25 23:39:39.000000000 +0200 ++++ procps-ng-3.3.8/configure.ac 2013-08-06 19:53:49.595654086 +0200 +@@ -111,6 +111,14 @@ + AC_DEFINE([WITH_WATCH8BIT], [1], [Enable 8 bit clean watch]) + fi + ++AC_ARG_ENABLE([libselinux], ++ AS_HELP_STRING([--enable-libselinux], [enable libselinux]), ++ [enable_libselinux=$enableval], ++ [enable_libselinux="no"]) ++if test "$enable_libselinux" = "yes"; then ++ AC_DEFINE([ENABLE_LIBSELINUX], [1], [Enable libselinux]) ++fi ++ + # Optional packages - AC_ARG_WITH + AC_ARG_WITH([ncurses], + AS_HELP_STRING([--without-ncurses], [build only applications not needing ncurses]), +diff -Naur procps-ng-3.3.8.orig/ps/output.c procps-ng-3.3.8/ps/output.c +--- procps-ng-3.3.8.orig/ps/output.c 2013-05-25 23:39:40.000000000 +0200 ++++ procps-ng-3.3.8/ps/output.c 2013-08-06 19:55:32.477650664 +0200 +@@ -1282,6 +1282,8 @@ + /****************** FLASK & seLinux security stuff **********************/ + // move the bulk of this to libproc sometime + ++#if !ENABLE_LIBSELINUX ++ + static int pr_context(char *restrict const outbuf, const proc_t *restrict const pp){ + char filename[48]; + size_t len; +@@ -1310,7 +1312,8 @@ + return 1; + } + +-#if 0 ++#else ++ + // This needs more study, considering: + // 1. the static linking option (maybe disable this in that case) + // 2. the -z and -Z option issue +@@ -1345,6 +1348,7 @@ + } + return len; + } ++ + #endif + + diff --git a/procps-ng.spec b/procps-ng.spec index 6ab2b34..65133f2 100644 --- a/procps-ng.spec +++ b/procps-ng.spec @@ -1,10 +1,10 @@ -# testsuite is unsuitable for running on buildsystems +# The testsuite is unsuitable for running on buildsystems %global tests_enabled 0 Summary: System and process monitoring utilities Name: procps-ng Version: 3.3.8 -Release: 10%{?dist} +Release: 11%{?dist} License: GPLv2+ and LGPLv2+ Group: Applications/System URL: https://sourceforge.net/projects/procps-ng/ @@ -17,15 +17,20 @@ Patch2: 0001-top-enable-screen-contents-preservation-at-end-of-jo.patch Patch3: 0001-top-refine-some-miscellaneous-signals-interrupt-stuf.patch Patch4: 0002-top-cursor-repositioning-includes-line-oriented-inpu.patch Patch5: procps-ng-3.3.8-RH-man-page-check.patch +Patch6: procps-ng-3.3.8-libselinux.patch +Patch7: procps-ng-3.3.8-free-shmem.patch Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig +Requires: systemd-libs + BuildRequires: ncurses-devel BuildRequires: libtool BuildRequires: autoconf BuildRequires: automake BuildRequires: gettext-devel +BuildRequires: systemd-devel %if %{tests_enabled} BuildRequires: dejagnu @@ -78,6 +83,8 @@ System and process monitoring utilities development headers %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 +%patch7 -p1 %build # The following stuff is needed for git archives only @@ -100,8 +107,9 @@ autoreconf --verbose --force --install --disable-rpath \ --enable-watch8bit \ --enable-skill \ - --enable-sigwinch - + --enable-sigwinch \ + --enable-libselinux \ + --with-systemd make CFLAGS="%{optflags}" @@ -143,6 +151,11 @@ mkdir -p %{buildroot}%{_sysconfdir}/sysctl.d %{_includedir}/proc %changelog +* Wed Aug 07 2013 Jaromir Capik - 3.3.8-11 +- Support for libselinux (#975459) +- Support for systemd (#994457) +- Support for 'Shmem' in free (#993271) + * Sun Aug 04 2013 Fedora Release Engineering - 3.3.8-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild