add fedora name
This commit is contained in:
		
							parent
							
								
									cb05eb3330
								
							
						
					
					
						commit
						1a4ad73708
					
				
							
								
								
									
										58
									
								
								gnome-system-monitor-2.17.2.1-fedora.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								gnome-system-monitor-2.17.2.1-fedora.patch
									
									
									
									
									
										Normal file
									
								
							| @ -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")); | ||||||
|  |    } | ||||||
| @ -12,12 +12,13 @@ | |||||||
| Summary: Simple process monitor | Summary: Simple process monitor | ||||||
| Name: gnome-system-monitor | Name: gnome-system-monitor | ||||||
| Version: 2.17.2.1 | Version: 2.17.2.1 | ||||||
| Release: 1%{?dist} | Release: 2%{?dist} | ||||||
| License: GPL | License: GPL | ||||||
| Group: Applications/System | Group: Applications/System | ||||||
| URL: http://www.gnome.org/ | URL: http://www.gnome.org/ | ||||||
| Source: http://ftp.gnome.org/pub/GNOME/sources/gnome-system-monitor/2.15/gnome-system-monitor-%{version}.tar.bz2 | Source: http://ftp.gnome.org/pub/GNOME/sources/gnome-system-monitor/2.15/gnome-system-monitor-%{version}.tar.bz2 | ||||||
| Source1: side.png | Source1: side.png | ||||||
|  | Patch0: gnome-system-monitor-2.17.2.1-fedora.patch | ||||||
| BuildRoot: %{_tmppath}/%{name}-root | BuildRoot: %{_tmppath}/%{name}-root | ||||||
| Requires: libgnomeui >= %{libgnomeui_version} | Requires: libgnomeui >= %{libgnomeui_version} | ||||||
| Requires: libgtop2 >= %{libgtop2_version} | Requires: libgtop2 >= %{libgtop2_version} | ||||||
| @ -48,6 +49,8 @@ gnome-system-monitor is a simple process and system monitor. | |||||||
| 
 | 
 | ||||||
| %prep | %prep | ||||||
| %setup -q | %setup -q | ||||||
|  | %patch0 -p1 -b .fedora | ||||||
|  | 
 | ||||||
| cp %{SOURCE1} pixmaps/ | cp %{SOURCE1} pixmaps/ | ||||||
| 
 | 
 | ||||||
| %build | %build | ||||||
| @ -105,6 +108,9 @@ scrollkeeper-update -q | |||||||
| %{_datadir}/omf/gnome-system-monitor/ | %{_datadir}/omf/gnome-system-monitor/ | ||||||
| 
 | 
 | ||||||
| %changelog | %changelog | ||||||
|  | * Sat Nov 18 2006 Matthias Clasen <mclasen@redhat.com> - 2.17.2.1-2 | ||||||
|  | - Add disto info | ||||||
|  | 
 | ||||||
| * Sun Nov 12 2006 Matthias Clasen <mclasen@redhat.com> - 2.17.2.1-1 | * Sun Nov 12 2006 Matthias Clasen <mclasen@redhat.com> - 2.17.2.1-1 | ||||||
| - Update to 2.17.2.1 | - Update to 2.17.2.1 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user