Index: Makefile
===================================================================
RCS file: /cvs/ports/print/mpage/Makefile,v
retrieving revision 1.25
diff -N -u Makefile
--- Makefile	15 Sep 2007 23:36:43 -0000	1.25
+++ Makefile	21 May 2010 02:04:36 -0000
@@ -2,10 +2,10 @@
 
 COMMENT=	print multiple pages per sheet on PostScript printer
 
-DISTNAME=	mpage-2.5.3
+DISTNAME=	mpage-2.5.6
 CATEGORIES=	print
 
-MAINTAINER=	Ian McWilliam <ian@dodo.com.au>
+MAINTAINER=	Ian McWilliam <kaosagnt@tpg.com.au>
 
 PERMIT_PACKAGE_CDROM=	incomplete license
 PERMIT_PACKAGE_FTP=	incomplete license
Index: distinfo
===================================================================
RCS file: /cvs/ports/print/mpage/distinfo,v
retrieving revision 1.5
diff -N -u distinfo
--- distinfo	5 Apr 2007 16:20:19 -0000	1.5
+++ distinfo	21 May 2010 02:04:36 -0000
@@ -1,5 +1,5 @@
-MD5 (mpage-2.5.3.tgz) = RyTcuiAxADhLRhG+ityQDA==
-RMD160 (mpage-2.5.3.tgz) = pPrFvXvu48+g7kxFKMLllxlq0KI=
-SHA1 (mpage-2.5.3.tgz) = gz7tXuZpgLrRhfQKxBRfNnHKzoc=
-SHA256 (mpage-2.5.3.tgz) = HV/1MPC1eQMbJtmFGYdirBOtAPp55Ezq1i2Oxn6dTMQ=
-SIZE (mpage-2.5.3.tgz) = 82101
+MD5 (mpage-2.5.6.tgz) = SJZjySRuR5Fc6pMTSOUXXQ==
+RMD160 (mpage-2.5.6.tgz) = 9+kUgWLi8gw8feAaJFhT/p+K5qg=
+SHA1 (mpage-2.5.6.tgz) = a+IMKJJSOBQZjLErFol4FjiiwjA=
+SHA256 (mpage-2.5.6.tgz) = T+Zt/Cf3xL+8pg72F/loqi5u6HfokhqpaMFqA6pO3AQ=
+SIZE (mpage-2.5.6.tgz) = 86748
Index: patches/patch-args_c
===================================================================
RCS file: /cvs/ports/print/mpage/patches/patch-args_c,v
retrieving revision 1.4
diff -N -u patches/patch-args_c
--- patches/patch-args_c	19 May 2010 14:55:00 -0000	1.4
+++ patches/patch-args_c	21 May 2010 02:04:36 -0000
@@ -1,15 +1,15 @@
 $OpenBSD: patch-args_c,v 1.4 2010/05/19 14:55:00 espie Exp $
---- args.c.orig	Wed Oct 16 23:22:48 2002
-+++ args.c	Wed May 19 14:52:00 2010
-@@ -35,6 +35,7 @@ do_args(int argc, char **argv, int envflag)
-     int consumed;
+--- args.c.orig	Mon May 31 05:37:45 2004
++++ args.c	Fri May 21 11:57:57 2010
+@@ -36,6 +36,7 @@ do_args(int argc, char **argv, int envflag)
+     int finished;
      int currarg;
      int opterrors;
 +    size_t len;
  
      int i;
  
-@@ -142,18 +143,17 @@ do_args(int argc, char **argv, int envflag)
+@@ -152,18 +153,17 @@ do_args(int argc, char **argv, int envflag)
                          break;
                  case 'C':    /* select character definitions */
                          consumed = 1;
Index: patches/patch-file_c
===================================================================
RCS file: /cvs/ports/print/mpage/patches/patch-file_c,v
retrieving revision 1.2
diff -N -u patches/patch-file_c
--- patches/patch-file_c	13 Nov 2002 17:15:49 -0000	1.2
+++ patches/patch-file_c	21 May 2010 02:04:36 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-file_c,v 1.2 2002/11/13 17:15:49 naddy Exp $
---- file.c.orig	Sun Jun 16 02:56:44 2002
-+++ file.c	Mon Nov 11 06:54:23 2002
+--- file.c.orig	Sat Sep 17 20:38:53 2005
++++ file.c	Wed Mar 24 12:18:35 2010
 @@ -18,6 +18,7 @@
   */
  
@@ -9,41 +9,58 @@
  #include "mpage.h"
  
  
-@@ -101,10 +102,10 @@ do_pr_file(fname, asheet, outfd)
-      * header or not
+@@ -119,11 +120,11 @@ do_pr_file(fname, asheet, outfd)
       */
+ #define DASHES "-- "
      if (opt_header != NULL)
--        (void)sprintf(command, "%s -l%d -w%d -h \"%s\" %s", prprog,
-+        (void)snprintf(command, sizeof(command), "%s -l%d -w%d -h \"%s\" %s", prprog,
-                   asheet->sh_plength, asheet->sh_cwidth, opt_header, fname);
+-        (void)sprintf(command, "%s -l%d -w%d -h \"%s\" %s%s", prprog,
++        (void)snprintf(command, sizeof(command),"%s -l%d -w%d -h \"%s\" %s%s", prprog,
+                   asheet->sh_plength, asheet->sh_cwidth, opt_header,
+                   fname[0] == '-' ? DASHES : "", fname);
      else
--        (void)sprintf(command, "%s -l%d -w%d %s", prprog,
-+        (void)snprintf(command, sizeof(command), "%s -l%d -w%d %s", prprog,
-                   asheet->sh_plength, asheet->sh_cwidth, fname);
+-        (void)sprintf(command, "%s -l%d -w%d %s%s", prprog,
++        (void)snprintf(command, sizeof(command), "%s -l%d -w%d %s%s", prprog,
+                   asheet->sh_plength, asheet->sh_cwidth,
+                   fname[0] == '-' ? DASHES : "", fname);
      /*
-      * open a pipe to the proper pr(1) command, and pr provides
-@@ -148,7 +149,7 @@ do_stdin(asheet, outfd)
+@@ -168,7 +169,7 @@ do_stdin(asheet, outfd)
+      * but the tmpfilename
+      */
+      
+-    (void) strcpy(tmpfile, "/tmp/mpage-stdin-XXXXXX");
++    (void) strlcpy(tmpfile, "/tmp/mpage-stdin-XXXXXX", sizeof(tmpfile));
+     if ( (tmpfd = mkstemp(tmpfile)) == -1) {
+         fprintf(stderr, "%s: cannot create temporary file", MPAGE);
+         perror(MPAGE);
+@@ -209,7 +210,7 @@ do_stdin(asheet, outfd)
           * a temporary file; this temporary file will then
           * be used as input to the do_doc routine
           */
--        (void)strcpy(tmpfile, "/usr/tmp/mpageXXXXXX");
+-        (void)strcpy(tmpfile, "/tmp/mpageXXXXXX");
 +        (void)strlcpy(tmpfile, "/tmp/mpageXXXXXX", sizeof(tmpfile));
          if ( (tmpfd = mkstemp(tmpfile)) == -1) {
              fprintf(stderr, "%s: cannot create temporary file", MPAGE);
              perror(MPAGE);
-@@ -156,11 +157,13 @@ do_stdin(asheet, outfd)
+@@ -217,11 +218,11 @@ do_stdin(asheet, outfd)
  	}
          close(tmpfd);
          if (opt_header != NULL)
--            (void)sprintf(command, "%s -l%d -w%d -h \"%s\"> %s", prprog,
-+            (void)snprintf(command, sizeof(command), 
-+		    "%s -l%d -w%d -h \"%s\"> %s", prprog,
+-            (void)sprintf(command, "%s -l%d -w%d -h \"%s\" > %s", prprog,
++            (void)snprintf(command, sizeof(command), "%s -l%d -w%d -h \"%s\" > %s", prprog,
                        asheet->sh_plength, asheet->sh_cwidth,
                        opt_header, tmpfile);
          else
 -            (void)sprintf(command, "%s -l%d -w%d > %s", prprog,
-+            (void)snprintf(command, sizeof(command),
-+		    "%s -l%d -w%d > %s", prprog,
++            (void)snprintf(command, sizeof(command), "%s -l%d -w%d > %s", prprog,
                        asheet->sh_plength, asheet->sh_cwidth, tmpfile);
          /*
           * open a pipe to the pr(1) command which will create a
+@@ -281,7 +282,7 @@ do_stdin(asheet, outfd)
+ 	/*
+ 	 * store the input to the temporary file to guess encoding correctly
+ 	 */
+-        (void)strcpy(tmpfile, "/tmp/mpageXXXXXX");
++        (void)strlcpy(tmpfile, "/tmp/mpageXXXXXX", sizeof(tmpfile));
+         if ( (tmpfd = mkstemp(tmpfile)) == -1) {
+             fprintf(stderr, "%s: cannot create temporary file", MPAGE);
+ 	    tmpfile[0] = 0;
Index: patches/patch-mpage_1_in
===================================================================
RCS file: /cvs/ports/print/mpage/patches/patch-mpage_1_in,v
retrieving revision 1.2
diff -N -u patches/patch-mpage_1_in
--- patches/patch-mpage_1_in	13 Nov 2002 17:20:42 -0000	1.2
+++ patches/patch-mpage_1_in	21 May 2010 02:04:36 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-mpage_1_in,v 1.2 2002/11/13 17:20:42 naddy Exp $
---- mpage.1.in.orig	Sun Oct 20 20:50:58 2002
-+++ mpage.1.in	Wed Nov 13 18:19:15 2002
-@@ -539,7 +539,7 @@ and 
+--- mpage.1.in.orig	Mon Jan 14 23:54:28 2008
++++ mpage.1.in	Wed Mar 24 12:13:27 2010
+@@ -546,7 +546,7 @@ and 
  environment variables.
  
  .SH FILES
Index: patches/patch-mpage_c
===================================================================
RCS file: /cvs/ports/print/mpage/patches/patch-mpage_c,v
retrieving revision 1.1
diff -N -u patches/patch-mpage_c
--- patches/patch-mpage_c	7 Jul 2002 17:03:37 -0000	1.1
+++ patches/patch-mpage_c	21 May 2010 02:04:36 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-mpage_c,v 1.1 2002/07/07 17:03:37 naddy Exp $
---- mpage.c.orig	Tue Nov 13 18:04:46 2001
-+++ mpage.c	Sun May 19 01:00:14 2002
-@@ -74,10 +74,10 @@ char **argv;
+--- mpage.c.orig	Wed Jan  9 21:47:07 2008
++++ mpage.c	Wed Mar 24 12:13:27 2010
+@@ -79,10 +79,10 @@ char **argv;
       */
      if (doprint) {
          if (printque != NULL)
Index: patches/patch-mpage_h
===================================================================
RCS file: /cvs/ports/print/mpage/patches/patch-mpage_h,v
retrieving revision 1.1
diff -N -u patches/patch-mpage_h
--- patches/patch-mpage_h	19 May 2010 14:55:00 -0000	1.1
+++ patches/patch-mpage_h	21 May 2010 02:04:36 -0000
@@ -1,36 +1,32 @@
 $OpenBSD: patch-mpage_h,v 1.1 2010/05/19 14:55:00 espie Exp $
---- mpage.h.orig	Wed May 19 16:50:06 2010
-+++ mpage.h	Wed May 19 16:53:54 2010
-@@ -172,6 +172,16 @@ extern int errno;
- extern int ps_width;	/* number of points in the X direction (8.5 inches) */
- extern int ps_height;	/* number of points in the Y direction (11 inches) */
- extern char * media;	/* name of output page media */
-+
+--- mpage.h.orig	Mon Jan 14 23:52:30 2008
++++ mpage.h	Fri May 21 12:02:36 2010
+@@ -204,6 +204,13 @@ struct pagebox {
+ 	int thick;/* line thickness */
+ };
+ 
++    
 +/*
-+ * Structure to describe a physical piece of paper, e.g. A4 or Letter
++ * some basic PS parameters
 + */
-+struct page_desc {
-+    char *media;
-+    int width;
-+    int height;
-+};
-+    
- extern struct page_desc paper[];
++extern int ps_width;	/* number of points in the X direction (8.5 inches) */
++extern int ps_height;	/* number of points in the Y direction (11 inches) */
++extern char * media;	/* name of output page media */
  
  /*
-@@ -213,15 +223,6 @@ struct pagebox {
+  * Structure to describe a physical piece of paper, e.g. A4 or Letter
+@@ -213,14 +220,6 @@ struct page_desc {
+     int width;
+     int height;
  };
- 
- 
+-    
 -/*
-- * Structure to describe a physical piece of paper, e.g. A4 or Letter
+- * some basic PS parameters
 - */
--struct page_desc {
--    char *media;
--    int width;
--    int height;
--};
--    
+-extern int ps_width;	/* number of points in the X direction (8.5 inches) */
+-extern int ps_height;	/* number of points in the Y direction (11 inches) */
+-extern char * media;	/* name of output page media */
+-
  
- /* array of sheets where pages are ordered for coli ??? */
- extern struct sheet coli[];
+ extern struct page_desc paper[];
+ 
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/print/mpage/pkg/PLIST,v
retrieving revision 1.5
diff -N -u pkg/PLIST
--- pkg/PLIST	15 Sep 2004 18:32:14 -0000	1.5
+++ pkg/PLIST	21 May 2010 02:04:36 -0000
@@ -1,5 +1,5 @@
 @comment $OpenBSD: PLIST,v 1.5 2004/09/15 18:32:14 espie Exp $
-bin/mpage
+@bin bin/mpage
 @man man/man1/mpage.1
 share/mpage/
 share/mpage/CP850.PC
