From 1a4ad73708cea6d3bfb6df89bdb744b1842cfec4 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 18 Nov 2006 06:24:57 +0000 Subject: [PATCH] add fedora name --- gnome-system-monitor-2.17.2.1-fedora.patch | 58 ++++++++++++++++++++++ gnome-system-monitor.spec | 8 ++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 gnome-system-monitor-2.17.2.1-fedora.patch diff --git a/gnome-system-monitor-2.17.2.1-fedora.patch b/gnome-system-monitor-2.17.2.1-fedora.patch new file mode 100644 index 0000000..8916165 --- /dev/null +++ b/gnome-system-monitor-2.17.2.1-fedora.patch @@ -0,0 +1,58 @@ +--- gnome-system-monitor-2.17.2.1/src/sysinfo.cpp.fedora 2006-11-02 13:45:35.000000000 -0500 ++++ gnome-system-monitor-2.17.2.1/src/sysinfo.cpp 2006-11-18 01:09:14.000000000 -0500 +@@ -141,10 +141,55 @@ + }; + + ++ class RedHatSysInfo ++ : public SysInfo ++ { ++ public: ++ RedHatSysInfo() : SysInfo(_("Unknown distro")) ++ { ++ this->load_redhat_info(); ++ } ++ ++ private: ++ void load_redhat_info() ++ { ++ gchar *text, *t, *s; ++ ++ if (!g_file_get_contents ("/etc/redhat-release", &text, NULL, NULL)) ++ return; ++ ++ t = strstr (text, " release"); ++ ++ if (!t) ++ { ++ g_free (text); ++ return; ++ } ++ ++ *t = '\0'; ++ ++ t += strlen (" release"); ++ ++ while (*t == ' ') ++ t++; ++ ++ s = strchr (t, ' '); ++ ++ if (s) ++ *s = '\0'; ++ ++ this->distro_name = text; ++ this->distro_version = t; ++ } ++ }; ++ ++ + SysInfo* get_sysinfo() + { + if (g_file_test("/etc/debian_version", G_FILE_TEST_EXISTS)) + return new DebianSysInfo; ++ else if (g_file_test("/etc/redhat-release", G_FILE_TEST_EXISTS)) ++ return new RedHatSysInfo; + else + return new SysInfo(_("Unknown distro")); + } diff --git a/gnome-system-monitor.spec b/gnome-system-monitor.spec index 606f74b..c8ed0fb 100644 --- a/gnome-system-monitor.spec +++ b/gnome-system-monitor.spec @@ -12,12 +12,13 @@ Summary: Simple process monitor Name: gnome-system-monitor Version: 2.17.2.1 -Release: 1%{?dist} +Release: 2%{?dist} License: GPL Group: Applications/System URL: http://www.gnome.org/ Source: http://ftp.gnome.org/pub/GNOME/sources/gnome-system-monitor/2.15/gnome-system-monitor-%{version}.tar.bz2 Source1: side.png +Patch0: gnome-system-monitor-2.17.2.1-fedora.patch BuildRoot: %{_tmppath}/%{name}-root Requires: libgnomeui >= %{libgnomeui_version} Requires: libgtop2 >= %{libgtop2_version} @@ -48,6 +49,8 @@ gnome-system-monitor is a simple process and system monitor. %prep %setup -q +%patch0 -p1 -b .fedora + cp %{SOURCE1} pixmaps/ %build @@ -105,6 +108,9 @@ scrollkeeper-update -q %{_datadir}/omf/gnome-system-monitor/ %changelog +* Sat Nov 18 2006 Matthias Clasen - 2.17.2.1-2 +- Add disto info + * Sun Nov 12 2006 Matthias Clasen - 2.17.2.1-1 - Update to 2.17.2.1