File gmane-weaverd_gmime2.patch of Package gmane-weaverd
Index: configure.in
===================================================================
--- configure.in.orig 2003-10-25 23:36:50.000000000 +0200
+++ configure.in 2007-11-28 17:48:44.836149407 +0100
@@ -14,30 +14,33 @@ AC_CHECK_HEADERS(time.h)
AC_CHECK_HEADERS(alloca.h)
AC_CHECK_FUNCS(memchr memrchr memmem strlen strcpy strncpy strlcpy stpcpy strcat strncat strlcat strchr strrchr strnstr strstr strncasestr strcasestr strncasecmp strcasecmp)
-
-dnl We need at *least* glib 1.2.0
-AM_PATH_GLIB(1.2.0, ,
- AC_MSG_ERROR(Cannot find GLIB: Is glib-config in path?))
-glib_cflags="$GLIB_CFLAGS"
-glib_libs="$GLIB_LIBS"
-AC_SUBST(glib_cflags)
-AC_SUBST(glib_libs)
+dnl We need at *least* glib 1.2.0
+dnl AM_PATH_GLIB(1.2.0, ,
+dnl AC_MSG_ERROR(Cannot find GLIB: Is glib-config in path?))
+dnl
+dnl glib_cflags="$GLIB_CFLAGS"
+dnl glib_libs="$GLIB_LIBS"
+dnl AC_SUBST(glib_cflags)
+dnl AC_SUBST(glib_libs)
+dnl
+dnl CFLAGS="$CFLAGS -L/usr/lib/news -I/usr/local/include -L/usr/local/lib $GLIB_CFLAGS $GLIB_LIBS"
+dnl
+dnl AC_SUBST(X_CFLAGS)
+dnl
+dnl AC_CHECK_LIB(gmime2, g_mime_message_get_sender, GMIME="-lgmime2")
+dnl if test "$GMIME" = ""; then
+dnl echo "No gmime library found. mdb needs at least gmime 1.0.6"
+dnl exit 1
+dnl fi
+dnl
+dnl AC_CHECK_LIB(inn, parsedate, INN="-linn")
+dnl if test "$INN" = ""; then
+dnl echo "No INN library found."
+dnl exit 1
+dnl fi
-CFLAGS="$CFLAGS -L/usr/lib/news -I/usr/local/include -L/usr/local/lib $GLIB_CFLAGS $GLIB_LIBS"
-
-AC_SUBST(X_CFLAGS)
-
-AC_CHECK_LIB(gmime, g_mime_message_get_sender, GMIME="-lgmime")
-if test "$GMIME" = ""; then
- echo "No gmime library found. mdb needs at least gmime 1.0.6"
- exit 1
-fi
-
-#AC_CHECK_LIB(inn, parsedate, INN="-linn")
-#if test "$INN" = ""; then
-# echo "No INN library found."
-# exit 1
-#fi
-
+PKG_CHECK_MODULES(GMIME, gmime-2.0)
+AC_SUBST(GMIME_CFLAGS)
+AC_SUBST(GMIME_LIBS)
AC_OUTPUT(Makefile)
Index: Makefile.in
===================================================================
--- Makefile.in.orig 2005-04-26 00:11:20.000000000 +0200
+++ Makefile.in 2007-11-28 16:24:12.539509747 +0100
@@ -1,9 +1,11 @@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_CONFIG = @GLIB_CONFIG@
-GLIB_LIBS = @GLIB_LIBS@
-GMIME_CONFIG = /usr/local/bin/gmime-config
-GMIME_CFLAGS = `$(GMIME_CONFIG) --cflags`
-GMIME_LIBS = `$(GMIME_CONFIG) --libs`
+# GLIB_CFLAGS = @GLIB_CFLAGS@
+# GLIB_CONFIG = @GLIB_CONFIG@
+# GLIB_LIBS = @GLIB_LIBS@
+# GMIME_CONFIG = /usr/local/bin/gmime-config
+# GMIME_CFLAGS = `$(GMIME_CONFIG) --cflags`
+# GMIME_LIBS = `$(GMIME_CONFIG) --libs`
+GMIME_CFLAGS = @GMIME_CFLAGS@
+GMIME_LIBS = @GMIME_LIBS@
HEADER_FILES=config.h util.h hash.h weaver.h input.h dispatch.h
Index: util.c
===================================================================
--- util.c.orig 2007-01-24 02:36:07.000000000 +0100
+++ util.c 2007-11-28 16:40:24.393838099 +0100
@@ -1,4 +1,6 @@
+#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
+#endif
#include <sys/types.h>
Index: input.c
===================================================================
--- input.c.orig 2007-01-24 19:37:19.000000000 +0100
+++ input.c 2007-11-28 17:40:31.414494397 +0100
@@ -3,7 +3,9 @@
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
+#ifndef __USE_XOPEN2K
#define __USE_XOPEN2K
+#endif
#include <fcntl.h>
#include <getopt.h>
#include <dirent.h>
@@ -56,7 +58,7 @@ int quoted_in_body_p (const char *file_n
}
while ((read_size = read(file, &buf, sizeof(buf) - 1)) > 0) {
- buf[sizeof(buf)] = 0;
+ buf[sizeof(buf)-1] = 0;
if (strstr(buf, "\n>")) {
found = 1;
break;
@@ -70,7 +72,22 @@ int quoted_in_body_p (const char *file_n
static parsed_article pa;
GMimeMessage *
-g_mime_parser_construct_message_headers_only (GMimeStream *stream);
+g_mime_parser_construct_message_headers_only (GMimeStream *stream)
+{
+ GMimeMessage *message;
+ GMimeParser *parser;
+
+ g_return_val_if_fail (stream != NULL, NULL);
+
+ parser = g_mime_parser_new_with_stream (stream);
+ /* for now return the whole message object and not just the headers
+ message = parser_construct_message_headers_only (parser);
+ */
+ message = g_mime_parser_construct_message (parser);
+ g_object_unref (parser);
+
+ return message;
+}
parsed_article *parse_file(const char *file_name) {
GMimeStream *stream;
Index: weaver.c
===================================================================
--- weaver.c.orig 2007-01-24 02:37:15.000000000 +0100
+++ weaver.c 2007-11-28 16:50:06.592774947 +0100
@@ -1,4 +1,6 @@
+#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
+#endif
#include <sys/types.h>
Index: hash.c
===================================================================
--- hash.c.orig 2007-01-24 02:34:32.000000000 +0100
+++ hash.c 2007-11-28 17:34:54.678261343 +0100
@@ -1,4 +1,6 @@
+#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
+#endif
#include <stdio.h>
#include <stdlib.h>
Index: simple.c
===================================================================
--- simple.c.orig 2005-10-05 22:44:08.000000000 +0200
+++ simple.c 2007-11-28 17:38:00.401420885 +0100
@@ -36,6 +36,7 @@ static parsed_article pa;
parsed_article *parse_simple_file(const char *file_name) {
GMimeStream *stream;
+ GMimeParser *parser;
GMimeMessage *msg = 0;
const char *author = NULL, *subject = NULL, *message_id = NULL,
*references = NULL, *original_message_id = NULL, *xref = NULL;
@@ -54,7 +55,8 @@ parsed_article *parse_simple_file(const
}
stream = g_mime_stream_fs_new(file);
- msg = g_mime_parser_construct_message(stream);
+ parser = g_mime_parser_new_with_stream(stream);
+ msg = g_mime_parser_construct_message(parser);
g_mime_stream_unref(stream);
if (msg != 0) {