From aae7b9ee835863c560ed1dfbd58e2916300d8ce1 Mon Sep 17 00:00:00 2001
From: Thomas Gellekum <tg@FreeBSD.org>
Date: Tue, 4 Mar 1997 10:09:08 +0000
Subject: Import of the dvi2tty port. dvi2tty gives an approximate textual
 representation of a .dvi file.

Closes PR #2818.

Submitted by:	Joel Sutton <suttonj@interconnect.com.au>
---
 print/dvi2tty/Makefile              | 22 +++++++++++++
 print/dvi2tty/distinfo              |  1 +
 print/dvi2tty/files/patch-aa        | 65 +++++++++++++++++++++++++++++++++++++
 print/dvi2tty/files/readme.patch-aa | 26 +++++++++++++++
 print/dvi2tty/pkg-comment           |  1 +
 print/dvi2tty/pkg-descr             | 15 +++++++++
 print/dvi2tty/pkg-plist             |  2 ++
 7 files changed, 132 insertions(+)
 create mode 100644 print/dvi2tty/Makefile
 create mode 100644 print/dvi2tty/distinfo
 create mode 100644 print/dvi2tty/files/patch-aa
 create mode 100644 print/dvi2tty/files/readme.patch-aa
 create mode 100644 print/dvi2tty/pkg-comment
 create mode 100644 print/dvi2tty/pkg-descr
 create mode 100644 print/dvi2tty/pkg-plist

(limited to 'print')

diff --git a/print/dvi2tty/Makefile b/print/dvi2tty/Makefile
new file mode 100644
index 000000000000..34df6e8b8c0e
--- /dev/null
+++ b/print/dvi2tty/Makefile
@@ -0,0 +1,22 @@
+# New ports collection makefile for:   dvi2tty
+# Version required:	1.0
+# Date created:		17th February 1997
+# Whom:			Joel Sutton <suttonj@interconnect.com.au>
+# FreeBSD Version:	2.1.5-RELEASE
+#
+# $Id$
+#
+      
+DISTNAME=	dvi2tty
+PKGNAME=	dvi2tty-1.0
+CATEGORIES=	print
+MASTER_SITES=	ftp://ctan.unsw.edu.au/ctan/tex-archive/dviware/
+
+MAINTAINER=	suttonj@interconnect.com.au
+
+IGNOREFILES=	${DISTFILES}
+# this WRKSRC courtesy of latest fetch(1) brain-damage
+WRKSRC=		${WRKDIR}/ctan/tex-archive/dviware/dvi2tty
+MAN1=		dvi2tty.1
+
+.include <bsd.port.mk>
diff --git a/print/dvi2tty/distinfo b/print/dvi2tty/distinfo
new file mode 100644
index 000000000000..27bd1a4ca829
--- /dev/null
+++ b/print/dvi2tty/distinfo
@@ -0,0 +1 @@
+MD5 (dvi2tty.tar.gz) = IGNORE
diff --git a/print/dvi2tty/files/patch-aa b/print/dvi2tty/files/patch-aa
new file mode 100644
index 000000000000..9dffcb02b3e9
--- /dev/null
+++ b/print/dvi2tty/files/patch-aa
@@ -0,0 +1,65 @@
+
+--- Makefile.orig	Fri Mar 12 01:05:10 1993
++++ Makefile	Mon May  6 03:03:51 1996
+@@ -6,17 +6,20 @@
+ # This Makefile does not work for MSDOS. Make your 
+ # own one, or compile by hand.
+ #
+-CFLAGS = 
++CFLAGS = -O2
++CC     = gcc
+ 
+ all:	dvi2tty disdvi
+ 
+-dvi2tty:dvi2tty.o dvistuff.o
+-	cc -o dvi2tty dvi2tty.o dvistuff.o
++dvi2tty: dvi2tty.o dvistuff.o
++	$(CC) $(CFLAGS) -o dvi2tty dvi2tty.o dvistuff.o
+ 
+-disdvi:disdvi.c commands.h
+-	cc -o disdvi disdvi.o
++disdvi: disdvi.c commands.h
++	$(CC) $(CFLAGS) -o disdvi disdvi.c
+ 
+ dvi2tty.o: dvi2tty.c dvi2tty.h
+ 
+ dvistuff.o: dvistuff.c dvi2tty.h commands.h
+ 
++clean:
++	rm -f dvi2tty disdvi *.o
+--- dvistuff.c.orig	Fri Mar 12 01:05:35 1993
++++ dvistuff.c	Mon May  6 04:48:49 1996
+@@ -996,13 +996,14 @@
+     }
+     else
+         free(fnt->name);    /* free old name */
+-    if ((name = (char *) malloc(namelen * sizeof(char))) == NULL) {
++    if ((name = (char *) malloc((namelen + 1) * sizeof(char))) == NULL) {
+         perror("fontdef");
+         exit(1);
+     }
+     
+     for (i = 0; i < namelen; i++)
+         name[i] = get1();
++    name[namelen] = '\0';
+     fnt->name = name;
+     if (new) {
+         fnt->next = fonts;
+--- disdvi.c.orig	Fri Mar 12 01:05:11 1993
++++ disdvi.c	Mon May  6 04:47:36 1996
+@@ -348,13 +348,14 @@
+     }
+     else
+         free(fnt->name);    /* free old name */
+-    if ((name = (char *) malloc(namelen * sizeof(char))) == NULL) {
++    if ((name = (char *) malloc((namelen + 1) * sizeof(char))) == NULL) {
+         perror("fontdef");
+         exit(1);
+     }
+     
+     for (i = 0; i < namelen; i++)
+         name[i] = get1();
++    name[namelen] = '\0';
+     fnt->name = name;
+     if (new) {
+         fnt->next = fonts;
diff --git a/print/dvi2tty/files/readme.patch-aa b/print/dvi2tty/files/readme.patch-aa
new file mode 100644
index 000000000000..862582895d5b
--- /dev/null
+++ b/print/dvi2tty/files/readme.patch-aa
@@ -0,0 +1,26 @@
+The following are patches against the standard dvi2tty distribution (at
+least as of March of 1996, but it doesn't look like it's going to be
+changing any time in the near future).  The original code doesn't
+null-terminate a string at several points, apparently relying on the
+assumption that all memory will be zeroed.  This is not the case on
+several systems, most notably Linux.  These patches will also clean up the
+Makefile and add a make clean target.
+
+To apply these patches, use:
+
+	patch < dvi2tty.patch
+
+If you don't have patch on your system, you can obtain it from
+prep.ai.mit.edu (or any mirror) in /pub/gnu; I highly recommend you
+install it.  Alternately, you can just make the below changes by hand
+(there aren't very many).
+
+Feel free to send me questions, other problems, corrections, and the like,
+but please be aware that I am not the official maintainer of this package,
+and although I use it I do not know a lot about the internals.  I'll try
+to help, but don't expect too much.
+
+					Russ Allbery
+					rra@cs.stanford.edu
+
+--------------------------------------------------------------------------
diff --git a/print/dvi2tty/pkg-comment b/print/dvi2tty/pkg-comment
new file mode 100644
index 000000000000..e26c0e4c8782
--- /dev/null
+++ b/print/dvi2tty/pkg-comment
@@ -0,0 +1 @@
+A dvi-file previewer for text only devices.
diff --git a/print/dvi2tty/pkg-descr b/print/dvi2tty/pkg-descr
new file mode 100644
index 000000000000..8bedcb85c906
--- /dev/null
+++ b/print/dvi2tty/pkg-descr
@@ -0,0 +1,15 @@
+dvi2tty is a simple utility which displays a dvi file on a text only
+device, say a terminal or a line printer. 
+
+The output is not perfect but it does give you a basic idea of what
+the final text would look like. I personally use this utility for the
+first step in converting a dvi file into a text file.
+
+This program comes from the CTAN archive and it not currently being
+maintained by anyone. Please see the README files in the distribution
+for more information.
+
+Share and enjoy,
+
+Joel...
+suttonj@interconnect.com.au
diff --git a/print/dvi2tty/pkg-plist b/print/dvi2tty/pkg-plist
new file mode 100644
index 000000000000..959472ec6dd0
--- /dev/null
+++ b/print/dvi2tty/pkg-plist
@@ -0,0 +1,2 @@
+bin/dvi2tty
+man/man1/dvi2tty.1.gz
-- 
cgit v1.2.3