changeset 325:cb67b335afcc

patches from debian
author Carl Byington <carl@five-ten-sg.com>
date Fri, 18 Jan 2013 08:05:08 -0800
parents 6b1399ab2d46
children 1e39dc490627
files AUTHORS Makefile.am configure.in debian/Makefile.am debian/changelog debian/compat debian/control debian/copyright debian/libpst-dev.install debian/libpst1.install debian/patches/05-disable-debian-gen.patch debian/patches/10-current-attach.patch debian/readpst.install debian/rules debian/watch m4/ax_boost_python.m4 regression/regression-tests.bash src/libpst.c src/pst2dii.cpp.in
diffstat 19 files changed, 40 insertions(+), 252 deletions(-) [+]
line wrap: on
line diff
--- a/AUTHORS	Thu Jan 03 10:09:12 2013 -0800
+++ b/AUTHORS	Fri Jan 18 08:05:08 2013 -0800
@@ -34,6 +34,7 @@
     Hugo DesRosiers <info@akralogic.com>
     Kenneth Berland <ken@hero.com>
     Leo 'costela' Antunes <costela@debian.org>
+    Svante Signell <svante.signell@telia.com>
 
 Testing team:
     Mac OSX - Michael Watson <mike@mikeandgayle.com>
--- a/Makefile.am	Thu Jan 03 10:09:12 2013 -0800
+++ b/Makefile.am	Fri Jan 18 08:05:08 2013 -0800
@@ -1,6 +1,6 @@
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = src python man html debian
+SUBDIRS = src python man html
 htmldir = ${datadir}/doc/@PACKAGE@-@VERSION@
 html_DATA = AUTHORS COPYING ChangeLog NEWS README
 CLEANFILES = xml/libpst xml/Makefile
--- a/configure.in	Thu Jan 03 10:09:12 2013 -0800
+++ b/configure.in	Fri Jan 18 08:05:08 2013 -0800
@@ -189,7 +189,7 @@
 fi
 AC_FUNC_STRFTIME
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([chdir getcwd memchr memmove memset regcomp strcasecmp strncasecmp strchr strdup strerror strpbrk strrchr strstr strtol])
+AC_CHECK_FUNCS([chdir getcwd memchr memmove memset regcomp strcasecmp strncasecmp strchr strdup strerror strpbrk strrchr strstr strtol get_current_dir_name])
 AM_ICONV
 if test "$am_cv_func_iconv" != "yes"; then
     AC_MSG_ERROR([libpst requires iconv which is missing])
@@ -365,7 +365,6 @@
 
 AC_OUTPUT(                  \
     Makefile                \
-    debian/Makefile         \
     html/Makefile           \
     libpst.pc               \
     libpst.spec             \
--- a/debian/Makefile.am	Thu Jan 03 10:09:12 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-EXTRA_DIST =                        \
-    changelog                       \
-    compat                          \
-    control                         \
-    copyright                       \
-    libpst1.install                 \
-    libpst-dev.install              \
-    Makefile.am                     \
-    patches/10-current-attach.patch \
-    readpst.install                 \
-    rules                           \
-    watch
--- a/debian/changelog	Thu Jan 03 10:09:12 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-libpst (0.6.27-0ubuntu1) jaunty; urgency=low
-
-  [ HggdH ]
-  * new upstream source being used  (LP: #317602) -- www.five-ten-sg.com/libpst:
-    Debian's libpst version does not provide a shared library, and
-    does not support newer Evolution PST files; dropping it.
-  * remove upstream basic debianisation, and re-debianise using CDBS.
-    upstream provides a basic, incomplete, and non-functional ./debian;
-    also, add a ./debian/rules get-orig-source target in order to 
-    cleanup nicely.
-  * debian/patches/10-current-attach.patch: patch for Evolution use,
-      should be eventually dropped for a Evolution patch upstream.
-  * debian/patches/05-disable-debian-gen.patch: adjust configure.in
-    and Makefile.am not to generate the debian directory and files.
-  * changed dependency from libgd2-noxpm to libgd2-xpm >= 2.0.36
-      (current jaunty alpha 3 level).
-  * add a Conflitcs for readpst < 0.6.27, to guarantee upgrade for
-    those using the old libpst packages.
-
-  [ Iain Lane ]
-  * Set priority: extra and remove conflicts on same binary package
-  * debian/copyright: Update and mention GPL-2+ licensed file src/lzfu.c 
-
- -- HggdH <hggdh2@gmail.com>  Wed, 25 Feb 2009 10:49:13 -0600
--- a/debian/compat	Thu Jan 03 10:09:12 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-5
--- a/debian/control	Thu Jan 03 10:09:12 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-Source: libpst
-Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>
-XSBC-Original-Maintainer: Carl Byington <carl@five-ten-sg.com>
-Section: utils
-Priority: optional
-Build-Depends: debhelper (>= 5),
-		cdbs,
-		libtool,
-		autotools-dev,
-		libfreetype6-dev,
-		libgd2-xpm-dev,
-		zlib1g-dev,
-		libjpeg62-dev
-Standards-Version: 3.8.0
-
-Package: readpst
-Priority: optional
-Architecture: any
-Depends: ${shlibs:Depends},
-	${misc:Depends},
-	libpst1 (= ${binary:Version}),
-	imagemagick
-Description: Utilities to convert Outlook .pst files to other formats
- The readpst utilities include readpst which can convert email messages
- to both mbox and MH mailbox formats, pst2ldif which can convert the
- contacts to .ldif format for import into ldap databases, and pst2dii
- which can convert email messages to the DII load file format used by
- Summation. Requires the shared libray provided by libpst1.
-
-Package: libpst1
-Architecture: any
-Priority: optional
-Section: libs
-Depends: ${shlibs:Depends},
-	${misc:Depends}
-Description: Shared library needed by the readpst utilities, and
- other programmes. The libpst shared library is required by the
- readpst utilities, and provides the necessary functions to manipulate
- the Outlook PST files.
-
-Package: libpst-dev
-Architecture: any
-Priority: optional
-Section: libdevel
-Depends: libpst1 (= ${binary:Version}),
-	${misc:Depends}
-Description: development files needed for libpst1.
- Development files needed if coding or compiling programmes that use
- the libpst shared libray.
--- a/debian/copyright	Thu Jan 03 10:09:12 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-This package was debianized by Joachim Metz <forensics@hoffmannbv.nl> on
-Thu, 29 May 2008 15:37:06 +0200.
-
-It was downloaded from http://www.five-ten-sg.com/libpst.
-
-Upstream maintainter: Carl Byington <carl@five-ten-sg.com>
-
-Copyright:
-
-Original version by:
-    Dave Smith <dave.s@earthcorp.com>
-    Dave Smith <davesmith@users.sourceforge.net>
-
-Current maintainer:
-    Carl Byington <carl@five-ten-sg.com>
-
-With contributions by:
-    Joseph Nahmias <joe@nahmias.net>
-    Arne Ahrend <aahrend@web.de>
-    Nigel Horne <njh@bandsman.co.uk>
-    Chris Halls <halls@debian.org>
-    Stevens Miller <smiller@novadatalabs.com>
-    Brad Hards <bradh@frogmouth.net>
-    Alexander Grau <alexandergrau@gmx.de>
-    Antonio Palama <palama@inwind.it>
-    Sean Loaring <sloaring@tec-man.com>
-    James Woodcock
-
-License:
-
-    This package is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; version 2 dated June, 1991.
-
-    This package is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this package; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
-
-The file src/lzfu.c is licensed under the GPL-2+.
-
-License:
-
-    This package is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-	(at your option) any later version.
- 
-    This package is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
- 
-    You should have received a copy of the GNU General Public License
-    along with this package; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-
-The Debian packaging is (C) 2008, Joachim Metz <forensics@hoffmannbv.nl> and
-is licensed under the GPL, see `/usr/share/common-licenses/GPL-2'.
--- a/debian/libpst-dev.install	Thu Jan 03 10:09:12 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-debian/tmp/usr/include/libpst*
-debian/tmp/usr/lib/libpst*.so
-debian/tmp/usr/lib/pkgconfig/*
--- a/debian/libpst1.install	Thu Jan 03 10:09:12 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-debian/tmp/usr/lib/libpst*.so.*
--- a/debian/patches/05-disable-debian-gen.patch	Thu Jan 03 10:09:12 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
---- libpst-0.6.27-orig/configure.in	2009-02-07 12:21:50.000000000 -0600
-+++ libpst-0.6.27/configure.in	2009-02-24 16:19:03.000000000 -0600
-@@ -261,8 +261,6 @@
- 
- AC_OUTPUT(                  \
-     Makefile                \
--    debian/Makefile         \
--    debian/changelog        \
-     html/Makefile           \
-     info/Makefile           \
-     libpst.pc               \
---- libpst-0.6.27-orig/Makefile.am	2009-02-07 12:21:50.000000000 -0600
-+++ libpst-0.6.27/Makefile.am	2009-02-24 18:12:02.000000000 -0600
-@@ -1,4 +1,4 @@
--SUBDIRS = src man html info debian
-+SUBDIRS = src man html info
- htmldir = ${datadir}/doc/@PACKAGE@-@VERSION@
- html_DATA = AUTHORS COPYING ChangeLog NEWS README
- CLEANFILES = xml/libpst xml/Makefile
--- a/debian/patches/10-current-attach.patch	Thu Jan 03 10:09:12 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-diff -Nur libpst-0.6.24-orig/src/libpst.h libpst-0.6.24/src/libpst.h
---- libpst-0.6.24-orig/src/libpst.h	2009-01-15 13:43:38.000000000 -0600
-+++ libpst-0.6.24/src/libpst.h	2009-01-15 15:29:51.000000000 -0600
-@@ -449,6 +449,7 @@
-     struct pst_item_folder        *folder;          // data reffering to folder
-     struct pst_item_contact       *contact;         // data reffering to contact
-     struct pst_item_attach        *attach;          // linked list of attachments
-+    struct pst_item_attach	  *current_attach;  // linked list of current attachments
-     struct pst_item_message_store *message_store;   // data referring to the message store
-     struct pst_item_extra_field   *extra_fields;    // linked list of extra headers and such
-     struct pst_item_journal       *journal;         // data reffering to a journal entry
--- a/debian/readpst.install	Thu Jan 03 10:09:12 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-debian/tmp/usr/bin/*
-debian/tmp/usr/share/man/man1/*
-debian/tmp/usr/share/man/man5/*
-debian/tmp/usr/share/doc/*
--- a/debian/rules	Thu Jan 03 10:09:12 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-#!/usr/bin/make -f
-include /usr/share/cdbs/1/rules/debhelper.mk 
-include /usr/share/cdbs/1/class/autotools.mk 
-include /usr/share/cdbs/1/rules/simple-patchsys.mk 
-
-export DH_VERBOSE=1
-DEB_CONFIGURE_EXTRA_FLAGS = --enable-libpst-shared
-DEB_AUTO_UPDATE_AUTOCONF = 2.63
-DEB_AUTO_UPDATE_AUTOMAKE = 1.10
-DEB_AUTO_UPDATE_LIBTOOL = pre
-
-# Makefile arcanery warning:
-# $(dir $(_)) gives us the path containing this rules file.  
-# I haven't found this documented in any make documentation, so I am unsure 
-# how portable/version independent it is.
-# This magic care of Emmet Hickory:
-# (http://lists.debian.org/debian-devel-games/2008/02/msg00135.html)
-
-TEMP_DIR := $(shell mktemp -d)
-SOURCE_DIR = $(word 1, $(shell ls -d --group-directories-first $(TEMP_DIR)/*))
-SOURCE_VER = $(shell echo $(notdir $(SOURCE_DIR)) | sed s/libpst-//)
-CURVER = $(shell dpkg-parsechangelog | grep ^Version | cut -d" " -f2 | cut -d"-" -f1 | cut -d"+" -f1 )
-
-download-tarball:
-		uscan --download --destdir $(TEMP_DIR) \
-			--no-symlink --force-download --download-version $(CURVER) \
-			--watchfile=$(dir $(_))/watch
-	 	cd $(TEMP_DIR) && tar xzvf *.tar.gz
-
-delete-shipped-debian: download-tarball
-		rm -r $(TEMP_DIR)/libpst-$(CURVER)/debian
-repack-source: delete-shipped-debian
-	 	cd $(TEMP_DIR) && \
-		tar czvf libpst_$(SOURCE_VER).orig.tar.gz \
-			libpst-$(CURVER)
-
-get-orig-source: repack-source
-		mv $(TEMP_DIR)/libpst_$(CURVER).orig.tar.gz ..
-		rm -r $(TEMP_DIR)
-
-.PHONY: download-tarball delete-shipped-debian repack-source get-orig-source
-
--- a/debian/watch	Thu Jan 03 10:09:12 2013 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-version=3
-
-http://www.five-ten-sg.com/libpst/packages/ libpst-(.*)\.tar\.gz
--- a/m4/ax_boost_python.m4	Thu Jan 03 10:09:12 2013 -0800
+++ b/m4/ax_boost_python.m4	Fri Jan 18 08:05:08 2013 -0800
@@ -63,7 +63,7 @@
  AC_LANG_CPLUSPLUS
  CPPFLAGS_SAVE=$CPPFLAGS
  if test x$PYTHON_INCLUDE_DIR != x; then
-   CPPFLAGS=-I$PYTHON_INCLUDE_DIR $CPPFLAGS
+   CPPFLAGS="-I$PYTHON_INCLUDE_DIR $CPPFLAGS"
  fi
  AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
  #include <boost/python/module.hpp>
--- a/regression/regression-tests.bash	Thu Jan 03 10:09:12 2013 -0800
+++ b/regression/regression-tests.bash	Fri Jan 18 08:05:08 2013 -0800
@@ -129,10 +129,10 @@
 #$func  22 rendgen4.pst          # appointment test cases
 #$func  23 rendgen5.pst          # appointment test cases
 $func  24 paul.sheer.pst        # embedded rfc822 attachment
-#$func  25 jerry.pst             # non ascii subject lines
+$func  25 jerry.pst             # non ascii subject lines
 #$func  26 phill.bertolus.pst    # possible segfault in forked process, cannot reproduce
-#$func  27 kaiser.pst            # appointments with other character sets
-#$func  28 pstsample.pst         # character set issue
+$func  27 kaiser.pst            # appointments with other character sets
+$func  28 pstsample.pst         # character set issue
 #$func  29 pstsample2.pst        # embedded image in rtf data
 $func  30 pstsample3.pst        # exports of rtf and html
 
--- a/src/libpst.c	Thu Jan 03 10:09:12 2013 -0800
+++ b/src/libpst.c	Fri Jan 18 08:05:08 2013 -0800
@@ -289,6 +289,17 @@
 static char*            pst_wide_to_single(char *wt, size_t size);
 
 
+static char *pst_getcwd(void) {
+    char *cwd;
+#ifdef HAVE_GET_CURRENT_DIR_NAME
+    cwd = get_current_dir_name();
+#else
+    cwd = pst_malloc(PATH_MAX+1);
+    getcwd(cwd, PATH_MAX+1);
+#endif
+    return cwd;
+}
+
 
 int pst_open(pst_file *pf, const char *name, const char *charset) {
     int32_t sig;
@@ -361,20 +372,24 @@
 
     DEBUG_RET();
 
-    pf->cwd = pst_malloc(PATH_MAX+1);
-    getcwd(pf->cwd, PATH_MAX+1);
+    pf->cwd   = pst_getcwd();
     pf->fname = strdup(name);
     return 0;
 }
 
 
 int  pst_reopen(pst_file *pf) {
-    char cwd[PATH_MAX];
-    if (!getcwd(cwd, PATH_MAX))            return -1;
-    if (chdir(pf->cwd))                    return -1;
-    if (!freopen(pf->fname, "rb", pf->fp)) return -1;
-    if (chdir(cwd))                        return -1;
+    char *cwd;
+    cwd = pst_getcwd();
+    if (cwd == NULL)                       return -1;
+    if (chdir(pf->cwd))                    goto err;
+    if (!freopen(pf->fname, "rb", pf->fp)) goto err;
+    if (chdir(cwd))                        goto err;
+    free(cwd);
     return 0;
+err:
+    free(cwd);
+    return -1;
 }
 
 
--- a/src/pst2dii.cpp.in	Thu Jan 03 10:09:12 2013 -0800
+++ b/src/pst2dii.cpp.in	Fri Jan 18 08:05:08 2013 -0800
@@ -42,7 +42,7 @@
 char*    font_file = NULL;
 int      bates_color = 0xff0000;    // color of bates header stamp
 int      email_sequence = 0;        // current pdf sequence number
-char     pdf_name[PATH_MAX];        // current pdf file name
+char*    pdf_name = NULL;           // current pdf file name
 FILE*    dii_file = NULL;           // the output dii load file
 pst_file pstfile;                   // the input pst file
 
@@ -344,8 +344,9 @@
 {
     if (png_open) {
         png_open = false;
-        char fn[PATH_MAX];
-        snprintf(fn, sizeof(fn), "page%d.png", ++page_sequence);
+        int len = 4 + 11 + 4 +1;
+        char *fn = (char*)pst_malloc(len);
+        snprintf(fn, len, "page%d.png", ++page_sequence);
         FILE *pngout = fopen(fn, "wb");
         if (pngout) {
             gdImagePng(image, pngout);
@@ -354,6 +355,7 @@
         gdImageDestroy(image); // free memory
         png_names.push_back(fn);
         conversion += string(" ") + fn;
+        free(fn);
     }
 }
 
@@ -366,9 +368,12 @@
     conversion    = string(convert);
     png_names.clear();
     open_png();
-    snprintf(pdf_name, sizeof(pdf_name), "dii%06d", ++email_sequence);
+    /* Note; allocating the largest string length to pdf_name */
+    int len = strlen(output_directory) + 4 + 6 + 4 + 1;
+    pdf_name = (char*)pst_malloc(len);
+    snprintf(pdf_name, 3 + 6 + 1, "dii%06d", ++email_sequence);
     fprintf(dii_file, "\n@T %s\n", pdf_name);
-    snprintf(pdf_name, sizeof(pdf_name), "%s/dii%06d.pdf", output_directory, email_sequence);
+    snprintf(pdf_name, len, "%s/dii%06d.pdf", output_directory, email_sequence);
 }
 
 
@@ -382,6 +387,7 @@
         remove((*i).c_str());
     }
     fprintf(dii_file, "@D %s\n", pdf_name);
+    free(pdf_name);
 }