diff options
author | Hiroki Sato <hrs@FreeBSD.org> | 2013-04-27 16:00:26 +0000 |
---|---|---|
committer | Hiroki Sato <hrs@FreeBSD.org> | 2013-04-27 16:00:26 +0000 |
commit | 03156fbc9e57b8833d571c09fe86a65de05d8966 (patch) | |
tree | a41583195bf11eaddcc25d81461b4a49df2cefca /print/lprps | |
parent | bfd963a8d0744b35d2c9acd4b82023eadad3a02d (diff) |
Notes
Diffstat (limited to 'print/lprps')
-rw-r--r-- | print/lprps/Makefile | 38 | ||||
-rw-r--r-- | print/lprps/distinfo | 2 | ||||
-rw-r--r-- | print/lprps/files/patch-Makefile | 59 | ||||
-rw-r--r-- | print/lprps/files/patch-ae | 64 | ||||
-rw-r--r-- | print/lprps/files/patch-lprps.c | 60 | ||||
-rw-r--r-- | print/lprps/files/patch-psif.c | 10 | ||||
-rw-r--r-- | print/lprps/files/patch-psof.c | 26 | ||||
-rw-r--r-- | print/lprps/files/patch-psrev.c | 31 | ||||
-rw-r--r-- | print/lprps/files/patch-textps.c | 54 | ||||
-rw-r--r-- | print/lprps/pkg-descr | 21 | ||||
-rw-r--r-- | print/lprps/pkg-plist | 10 |
11 files changed, 375 insertions, 0 deletions
diff --git a/print/lprps/Makefile b/print/lprps/Makefile new file mode 100644 index 000000000000..0ac307ac1fb9 --- /dev/null +++ b/print/lprps/Makefile @@ -0,0 +1,38 @@ +# Created by: David O'Brien <obrien@FreeBSD.org> +# $FreeBSD$ + +PORTNAME= lprps +PORTVERSION= 2.5 +CATEGORIES= print +MASTER_SITES= ftp://ftp.jclark.com/pub/lprps/ +EXTRACT_SUFX= .tar.Z + +MAINTAINER= hrs@FreeBSD.org +COMMENT= PostScript printer filter supporting a bidirectional serial channel + +LIB_DEPENDS= paper:${PORTSDIR}/print/libpaper + +PORTDOCS= INSTALL +MAN1= psrev.1 textps.1 +MAN8= lprps.8 psif.8 psof.8 + +do-install: + ${MKDIR} ${DATADIR} + cd ${WRKSRC} && \ + ${INSTALL_PROGRAM} textps psrev ${PREFIX}/bin && \ + ${INSTALL_PROGRAM} psif lprps psof ${PREFIX}/libexec && \ + ${INSTALL_SCRIPT} psif-text psif-ps ${PREFIX}/libexec && \ + ${INSTALL_DATA} banner.ps ${DATADIR} && \ + ${INSTALL_MAN} textps.n ${PREFIX}/man/man1/textps.1 && \ + ${INSTALL_MAN} psrev.n ${PREFIX}/man/man1/psrev.1 && \ + ${INSTALL_MAN} lprps.n ${PREFIX}/man/man8/lprps.8 && \ + ${INSTALL_MAN} psif.n ${PREFIX}/man/man8/psif.8 && \ + ${INSTALL_MAN} psof.n ${PREFIX}/man/man8/psof.8 + +post-install: +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} + cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR} +.endif + +.include <bsd.port.mk> diff --git a/print/lprps/distinfo b/print/lprps/distinfo new file mode 100644 index 000000000000..a08d19f6ecd2 --- /dev/null +++ b/print/lprps/distinfo @@ -0,0 +1,2 @@ +SHA256 (lprps-2.5.tar.Z) = 3bcf23e06e48b5ec9aa641cc591bd8d5bdecb8ddd0d8e63dfb61c4f09602192e +SIZE (lprps-2.5.tar.Z) = 41630 diff --git a/print/lprps/files/patch-Makefile b/print/lprps/files/patch-Makefile new file mode 100644 index 000000000000..1b474346f1b2 --- /dev/null +++ b/print/lprps/files/patch-Makefile @@ -0,0 +1,59 @@ +--- Makefile.orig 1993-02-22 21:45:50.000000000 +0900 ++++ Makefile 2013-04-27 22:53:50.000000000 +0900 +@@ -3,21 +3,21 @@ + # Define IIg to enable a workaround for a bug in the serial + # driver of the Laserwriter IIf and IIg; this requires the POSIX + # tcdrain() function. (I haven't tested this personally.) +-DEFINES=-DA4 #-DIIg +-PREFIX=/usr/local ++DEFINES= + # Where to install public executables. + BINDIR=$(PREFIX)/bin + # Where to install private executables. +-LIBDIR=$(PREFIX)/lib ++LIBDIR=$(PREFIX)/libexec + # Define REV_COMMAND to be empty if documents don't need to + # be printed in reverse order. +-REV_COMMAND=$(BINDIR)/psrev | ++#REV_COMMAND=$(BINDIR)/psrev | ++REV_COMMAND= + # Where to install the filter for text files. + TEXT_FILTER=$(LIBDIR)/psif-text + # Where to install the filter for PostScript files. + PS_FILTER=$(LIBDIR)/psif-ps + # Where to install PostScript banner printing code +-BANNER=$(LIBDIR)/banner.ps ++BANNER=$(PREFIX)/share/misc/banner.ps + # Filter to convert text to PostScript. You can use your own instead. + # It must be able to read from standard input. + TEXT_TO_PS=$(BINDIR)/textps +@@ -29,15 +29,15 @@ + MAN8EXT=8 + MAN8DIR=$(MANROOT)/man$(MAN8EXT) + +-CC=cc +-CFLAGS=-O $(DEFINES) ++CC?=cc ++CFLAGS+=-I${LOCALBASE}/include $(DEFINES) + #CFLAGS=-g -Bstatic $(DEFINES) + # Command for installing programs. +-INSTALL_PROGRAM=install ++INSTALL_PROGRAM=${BSD_INSTALL_PROGRAM} + # Command for installing man pages. +-INSTALL_DATA=install -m 0444 ++INSTALL_DATA=${BSD_INSTALL_DATA} + +-SHELL=/bin/sh ++SHELL=${SH} + # Uncomment the next line for Ultrix. + #SHELL=/bin/sh5 + +@@ -89,7 +89,7 @@ + -DPS_FILTER=\"$(PS_FILTER)\" -o $@ psif.c + + textps: textps.c +- $(CC) $(CFLAGS) -o $@ textps.c ++ $(CC) $(CFLAGS) -o $@ textps.c -lpaper -L${LOCALBASE}/lib + + psrev: psrev.c + $(CC) $(CFLAGS) -o $@ psrev.c diff --git a/print/lprps/files/patch-ae b/print/lprps/files/patch-ae new file mode 100644 index 000000000000..919ad1f5ced3 --- /dev/null +++ b/print/lprps/files/patch-ae @@ -0,0 +1,64 @@ +--- INSTALL.orig Mon Feb 22 04:46:07 1993 ++++ INSTALL Sat May 24 21:46:37 1997 +@@ -8,23 +8,23 @@ + You need to add an entry in /etc/printcap. Here's the entry I use: + + lp|ps:\ +- :br#38400:lp=/dev/ttya:mx#0:sf:sh:rw:sb:\ ++ :br#38400:lp=/dev/ttyd0:mx#0:sf:sh:rw:sb:\ + :fc#0177777:fs#003:ms=-isig,igncr,cstopb,-echok:\ +- :af=/usr/adm/psacct:lf=/usr/adm/pslog:sd=/usr/spool/pslpd:\ +- :if=/usr/local/lib/psif: ++ :af=/var/log/psacct:lf=/var/log/pslog:sd=/var/spool/output/pslpd:\ ++ :if=/usr/local/libexec/psif: + +-This entry would be appropriate if you were using /dev/ttya and a baud ++This entry would be appropriate if you were using /dev/ttyd0 and a baud + rate of 38400. Note that the `sf', `rw' and `sb' capabilities are +-essential. You need to create the spool directory (/usr/spool/pslpd), +-the accounting file (/usr/adm/psacct), and the log file +-(/usr/adm/pslog). The spool directory and the accounting file should ++essential. You need to create the spool directory (/var/spool/output/pslpd), ++the accounting file (/var/log/psacct), and the log file ++(/var/log/pslog). The spool directory and the accounting file should + be owned by daemon, the log file by root. You can use other names if + you want. The `ms' capabability is a Sun extension. If you decide to + make use of the patches in lpr.diff, you should also add the `ex' + boolean capability (the patches also add the `ms' capability.) + + If you wish to have banner printing, then you should add +-`of=/usr/local/lib/psof', and remove the `sh' capability. You will ++`of=/usr/local/libexec/psof', and remove the `sh' capability. You will + probably also wnat to modify the banner printing code in banner.ps. + As distributed, it provides a fairly minimalist banner page. Note + that psof requires the `sb' capability. If your printer stacks face +@@ -35,12 +35,12 @@ + You can add easily add other filters. For example, suppose you want to + add a filter for dvi files. Then add an entry to /etc/printcap: + +- :df=/usr/local/lib/psdf: ++ :df=/usr/local/libexec/psdf: + +-Then create a shell script /usr/local/lib/psdf ++Then create a shell script /usr/local/libexec/psdf + + #!/bin/sh +-/usr/local/bin/dvitops | /usr/local/lib/lprps "$@" ++/usr/local/bin/dvitops | /usr/local/libexec/lprps "$@" + + Replace `/usr/local/bin/dvitops' by the name of your favourite dvi to + ps program (it must be able to read from the standard input). Then you +@@ -49,11 +49,11 @@ + You must also set the printer's communication parameters. Make sure + you have an entry like this in /etc/remote: + +- ttya:dv=/dev/ttya:br#1200:el=^D: ++ ttyd0:dv=/dev/ttyd0:br#1200:el=^D: + + Set the switch on your printer to position labelled 1200 or 0. Then + +- tip ttya ++ tip ttyd0 + + (*)Now carefully type + diff --git a/print/lprps/files/patch-lprps.c b/print/lprps/files/patch-lprps.c new file mode 100644 index 000000000000..08f4e761355f --- /dev/null +++ b/print/lprps/files/patch-lprps.c @@ -0,0 +1,60 @@ +--- lprps.c.orig 1993-02-22 21:46:10.000000000 +0900 ++++ lprps.c 2013-04-27 23:00:32.000000000 +0900 +@@ -5,7 +5,9 @@ + #endif + + #include <stdio.h> ++#include <stdlib.h> + #include <ctype.h> ++#include <string.h> + #include <strings.h> + #include <sys/types.h> + #include <sys/ioctl.h> +@@ -15,8 +17,13 @@ + #include <sys/time.h> + #include <signal.h> + #include <syslog.h> ++#include <unistd.h> + #include <errno.h> + ++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) ++#include <sys/param.h> ++#endif ++ + #ifndef errno + extern int errno; + #endif +@@ -27,7 +34,13 @@ + #define VOLATILE /* as nothing */ + #endif + +-#define SENDMAIL "/usr/lib/sendmail" ++#ifndef SENDMAIL ++# if (defined(BSD) && (BSD >= 199103)) ++# define SENDMAIL "/usr/sbin/sendmail" ++# else ++# define SENDMAIL "/usr/lib/sendmail" ++# endif ++#endif + + #define EXIT_SUCCESS 0 + #define EXIT_REPRINT 1 +@@ -43,8 +56,6 @@ + char ctrl_d = '\004'; + char ctrl_t = '\024'; + +-char *malloc(); +- + /* user's login name */ + char *login = 0; + /* user's host */ +@@ -346,7 +357,9 @@ + char *strsignal(n) + int n; + { ++# if !(defined(BSD) && (BSD >= 199103)) + extern char *sys_siglist[]; ++# endif + static char buf[32]; + if (n >= 0 && n < NSIG) + return sys_siglist[n]; diff --git a/print/lprps/files/patch-psif.c b/print/lprps/files/patch-psif.c new file mode 100644 index 000000000000..374330a22587 --- /dev/null +++ b/print/lprps/files/patch-psif.c @@ -0,0 +1,10 @@ +--- psif.c.orig 2013-04-27 22:58:26.000000000 +0900 ++++ psif.c 2013-04-27 22:58:42.000000000 +0900 +@@ -5,6 +5,7 @@ + #endif + + #include <stdio.h> ++#include <stdlib.h> + #include <sys/types.h> + #include <sys/stat.h> + diff --git a/print/lprps/files/patch-psof.c b/print/lprps/files/patch-psof.c new file mode 100644 index 000000000000..54197b8d20cd --- /dev/null +++ b/print/lprps/files/patch-psof.c @@ -0,0 +1,26 @@ +--- psof.c.orig 1993-02-22 21:46:11.000000000 +0900 ++++ psof.c 2013-04-27 23:05:56.000000000 +0900 +@@ -11,11 +11,14 @@ + #endif + + #include <stdio.h> ++#include <stdlib.h> ++#include <string.h> + #include <strings.h> + #include <signal.h> + #include <syslog.h> + #include <errno.h> + #include <ctype.h> ++#include <unistd.h> + + #ifndef errno + extern int errno; +@@ -216,7 +219,7 @@ + if ((status & 0xff) != 0) { + int sig = status & 0x7f; + if (sig < NSIG) { +- extern char *sys_siglist[]; ++ /* extern char *sys_siglist[]; */ + syslog(LOG_ERR, "%s: %s%s", LPRPS, sys_siglist[sig], + (status & 0x80) ? " (core dumped)" : ""); + } diff --git a/print/lprps/files/patch-psrev.c b/print/lprps/files/patch-psrev.c new file mode 100644 index 000000000000..2c59b7001dfb --- /dev/null +++ b/print/lprps/files/patch-psrev.c @@ -0,0 +1,31 @@ +--- psrev.c.orig 1993-02-22 21:46:09.000000000 +0900 ++++ psrev.c 2013-04-27 22:56:35.000000000 +0900 +@@ -5,6 +5,7 @@ + #endif + + #include <stdio.h> ++#include <stdlib.h> + #include <ctype.h> + #include <sys/types.h> + #include <sys/stat.h> +@@ -14,9 +15,6 @@ + extern int errno; + #endif + +-char *malloc(); +-char *realloc(); +- + char *xmalloc(); + char *xrealloc(); + char *prog; +@@ -24,8 +22,8 @@ + void sys_error(message, arg) + char *message, *arg; + { +- extern char *sys_errlist[]; +- extern int sys_nerr; ++ /* extern char *sys_errlist[]; */ ++ /* extern int sys_nerr; */ + int en; + + en = errno; diff --git a/print/lprps/files/patch-textps.c b/print/lprps/files/patch-textps.c new file mode 100644 index 000000000000..3e8cfe11dfc3 --- /dev/null +++ b/print/lprps/files/patch-textps.c @@ -0,0 +1,54 @@ +--- textps.c.orig 1993-02-22 21:46:10.000000000 +0900 ++++ textps.c 2013-04-27 23:04:41.000000000 +0900 +@@ -41,10 +41,12 @@ + #endif /* not BOLD_FONT */ + + #include <stdio.h> ++#include <stdlib.h> + #include <ctype.h> + #include <string.h> + +-extern char *malloc(); ++#include <paper.h> ++ + extern char *optarg; + extern int optind; + +@@ -86,10 +88,24 @@ + exit(1); + } + ++const struct paper *findpaper(char *name) ++{ ++ const struct paper *pp; ++ ++ paperinit(); ++ for (pp = paperfirst(); pp; pp = papernext(pp)) { ++ if (strcmp(name, papername(pp)) == 0) ++ return (pp); ++ } ++ return (NULL); ++} ++ + main(argc, argv) + int argc; + char **argv; + { ++ const struct paper *pp; ++ char *name; + int bad_files = 0; + double cpi = 12.0; /* characters per inch */ + int opt; +@@ -124,6 +140,12 @@ + abort(); + } + ++ name = (char *)systempapername(); ++ if (name == NULL) ++ name = (char *)defaultpapername(); ++ if ((pp = findpaper(name)) != NULL) ++ page_length = paperpsheight(pp); ++ + char_width = 72.0/cpi; + prologue(); + if (optind >= argc) diff --git a/print/lprps/pkg-descr b/print/lprps/pkg-descr new file mode 100644 index 000000000000..d5e72229d11a --- /dev/null +++ b/print/lprps/pkg-descr @@ -0,0 +1,21 @@ +lprps is a collection of programs for using lpr with a PostScript +printer connected by a bidirectional serial channel. + +It contains the following programs: + + lprps handles communication with the printer + psif allows separate filters to be used for text and PostScript + textps simple text to PostScript filter + psrev PostScript page reversal filter + psof banner filter + +Some features are: + + * Deals intelligently with output generated by the printer: printer + errors (such as ``out of paper'') are logged using syslog. + * Updates status file (displayed by lpq) with printer's current status. + * Performs printer accounting. + * Ensures that the printer is ready to receive the job. + * Determines whether file is PostScript or text and prints it appropriately + * Can automatically perform page reversal for the benefit of printers + that stack face-up. diff --git a/print/lprps/pkg-plist b/print/lprps/pkg-plist new file mode 100644 index 000000000000..35b900630e6e --- /dev/null +++ b/print/lprps/pkg-plist @@ -0,0 +1,10 @@ +@comment $FreeBSD$ +libexec/psif +libexec/lprps +libexec/psof +libexec/psif-text +libexec/psif-ps +%%DATADIR%%/banner.ps +bin/textps +bin/psrev +@dirrm %%DATADIR%% |