[packages/xsane] - up to 0.999; add ipv6 from fc

arekm arekm at pld-linux.org
Thu May 23 07:01:00 CEST 2013


commit 251eff08f5635c2e09e05550ba3280a7833e5989
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu May 23 07:00:56 2013 +0200

    - up to 0.999; add ipv6 from fc

 xsane-0.997-ipv6.patch | 148 +++++++++++++++++++++++++++++++++++++++++++++++++
 xsane-build.patch      |  12 ++++
 xsane.spec             |  10 +++-
 3 files changed, 167 insertions(+), 3 deletions(-)
---
diff --git a/xsane.spec b/xsane.spec
index 62d1230..4c875e5 100644
--- a/xsane.spec
+++ b/xsane.spec
@@ -2,19 +2,21 @@ Summary:	Improved SANE frontend
 Summary(pl.UTF-8):	Ulepszony frontend do SANE
 Summary(zh_CN.UTF-8):	xsane - 一个图形扫描程序
 Name:		xsane
-Version:	0.998
-Release:	5
+Version:	0.999
+Release:	1
 License:	GPL v2+
 Group:		X11/Applications/Graphics
 #Source0Download:	http://www.xsane.org/cgi-bin/sitexplorer.cgi?/download/
 Source0:	http://www.xsane.org/download/%{name}-%{version}.tar.gz
-# Source0-md5:	936f1cc76b37caa8f285e1e15ac7e0aa
+# Source0-md5:	9927f21e1ab6ba96315e7f0e30746deb
 Source1:	%{name}.desktop
 Source2:	%{name}.png
 Patch0:		%{name}-datadir.patch
 Patch1:		%{name}-pl.po-update.patch
 Patch2:		%{name}-poMakefile.patch
 Patch3:		%{name}-libpng.patch
+Patch4:		%{name}-build.patch
+Patch5:		%{name}-0.997-ipv6.patch
 URL:		http://www.xsane.org/
 BuildRequires:	autoconf
 BuildRequires:	automake
@@ -46,6 +48,8 @@ do komunikacji ze skanerem.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
+%patch5 -p1
 
 mv -f po/{zh,zh_TW}.po
 
diff --git a/xsane-0.997-ipv6.patch b/xsane-0.997-ipv6.patch
new file mode 100644
index 0000000..43f7af6
--- /dev/null
+++ b/xsane-0.997-ipv6.patch
@@ -0,0 +1,148 @@
+From a2ef22d59904d5e53c3d58093b561fa1ab7127a6 Mon Sep 17 00:00:00 2001
+From: Nils Philippsen <nils at redhat.com>
+Date: Thu, 16 Aug 2012 10:58:54 +0200
+Subject: [PATCH] patch: ipv6
+
+Squashed commit of the following:
+
+commit 9f9d5c46fdef5ba7baccb81ab8170cfc24797de6
+Author: Nils Philippsen <nils at redhat.com>
+Date:   Fri Nov 19 12:27:42 2010 +0100
+
+    support IPv6 (#198422)
+---
+ src/xsane-save.c | 96 ++++++++++++++++++++++++++++++++++++--------------------
+ 1 file changed, 62 insertions(+), 34 deletions(-)
+
+diff --git a/src/xsane-save.c b/src/xsane-save.c
+index 84f5d59..87ef685 100644
+--- a/src/xsane-save.c
++++ b/src/xsane-save.c
+@@ -29,6 +29,8 @@
+ #include <time.h>
+ #include <sys/wait.h> 
+ 
++#include <glib.h>
++
+ /* the following test is always false */
+ #ifdef _native_WIN32
+ # include <winsock.h>
+@@ -7488,55 +7490,81 @@ void write_email_attach_file(int fd_socket, char *boundary, FILE *infile, char *
+ /* returns fd_socket if sucessfull, < 0 when error occured */
+ int open_socket(char *server, int port)
+ {
+- int fd_socket;
+- struct sockaddr_in sin;
+- struct hostent *he;
++ int fd_socket, e;
++
++ struct addrinfo *ai_list, *ai;
++ struct addrinfo hints;
++ gchar *port_s;
++ gint connected;
++
++  memset(&hints, '\0', sizeof(hints));
++  hints.ai_flags = AI_ADDRCONFIG;
++  hints.ai_socktype = SOCK_STREAM;
++
++  port_s = g_strdup_printf("%d", port);
++  e = getaddrinfo(server, port_s, &hints, &ai_list);
++  g_free(port_s);
+ 
+-  he = gethostbyname(server);
+-  if (!he)
++  if (e != 0)
+   {
+-    DBG(DBG_error, "open_socket: Could not get hostname of \"%s\"\n", server);
++    DBG(DBG_error, "open_socket: Could not lookup \"%s\"\n", server);
+    return -1;
+   }
+-  else
++
++  connected = 0;
++  for (ai = ai_list; ai != NULL && !connected; ai = ai->ai_next)
+   {
+-    DBG(DBG_info, "open_socket: connecting to \"%s\" = %d.%d.%d.%d\n",
+-        he->h_name,
+-        (unsigned char) he->h_addr_list[0][0],
+-        (unsigned char) he->h_addr_list[0][1],
+-        (unsigned char) he->h_addr_list[0][2],
+-        (unsigned char) he->h_addr_list[0][3]);
+-  }
++    gchar hostname[NI_MAXHOST];
++    gchar hostaddr[NI_MAXHOST];
++
++    /* If all else fails */
++    strncpy(hostname, "(unknown name)", NI_MAXHOST-1);
++    strncpy(hostaddr, "(unknown address)", NI_MAXHOST-1);
++
++    /* Determine canonical name and IPv4/IPv6 address */
++    (void) getnameinfo(ai->ai_addr, ai->ai_addrlen, hostname, sizeof(hostname),
++                       NULL, 0, 0);
++    (void) getnameinfo(ai->ai_addr, ai->ai_addrlen, hostaddr, sizeof(hostaddr),
++                       NULL, 0, NI_NUMERICHOST);
++
++    DBG(DBG_info, "open_socket: connecting to \"%s\" (\"%s\"): %s\n",
++        server, hostname, hostaddr);
+  
+-  if (he->h_addrtype != AF_INET)
+-  {
+-    DBG(DBG_error, "open_socket: Unknown address family: %d\n", he->h_addrtype);
+-   return -1;
+-  }
++    if ((ai->ai_family != AF_INET) && (ai->ai_family != AF_INET6))
++    {
++      DBG(DBG_error, "open_socket: Unknown address family: %d\n", ai->ai_family);
++      continue;
++    }
+ 
+-  fd_socket = socket(AF_INET, SOCK_STREAM, 0);
++    fd_socket = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
+ 
+-  if (fd_socket < 0)
+-  {
+-    DBG(DBG_error, "open_socket: Could not create socket: %s\n", strerror(errno));
+-   return -1;
+-  }
++    if (fd_socket < 0)
++    {
++      DBG(DBG_error, "open_socket: Could not create socket: %s\n", strerror(errno));
++      continue;
++    }
+ 
+-/*  setsockopt (dev->ctl, level, TCP_NODELAY, &on, sizeof (on)); */
++    /*  setsockopt (dev->ctl, level, TCP_NODELAY, &on, sizeof (on)); */
+ 
+-  sin.sin_port = htons(port);
+-  sin.sin_family = AF_INET;
+-  memcpy(&sin.sin_addr, he->h_addr_list[0], he->h_length);
++    if (connect(fd_socket, ai->ai_addr, ai->ai_addrlen) != 0)
++    {
++      DBG(DBG_error, "open_socket: Could not connect with port %d of socket: %s\n", port, strerror(errno));
++      continue;
++    }
++
++    /* All went well */
++    connected = 1;
++  }
+ 
+-  if (connect(fd_socket, &sin, sizeof(sin)))
++  if (!connected)
+   {
+-    DBG(DBG_error, "open_socket: Could not connect with port %d of socket: %s\n", ntohs(sin.sin_port), strerror(errno));
+-   return -1;
++    DBG(DBG_info, "open_socket: Could not connect to any address");
++    return -1;
+   }
+ 
+-  DBG(DBG_info, "open_socket: Connected with port %d\n", ntohs(sin.sin_port));
++  DBG(DBG_info, "open_socket: Connected with port %d\n", port);
+ 
+- return fd_socket;
++  return fd_socket;
+ }
+ 
+ /* ---------------------------------------------------------------------------------------------------------------------- */
+-- 
+1.7.11.4
+
diff --git a/xsane-build.patch b/xsane-build.patch
new file mode 100644
index 0000000..8a1337c
--- /dev/null
+++ b/xsane-build.patch
@@ -0,0 +1,12 @@
+diff -urN xsane-0.999.org/configure.in xsane-0.999/configure.in
+--- xsane-0.999.org/configure.in	2013-05-22 23:16:55.000000000 +0200
++++ xsane-0.999/configure.in	2013-05-23 06:57:43.268529091 +0200
+@@ -83,7 +83,7 @@
+ AC_AIX
+ AC_MINIX
+ AC_ISC_POSIX
+-AM_PROG_CC_STDC
++AC_PROG_CC
+ AC_PROG_INSTALL
+ AC_PROG_MAKE_SET
+ AC_PROG_CPP
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xsane.git/commitdiff/251eff08f5635c2e09e05550ba3280a7833e5989



More information about the pld-cvs-commit mailing list