Package: fam
Severity: important
Tags: patch

Hi,

libfam fails to build on GNU/kFreeBSD due to unportable checking of sockaddr_un
structure (patch by Aurelien Jarno), and because the dnotify patch assumes that
(Linux-specific) dnotify support was enabled in a few places.

I'm attaching a patch for both issues.  As for the sockaddr_un part, it'd be
nice if you forwarded it to upstream.

Thank you.

-- System Information:
Debian Release: testing/unstable
Architecture: kfreebsd-i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: GNU/kFreeBSD 5.3-1
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ANSI_X3.4-1968) (ignored: LC_ALL 
set to C)
diff -Nur fam-2.7.0.old/debian/changelog fam-2.7.0/debian/changelog
--- fam-2.7.0.old/debian/changelog	2005-08-27 14:27:23.000000000 +0200
+++ fam-2.7.0/debian/changelog	2005-08-27 15:02:43.000000000 +0200
@@ -1,3 +1,9 @@
+fam (2.7.0-7.2+kbsd) unreleased; urgency=low
+
+  * GNU/kFreeBSD support.
+
+ -- Robert Millan <[EMAIL PROTECTED]>  Sat, 27 Aug 2005 15:02:34 +0200
+
 fam (2.7.0-7.2) unstable; urgency=low
 
   * #include <limits.h> instead of "limits.h" (Closes: 317839)
diff -Nur fam-2.7.0.old/debian/patches/01_dnotify.patch fam-2.7.0/debian/patches/01_dnotify.patch
--- fam-2.7.0.old/debian/patches/01_dnotify.patch	2005-08-27 14:27:23.000000000 +0200
+++ fam-2.7.0/debian/patches/01_dnotify.patch	2005-08-27 14:58:56.000000000 +0200
@@ -21,7 +21,7 @@
 +use_dnotify=false
 +AC_MSG_RESULT($have_dnotify)
 +
-+if test "$have_dnotify"; then
++if test "$have_dnotify" = "yes" ; then
 +        MONITOR_FUNCS=IMonNone
 +        AC_DEFINE(USE_DNOTIFY)
 +	use_dnotify=true
@@ -103,7 +103,7 @@
 unchanged:
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
 +++ fam-2.7.0/src/DNotify.c++	2005-05-05 22:08:43.000000000 -0700
-@@ -0,0 +1,655 @@
+@@ -0,0 +1,659 @@
 +//  Copyright (C) 2001 Red Hat, Inc.  All Rights Reserved.
 +//  Copyright (C) 1999 Silicon Graphics, Inc.  All Rights Reserved.
 +//  
@@ -127,6 +127,9 @@
 +//  with this program; if not, write the Free Software Foundation, Inc., 59
 +//  Temple Place - Suite 330, Boston MA 02111-1307, USA.
 +
++#include "config.h" /* USE_DNOTIFY */
++#ifdef USE_DNOTIFY
++
 +#define _GNU_SOURCE  
 +#include <fcntl.h>
 +
@@ -759,6 +762,7 @@
 +    }
 +}
 +
++#endif /* USE_DNOTIFY */
 only in patch2:
 unchanged:
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -911,11 +915,13 @@
 unchanged:
 --- fam-2.7.0.orig/src/Interest.c++	2003-01-18 06:18:12.000000000 -0800
 +++ fam-2.7.0/src/Interest.c++	2005-05-05 22:08:42.000000000 -0700
-@@ -42,12 +42,21 @@
+@@ -42,12 +42,23 @@
  #include "Event.h"
  #include "FileSystem.h"
  #include "IMon.h"
++#ifdef USE_DNOTIFY
 +#include "DNotify.h"
++#endif
  #include "Log.h"
  #include "Pollster.h"
  #include "timeval.h"
@@ -934,7 +940,7 @@
  bool      Interest::xtab_verification = true;
  
  Interest::Interest(const char *name, FileSystem *fs, in_addr host, ExportVerification ev)
-@@ -59,11 +68,11 @@
+@@ -59,11 +70,11 @@
        myhost(host),
        mypath_exported_to_host(ev == NO_VERIFY_EXPORTED)
  {
@@ -951,7 +957,7 @@
      {   int rc = lstat(name, &old_stat);
  	if (rc < 0)
  	{   Log::info("can't lstat %s", name);
-@@ -100,7 +109,7 @@
+@@ -100,7 +111,7 @@
      }
  #endif
  
@@ -960,7 +966,7 @@
  }
  
  Interest::~Interest()
-@@ -128,7 +137,7 @@
+@@ -128,7 +139,7 @@
  		pp = &p->hashlink;	// move to next element
  	    }
  	if (!found_same)
@@ -969,7 +975,7 @@
      }
  }
  
-@@ -147,7 +156,7 @@
+@@ -147,7 +158,7 @@
  
          // Express interest.
          IMon::Status s = IMon::BAD;
@@ -978,7 +984,7 @@
          if (s != IMon::OK) {
              return true;
          }
-@@ -248,23 +257,23 @@
+@@ -248,23 +259,23 @@
  }
  
  void
diff -Nur fam-2.7.0.old/debian/patches/08_sockaddr_un.patch fam-2.7.0/debian/patches/08_sockaddr_un.patch
--- fam-2.7.0.old/debian/patches/08_sockaddr_un.patch	1970-01-01 01:00:00.000000000 +0100
+++ fam-2.7.0/debian/patches/08_sockaddr_un.patch	2005-08-27 15:23:45.000000000 +0200
@@ -0,0 +1,56 @@
+diff -ur fam-2.7.0.old/config.h.in fam-2.7.0/config.h.in
+--- fam-2.7.0.old/config.h.in	2005-08-27 15:07:39.000000000 +0200
++++ fam-2.7.0/config.h.in	2005-08-27 15:08:01.000000000 +0200
+@@ -76,6 +76,9 @@
+ /* Define to 1 if `sa_len' is member of `struct sockaddr'. */
+ #undef HAVE_STRUCT_SOCKADDR_SA_LEN
+ 
++/* Define to 1 if `sun_len' is member of `struct sockaddr_un'. */
++#undef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
++
+ /* Define to 1 if you have the <syslog.h> header file. */
+ #undef HAVE_SYSLOG_H
+ 
+diff -ur fam-2.7.0.old/configure.ac fam-2.7.0/configure.ac
+--- fam-2.7.0.old/configure.ac	2005-08-27 15:07:39.000000000 +0200
++++ fam-2.7.0/configure.ac	2005-08-27 15:08:01.000000000 +0200
+@@ -72,7 +72,8 @@
+ AC_TYPE_PID_T
+ AC_TYPE_SIZE_T
+ AC_HEADER_TIME
+-AC_CHECK_MEMBERS(struct sockaddr.sa_len, struct sockaddr_un.sun_len)
++AC_CHECK_MEMBERS([struct sockaddr.sa_len],,, [#include <sys/socket.h>])
++AC_CHECK_MEMBERS([struct sockaddr_un.sun_len],,, [#include <sys/un.h>])
+ 
+ # Checks for library functions.
+ AC_FUNC_ERROR_AT_LINE
+diff -ur fam-2.7.0.old/src/Listener.c++ fam-2.7.0/src/Listener.c++
+--- fam-2.7.0.old/src/Listener.c++	2005-08-27 15:07:39.000000000 +0200
++++ fam-2.7.0/src/Listener.c++	2005-08-27 15:08:01.000000000 +0200
+@@ -209,7 +209,7 @@
+ #endif
+ 
+     char *tmpfile = tempnam("/tmp", ".fam");
+-#ifdef HAVE_SOCKADDR_SUN_LEN
++#ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
+     sockaddr_un sun = { sizeof(sockaddr_un), AF_UNIX, "" };
+ #else
+     sockaddr_un sun = { AF_UNIX, "" };
+@@ -283,7 +283,7 @@
+ 
+     // Get the new socket.
+ 
+-#ifdef HAVE_SOCKADDR_SUN_LEN
++#ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
+     struct sockaddr_un sun = { sizeof(sockaddr_un), AF_UNIX, "" };
+ #else
+     struct sockaddr_un sun = { AF_UNIX, "" };
+@@ -357,7 +357,7 @@
+ void
+ Listener::dirty_ugly_hack()
+ {
+-#ifdef HAVE_SOCKADDR_SUN_LEN
++#ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
+     static sockaddr_un sun = { sizeof (sockaddr_un), AF_UNIX, "/tmp/.fam_socket" };
+ #else
+     static sockaddr_un sun = { AF_UNIX, "/tmp/.fam_socket" };

Reply via email to