Hello community,

here is the log from the commit of package xosview for openSUSE:Factory checked 
in at 2013-05-02 12:05:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xosview (Old)
 and      /work/SRC/openSUSE:Factory/.xosview.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "xosview"

Changes:
--------
--- /work/SRC/openSUSE:Factory/xosview/xosview.changes  2013-04-12 
20:45:41.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.xosview.new/xosview.changes     2013-05-02 
12:05:49.000000000 +0200
@@ -1,0 +2,10 @@
+Mon Apr 29 12:12:43 UTC 2013 - [email protected]
+
+- Add patch xosview-1.14-pixmap.patch (bnc#817558) 
+- Combine patch xosview-1.14-procsys.patch with patch
+  xosview-1.14-sysinfo.patch to use one configure variable for
+  system calls.
+- Finally delete older patches xosview-1.9.2.dif and
+  xosview-config.diff as not used anymore with 1.14
+
+-------------------------------------------------------------------

Old:
----
  xosview-1.14-procsys.patch
  xosview-1.9.2.dif
  xosview-config.diff

New:
----
  xosview-1.14-pixmap.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ xosview.spec ++++++
--- /var/tmp/diff_new_pack.oY13S1/_old  2013-05-02 12:05:51.000000000 +0200
+++ /var/tmp/diff_new_pack.oY13S1/_new  2013-05-02 12:05:51.000000000 +0200
@@ -42,12 +42,13 @@
 Source5:        xosview-rpmlintrc
 Patch:          xosview-%{version}.dif
 Patch1:         xosview-%{version}-serial.patch
-Patch2:         xosview-%{version}-procsys.patch
 Patch3:         xosview-%{version}-maxlimit.patch
 Patch7:         xosview-%{version}-longint.patch
 Patch8:         xosview-%{version}-sysinfo.patch
 Patch10:        xosview-%{version}-appdef.dif
 Patch11:        xosview-%{version}-diskstat.dif
+# PATCH-FIX-OPENSUSE: Re-add xpm background pximap support (bnc#817558)
+Patch12:        xosview-%{version}-pixmap.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 %define _appdefdir  %{_datadir}/X11/app-defaults
 
@@ -59,12 +60,12 @@
 %prep
 %setup -q
 %patch1  -p0 -b .serial
-%patch2  -p0 -b .procsys
 %patch3  -p0 -b .maxlimit
 %patch7  -p0 -b .ulong
 %patch8  -p0 -b .sysinfo
-%patch10 -p0 -b ".appdef"
-%patch11 -p0 -b ".diskstat"
+%patch10 -p0 -b .appdef
+%patch11 -p0 -b .diskstat
+%patch12 -p0 -b .pixmap
 %patch
 
 %build
@@ -78,7 +79,7 @@
     fi
 esac
 make clean
-make PLATFORM=linux OPTFLAGS="$OPTFLAGS" PREFIX=%{_exec_prefix}
+make PLATFORM=linux OPTFLAGS="$OPTFLAGS" PREFIX=%{_exec_prefix} USE_SYSCALLS=1
 
 %install
 mkdir -p %{buildroot}%{_bindir}
@@ -88,6 +89,7 @@
 make PREFIX=%{_exec_prefix} \
      MANDIR=%{_mandir} \
      XAPPLOADDIR=%{_appdefdir} \
+     USE_SYSCALLS=1 \
      DESTDIR=%{buildroot} \
      install
 install -m 0444 Xdefaults         %{buildroot}%{_appdefdir}/XOsview

++++++ xosview-1.14-pixmap.patch ++++++
>From 9bb78e2c1ad6bcf9c20ca81209d5000d2b993193 Mon Sep 17 00:00:00 2001
From: Werner Fink <[email protected]>
Date: Mon, 29 Apr 2013 14:09:22 +0200
Subject: [PATCH] Re-enable backgroung pixmap xpm

... as expected by some experienced users

Signed-off-by: Werner Fink <[email protected]>
---
 Makefile |    4 ++++
 xwin.cc  |   45 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+)

diff --git Makefile Makefile
index ea6af9a..aace753 100644
--- Makefile
+++ Makefile
@@ -59,6 +59,8 @@ CPPFLAGS += -Ilinux/
 ifneq ($(USE_SYSCALLS),0)
 CPPFLAGS += -DUSE_SYSCALLS
 endif
+LDLIBS += -lXpm
+xwin.o: CPPFLAGS += -DHAVE_XPM
 endif
 
 ifeq ($(PLATFORM), bsd)
@@ -77,6 +79,8 @@ OBJS += bsd/MeterMaker.o \
         bsd/coretemp.o \
         bsd/sensor.o
 CPPFLAGS += -Ibsd/
+LDLIBS += -lXpm
+xwin.o: CPPFLAGS += -DHAVE_XPM
 endif
 
 ifeq ($(PLATFORM), irix65)
diff --git xwin.cc xwin.cc
index da67729..3b492b0 100644
--- xwin.cc
+++ xwin.cc
@@ -1,4 +1,7 @@
 #include <X11/Xatom.h>
+#ifdef HAVE_XPM
+# include <X11/xpm.h>
+#endif
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -107,6 +110,14 @@ void XWin::init( int argc, char **argv ){
   XChangeWindowAttributes(display_, window_,
                          (CWColormap | CWBitGravity), &xswa);
 
+#ifdef HAVE_XPM
+  Pixmap background_pixmap;
+
+  // If there is a pixmap file, set it as the background
+  if (getPixmap(&background_pixmap))
+    XSetWindowBackgroundPixmap(display_,window_,background_pixmap);
+#endif
+
   // add the events
   Event *tmp = events_;
   while ( tmp != NULL ){
@@ -217,6 +228,40 @@ void XWin::setColors( void ){
 }
 //-----------------------------------------------------------------------------
 
+int XWin::getPixmap(Pixmap *pixmap)
+{
+#ifdef HAVE_XPM
+  char *pixmap_file;
+  XWindowAttributes    root_att;
+  XpmAttributes                pixmap_att;
+
+  pixmap_file = (char*) getResourceOrUseDefault("pixmapName",NULL);
+
+  if (!pixmap_file)
+    return 0;
+
+  XGetWindowAttributes(display_, DefaultRootWindow(display_),&root_att);
+  pixmap_att.closeness=30000;
+  pixmap_att.colormap=root_att.colormap;
+  pixmap_att.valuemask=XpmSize|XpmReturnPixels|XpmColormap|XpmCloseness;
+
+  if (XpmReadFileToPixmap(display_,DefaultRootWindow(display_),pixmap_file,
+      pixmap, NULL, &pixmap_att))
+  {
+    std::cerr << "Pixmap " << pixmap_file  << " not found" << std::endl;
+    std::cerr << "Defaulting to blank" << std::endl;
+    pixmap = NULL;
+    return 0;
+  }
+
+  return 1;
+#else
+  pixmap = NULL;
+  return 0;
+#endif
+}
+
+//-----------------------------------------------------------------------------
 void XWin::getGeometry( void ){
   char                 default_geometry[80];
   int                  bitmask;
-- 
1.7.9.2

++++++ xosview-1.14-sysinfo.patch ++++++
--- /var/tmp/diff_new_pack.oY13S1/_old  2013-05-02 12:05:51.000000000 +0200
+++ /var/tmp/diff_new_pack.oY13S1/_new  2013-05-02 12:05:51.000000000 +0200
@@ -1,27 +1,88 @@
---- linux/swapmeter.cc
-+++ linux/swapmeter.cc 2013-04-09 12:10:10.713438774 +0000
-@@ -4,11 +4,16 @@
- //  This file may be distributed under terms of the GPL
- //
+--- Makefile
++++ Makefile   2013-04-29 08:42:51.505939256 +0000
+@@ -3,6 +3,7 @@
+ AWK ?= awk
+ INSTALL ?= install
+ PLATFORM ?= linux
++USE_SYSCALLS ?= 0
  
-+#define USE_SYSCALLS  1       // Use fast sysinfo API
-+
- #include "swapmeter.h"
- #include "xosview.h"
+ # Installation paths
+ 
+@@ -55,6 +56,9 @@ OBJS += linux/MeterMaker.o \
+       linux/acpitemp.o \
+       linux/coretemp.o
+ CPPFLAGS += -Ilinux/
++ifneq ($(USE_SYSCALLS),0)
++CPPFLAGS += -DUSE_SYSCALLS
++endif
+ endif
+ 
+ ifeq ($(PLATFORM), bsd)
+--- linux/cpumeter.cc
++++ linux/cpumeter.cc  2013-04-29 08:35:58.533438954 +0000
+@@ -13,6 +13,9 @@
+ #include <string>
+ #include <sstream>
+ #include <ctype.h>
++#if defined(USE_SYSCALLS) && (USE_SYSCALLS > 0)
++# include <sys/utsname.h>
++#endif
+ 
+ static const char STATFILENAME[] = "/proc/stat";
+ static const char VERSIONFILENAME[] = "/proc/sys/kernel/osrelease";
+@@ -337,17 +340,23 @@ const char *CPUMeter::toUpper(const char
+ }
+ 
+ int CPUMeter::getkernelversion(void){
+-  std::ifstream f(VERSIONFILENAME);
+-  if (!f) {
+-    std::cerr << "Can not get kernel version from " << VERSIONFILENAME << "." 
<< std::endl;
+-    exit(1);
+-  }
+-
+-  std::string version;
+-  int major = 0, minor = 0, micro = 0;
+-
+-  f >> version;
+-  sscanf(version.c_str(), "%d.%d.%d", &major, &minor, &micro);
++  static int major = 0, minor = 0, micro = 0;
++  if (!major) {
++#if defined(USE_SYSCALLS) && (USE_SYSCALLS > 0)
++    struct utsname myosrelease;
++    uname(&myosrelease);
++    sscanf(myosrelease.release, "%d.%d.%d", &major, &minor, &micro);
++#else
++    std::ifstream f(VERSIONFILENAME);
++    if (!f) {
++      std::cerr << "Can not get kernel version from " << VERSIONFILENAME << 
"." << std::endl;
++      exit(1);
++    }
+ 
+-  return ( major*1000000 + minor*1000 + micro);
++    std::string version;
++    f >> version;
++    sscanf(version.c_str(), "%d.%d.%d", &major, &minor, &micro);
++#endif
++  }
++  return (major*1000000 + minor*1000 + micro);
+ }
+--- linux/swapmeter.cc
++++ linux/swapmeter.cc 2013-04-29 08:37:12.613439241 +0000
+@@ -9,6 +9,9 @@
  #include <fstream>
  #include <sstream>
  #include <stdlib.h>
-+#ifdef USE_SYSCALLS
++#if defined(USE_SYSCALLS) && (USE_SYSCALLS > 0)
 +# include <sys/sysinfo.h>
 +#endif
  
  static const char MEMFILENAME[] = "/proc/meminfo";
  
-@@ -37,7 +42,25 @@ void SwapMeter::checkevent( void ){
+@@ -37,7 +40,25 @@ void SwapMeter::checkevent( void ){
    drawfields();
  }
  
-+#ifdef USE_SYSCALLS
++#if defined(USE_SYSCALLS) && (USE_SYSCALLS > 0)
 +void SwapMeter::getswapinfo( void ){
 +  struct sysinfo sinfo;
 +  typeof (sinfo.mem_unit) unit;
@@ -30,12 +91,12 @@
 +  unit = (sinfo.mem_unit ? sinfo.mem_unit : 1);
 +  total_ = (double)sinfo.totalswap * unit;
 +  fields_[0] = (double)(sinfo.totalswap - sinfo.freeswap) * unit;
- 
++
 +  if ( total_ == 0 ){
 +    total_ = 1;
 +    fields_[0] = 0;
 +  }
-+
+ 
 +  if (total_)
 +    setUsed (fields_[0], total_);
 +}
@@ -43,7 +104,7 @@
  void SwapMeter::getswapinfo( void ){
    std::ifstream meminfo( MEMFILENAME );
    if ( !meminfo ){
-@@ -78,3 +101,4 @@ void SwapMeter::getswapinfo( void ){
+@@ -78,3 +99,4 @@ void SwapMeter::getswapinfo( void ){
    if (total_)
      setUsed (fields_[0], total_);
  }

++++++ xosview-1.14.dif ++++++
--- /var/tmp/diff_new_pack.oY13S1/_old  2013-05-02 12:05:51.000000000 +0200
+++ /var/tmp/diff_new_pack.oY13S1/_new  2013-05-02 12:05:51.000000000 +0200
@@ -836,16 +836,6 @@
  
      yoff_ = caption_ ? textHeight() + textHeight() / 4 : 0;
    }
---- xwin.cc
-+++ xwin.cc    2013-04-09 10:58:32.097938890 +0000
-@@ -1,6 +1,7 @@
- #include <X11/Xatom.h>
- #include <stdlib.h>
- #include <stdio.h>
-+#include <errno.h>
- #include <unistd.h>
- #include "xwin.h"
- #include "Xrm.h"
 --- linux/MeterMaker.cc
 +++ linux/MeterMaker.cc        2006-07-26 16:08:30.000000000 +0000
 @@ -133,6 +133,7 @@ void MeterMaker::makeMeters(void){


-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to