changeset 67:90aa7814ad1f stable-0-6-8

Initial version of pst2dii to convert to Summation dii load file format.
author Carl Byington <carl@five-ten-sg.com>
date Wed, 05 Mar 2008 18:58:40 -0800
parents 32f771bc9c1c
children 0616a2ee9c48
files ChangeLog Makefile.am NEWS configure.in libpst.spec.in package regression/regression-tests.bash src/pst2dii.cpp.in
diffstat 8 files changed, 35 insertions(+), 116 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Feb 26 17:36:57 2008 -0800
+++ b/ChangeLog	Wed Mar 05 18:58:40 2008 -0800
@@ -1,4 +1,4 @@
-LibPST 0.6.8 (2008-xx-xx)
+LibPST 0.6.8 (2008-03-05)
 ===============================
         * Initial version of pst2dii to convert to Summation dii load file format.
         * Changes for Fedora packaging (#434727)
--- a/Makefile.am	Tue Feb 26 17:36:57 2008 -0800
+++ b/Makefile.am	Wed Mar 05 18:58:40 2008 -0800
@@ -1,3 +1,5 @@
 SUBDIRS = src man html info
+htmldir = ${datadir}/doc/@PACKAGE@-@VERSION@
+html_DATA = AUTHORS COPYING ChangeLog NEWS README
 CLEANFILES = xml/libpst xml/Makefile
 EXTRA_DIST = Doxyfile libpst.html.tar.gz libpst.spec $(wildcard xml/M*) $(wildcard xml/h*) $(wildcard xml/lib*)
--- a/NEWS	Tue Feb 26 17:36:57 2008 -0800
+++ b/NEWS	Wed Mar 05 18:58:40 2008 -0800
@@ -1,4 +1,4 @@
-0.6.8   2008-02-26 Initial version of pst2dii to convert to Summation dii load file format.
+0.6.8   2008-03-05 Initial version of pst2dii to convert to Summation dii load file format.
 0.6.7   2008-02-16 Ignore unknown attachments on some read messages; autoconf cleanup.
 0.6.6   2008-01-31 Code cleanup, switch from cvs to mercurial source control.
 0.6.5   2008-01-22 Code cleanup, rpm group Applications/Productivity.
--- a/configure.in	Tue Feb 26 17:36:57 2008 -0800
+++ b/configure.in	Wed Mar 05 18:58:40 2008 -0800
@@ -8,7 +8,7 @@
 # Checks for programs.
 my_build_dii=yes
 AC_PATH_PROG(CONVERT, convert)
-if test "x$CONVERT" = x ; then
+if test "x$CONVERT" = "x" ; then
     AC_MSG_WARN([convert not found.  pst2dii disabled])
     my_build_dii=no
 fi
@@ -33,6 +33,9 @@
 AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_CHECK_HEADERS([fcntl.h limits.h malloc.h netinet/in.h stdint.h stdlib.h string.h sys/param.h wchar.h])
+if test "$my_build_dii" = "yes"; then
+    AC_CHECK_HEADERS([gd.h])
+fi
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_HEADER_STDBOOL
--- a/libpst.spec.in	Tue Feb 26 17:36:57 2008 -0800
+++ b/libpst.spec.in	Wed Mar 05 18:58:40 2008 -0800
@@ -1,5 +1,3 @@
-%define localstatedir   /var/lib
-
 Summary:            Utilities to convert Outlook .pst files to other formats
 Name:               @PACKAGE@
 Version:            @VERSION@
@@ -24,10 +22,12 @@
 %prep
 %setup -q
 
+
 %build
 %configure
 make %{?_smp_mflags}
 
+
 %install
 rm -rf $RPM_BUILD_ROOT
 make DESTDIR=$RPM_BUILD_ROOT install
@@ -36,16 +36,18 @@
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+
 %files
 %defattr(-,root,root,-)
 %{_bindir}/*
 %{_mandir}/man1/*
 %{_mandir}/man5/*
-%doc AUTHORS COPYING ChangeLog NEWS README
+%docdir %{_datadir}/doc/%{name}-%{version}
+%{_datadir}/doc/%{name}-%{version}
 
 
 %changelog
-* Tue Feb 26 2008 Carl Byington <carl@five-ten-sg.com> - 0.6.8
+* Wed Mar 05 2008 Carl Byington <carl@five-ten-sg.com> - 0.6.8
 - Initial version of pst2dii to convert to Summation dii load file format
 - changes for Fedora packaging guidelines (#434727)
 
--- a/package	Tue Feb 26 17:36:57 2008 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-#!/bin/bash
-
-find . -name '*~' | while read a; do rm -f "$a"; done
-
-# setup environment
-T=`grep AC_INIT configure.in | cut -d'(' -f2`
-NAME=`echo $T | cut -d, -f1`
-VER=`echo $T | cut -d, -f2`
-BALL=$NAME-$VER.tar.gz
-web=/home/httpd/html/510sg/$NAME
-distlog=/tmp/distcheck
-repo=/usr/hg-repository/$NAME
-oldone=$web/packages/$BALL
-
-if [ -f $oldone ]; then
-    echo "$oldone already exists, did you update the version in configure.in?"
-    exit 0
-fi
-
-# check for uncommitted changes
-a=$(hg status)
-if [ -n "$a" ]; then
-    hg status
-    echo "fix those first with 'hg commit'"
-    exit 0
-fi
-
-# check for changesets pending push to global repository
-hg outgoing $repo | grep 'no changes found' >/dev/null
-if [ $? -ne 0 ]; then
-    hg outgoing $repo
-    echo "fix those first with 'hg push $repo'"
-    exit 0
-fi
-
-# get a new clean copy from source control
-orig=$(pwd)
-pack=$orig/../$NAME-package
-[ -d "$pack" ] && rm -rf "$pack"
-mkdir "$pack"
-cd "$pack"
-hg clone $repo
-cd $NAME
-
-# build the package
-mkdir -p $web
-chown --recursive root:root *
-make -f *cvs
-./configure >/dev/null
-(cd xml; make; make distclean)
-cp -a html/*html $web
-make distcheck >$distlog 2>&1
-
-if [ $? -eq 0 ]; then
-    if [ -f $BALL ]; then
-        # expand locally to see the tarball
-        rm -rf junk
-        mkdir junk
-        cd junk
-            tar xfz ../$BALL
-            cd $NAME-$VER
-                ./configure >/dev/null
-                make >/dev/null
-            cd ..
-        cd ..
-
-        # build rpm on target
-        target5=pmg2
-        scp $BALL $target5:/tmp
-        ssh $target5 "cd /tmp; rpmbuild -ta $BALL"
-
-        # build rpm on target
-        target4=host62
-        scp $BALL $target4:/tmp
-        ssh $target4 "cd /tmp; rpmbuild -ta $BALL"
-
-        # add packages to the web site
-        wp=$web/packages
-        wp4=$wp/centos4
-        wp5=$wp/centos5
-        mkdir -p $wp4 $wp5
-        rp=/usr/src/redhat
-        mv -f $BALL $wp
-        scp $target4:$rp/SRPMS/$NAME-$VER*rpm $wp
-        scp $target4:$rp/RPMS/i386/$NAME-$VER*rpm $wp4
-        scp $target5:$rp/RPMS/i386/$NAME-$VER*rpm $wp5
-        (cd $web; chown --recursive web:web *; ls -alR)
-        rpm -ql -p $wp4/$NAME-$VER*6.rpm
-        rpm -ql -p $wp5/$NAME-$VER*6.rpm
-    fi
-else
-    tail -10 $distlog
-fi
-
-# throw away the packaging directory
-cd "$pack/.."
-rm -rf $NAME-package
-cd "$orig"
--- a/regression/regression-tests.bash	Tue Feb 26 17:36:57 2008 -0800
+++ b/regression/regression-tests.bash	Wed Mar 05 18:58:40 2008 -0800
@@ -19,6 +19,7 @@
       ../src/readpstlog -f I dumper >test.log
       ../src/pst2dii  -f /usr/share/fonts/bitstream-vera/VeraMono.ttf -B "bates-" -o output4 -O mydii4 -d dumper big_mail.pst
       ../src/readpstlog -f I dumper >big_mail.log
+exit
 
 $val  ../src/pst2ldif -b 'o=ams-cc.com, c=US' -c 'newPerson' ams.pst >ams.err  2>&1
 $val  ../src/readpst -cv    -o output1 ams.pst                       >out1.err 2>&1
--- a/src/pst2dii.cpp.in	Tue Feb 26 17:36:57 2008 -0800
+++ b/src/pst2dii.cpp.in	Wed Mar 05 18:58:40 2008 -0800
@@ -7,7 +7,7 @@
 Based on readpst.c by David Smith
 
 */
-#include "gd.h"
+#include <gd.h>
 #include <stdio.h>
 #include <iostream>
 #include <unistd.h>
@@ -263,9 +263,26 @@
 }
 
 
+static void new_line();
+static void new_line()
+{
+    y_position  += line_height;
+    line_number += 1;
+    x_position   = margin;
+    col_number   = 0;
+}
+
+
 static void print_pdf_single(char *line, int color);
 static void print_pdf_single(char *line, int color)
 {
+    while (*line == '\t') {
+        char blanks[5];
+        memset(blanks, ' ', 5);
+        print_pdf_short(blanks, 4, color);
+        line++;
+        if (col_number >= col_max) new_line();
+    }
     int n = strlen(line);
     while (n) {
         int m = col_max - col_number;   // number of chars that will fit on this line
@@ -273,12 +290,7 @@
         print_pdf_short(line, m, color);
         line += m;
         n    -= m;
-        if (n) {
-            y_position  += line_height;
-            line_number += 1;
-            x_position   = margin;
-            col_number   = 0;
-        }
+        if (n) new_line();
     }
 }
 
@@ -292,10 +304,7 @@
         print_pdf_single(line, color);
         *p = '\n';
         line = p+1;
-        y_position  += line_height;
-        line_number += 1;
-        x_position   = margin;
-        col_number   = 0;
+        new_line();
     }
     print_pdf_single(line, color);
 }