Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 May 1999 16:24:01 +0800 (CST)
From:      傑的心 妳的心 <yinjieh@Crazyman.Dorm10.NCTU.edu.tw>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/11721: new port: pdq
Message-ID:  <199905150824.QAA80950@Crazyman.Dorm10.NCTU.edu.tw>

next in thread | raw e-mail | index | archive | help

>Number:         11721
>Category:       ports
>Synopsis:       new port: pdq
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 15 01:30:01 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     傑的心  妳的心
>Release:        FreeBSD 3.1-STABLE i386
>Organization:
同一個星空下
>Environment:

FreeBSD Crazyman.Dorm10.NCTU.edu.tw 3.1-STABLE FreeBSD 3.1-STABLE #5: Mon Apr 26
 01:57:37 CST 1999     root@Crazyman.Dorm10.NCTU.edu.tw:/home2/src/sys/compile/Y
INJIEH  i386

>Description:

pdq: a straightforward, flexible print subsystem. 
It has the following features:
o Modular driver and interface support.
o Jobs can be monitored through completion.
o Job status can be checked after completion.
o Users can only print files of declared types.
o Users can define their own printers.
o Multitasking, with no queues to get clogged.
o Scripts can be embedded in the rc files.
o Custom command-line options.
o Root privileges not required.

WWW: http://feynman.tam.uiuc.edu/pdq/introduction.html

>How-To-Repeat:

	N/A

>Fix:
	
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	pdq
#	pdq/files
#	pdq/files/md5
#	pdq/Makefile
#	pdq/patches
#	pdq/patches/patch-aa
#	pdq/patches/patch-ab
#	pdq/patches/patch-ac
#	pdq/patches/patch-ad
#	pdq/patches/patch-ae
#	pdq/patches/patch-af
#	pdq/patches/patch-ag
#	pdq/patches/patch-ah
#	pdq/patches/patch-ai
#	pdq/patches/patch-aj
#	pdq/patches/patch-ak
#	pdq/pkg
#	pdq/pkg/COMMENT
#	pdq/pkg/DESCR
#	pdq/pkg/PLIST
#
echo c - pdq
mkdir -p pdq > /dev/null 2>&1
echo c - pdq/files
mkdir -p pdq/files > /dev/null 2>&1
echo x - pdq/files/md5
sed 's/^X//' >pdq/files/md5 << 'END-of-pdq/files/md5'
XMD5 (pdq-2.1.1.tgz) = bcdcb66d449ae9c5ec544227dc2a059a
END-of-pdq/files/md5
echo x - pdq/Makefile
sed 's/^X//' >pdq/Makefile << 'END-of-pdq/Makefile'
X# New ports collection makefile for:	pdq
X# Version required:	2.1.1
X# Date created:		15 May 1999
X# Whom:			Yin-Jieh Chen <yinjieh@csie.nctu.edu.tw>
X#
X# $Id$
X#
X
XDISTNAME=	pdq-2.1.1
XCATEGORIES=	print
XMASTER_SITES=	ftp://feynman.tam.uiuc.edu/pub/pdq/
XEXTRACT_SUFX=	.tgz
X
XMAINTAINER=	yinjieh@csie.nctu.edu.tw
X
XLIB_DEPENDS=	gtk12.1:${PORTSDIR}/x11-toolkits/gtk12
X
XGNU_CONFIGURE=	yes
XCONFIGURE_ENV=	GTK_CONFIG="${X11BASE}/bin/gtk12-config" \
X		GLIB_CONFIG="${LOCALBASE}/bin/glib12-config"
X
XMAN1=		lpd_cancel.1 lpd_print.1 lpd_status.1 pdq.1 xpdq.1
XMAN5=		printrc.5
X
Xpost-install:
X	${CP} ${WRKSRC}/sample_etc_printrc ${PREFIX}/etc/printrc.sample
X	strip ${PREFIX}/bin/pdq
X	strip ${PREFIX}/bin/xpdq
X	strip ${PREFIX}/bin/lpd_cancel
X	strip ${PREFIX}/bin/lpd_print
X	strip ${PREFIX}/bin/lpd_status
X	@${ECHO} '*******************************************************'
X	@${ECHO} '*                                                     *'
X	@${ECHO} '*     Please copy /usr/local/etc/printrc.sample to    *'
X	@${ECHO} '*     /usr/local/etc/printrc by yourself, thanks.     *'
X	@${ECHO} '*                                                     *'
X	@${ECHO} '*******************************************************'
X
X.include <bsd.port.mk>
END-of-pdq/Makefile
echo c - pdq/patches
mkdir -p pdq/patches > /dev/null 2>&1
echo x - pdq/patches/patch-aa
sed 's/^X//' >pdq/patches/patch-aa << 'END-of-pdq/patches/patch-aa'
X--- src/job.c.orig	Sat May 15 01:03:09 1999
X+++ src/job.c	Sat May 15 01:08:30 1999
X@@ -248,12 +248,9 @@
X    }
X    sprintf(pat, "%s/[0-9][0-9][0-9].status", sd);
X    i = glob (pat, 0, NULL, &globbuf); 
X-   if (i != 0) {
X-      if (i != GLOB_NOMATCH) {
X+   if (i != 0) return (NULL);
X          /* Unknown error (or on some systems, no match) */
X-	 return (NULL);
X-      }
X-   } else {
X+   else {
X       if (globbuf.gl_pathc == 0) {
X          /* No match */
X 	 return (NULL);
X@@ -385,14 +382,10 @@
X    i = glob (pat, 0, NULL, &globbuf); 
X    free (pat);
X    if (i != 0) {
X-      if (i != GLOB_NOMATCH) {
X          fprintf (stderr, "Unknown error globbing for job id.\n");
X 	 perror (NULL);
X          fprintf (stderr, "Failed to purge old jobs.\n");
X 	 my_exit (1);  
X-      } else {
X-         /* No match */
X-      }
X    } else {
X       if (globbuf.gl_pathc == 0) {
X          return;
X@@ -432,14 +425,10 @@
X    i = glob (pat, 0, NULL, &globbuf); 
X    free (pat);
X    if (i != 0) {
X-      if (i != GLOB_NOMATCH) {
X          fprintf (stderr, "Unknown error globbing for job id.\n");
X 	 perror (NULL);
X          fprintf (stderr, "Failed to purge old jobs.\n");
X 	 my_exit (1); 
X-      } else {
X-         /* No match */
X-      }
X    } else {
X       if (globbuf.gl_pathc == 0) {
X          return;
X@@ -495,11 +484,9 @@
X    i = glob (pat, 0, NULL, &globbuf); 
X    free (pat);
X    if (i != 0) {
X-      if (i != GLOB_NOMATCH) {
X-         fprintf (stderr, "Unknown error globbing for job id.\n");
X-	 perror (NULL);
X-	 my_exit (1);
X-      }
X+      fprintf (stderr, "Unknown error globbing for job id.\n");
X+      perror (NULL);
X+      my_exit (1);
X       claim_try = 1;
X    } else {
X       if (globbuf.gl_pathc == 0) {
END-of-pdq/patches/patch-aa
echo x - pdq/patches/patch-ab
sed 's/^X//' >pdq/patches/patch-ab << 'END-of-pdq/patches/patch-ab'
X--- src/parse_rc.c.orig	Sat May 15 01:03:20 1999
X+++ src/parse_rc.c	Sat May 15 07:06:17 1999
X@@ -23,7 +23,6 @@
X #include <glob.h>
X #include <string.h>
X #include <stdlib.h>
X-#include <values.h>
X 
X 
X #include "parse.h"
X@@ -35,6 +34,8 @@
X #include "driver.h"
X #include "interface.h"
X 
X+#define PRINTRC "/usr/local/etc/printrc"
X+
X void try_parse_rc_glob (char *rc_glob, rc_items *rc) {
X 
X    glob_t globbuf;
X@@ -46,12 +47,8 @@
X    i = glob (d, 0, NULL, &globbuf); 
X    free (d);
X    if (i != 0) {
X-      if (i == GLOB_NOMATCH) {
X-	 /* Keep on going */
X-      } else {
X-	 fprintf (stderr, "Died while globbing %s\n", d);
X-	 my_exit (1);
X-      }
X+      fprintf (stderr, "Died while globbing %s\n", d);
X+      my_exit (1);
X    } else {
X       /* Globbed something real */
X       for (i = 0; i < globbuf.gl_pathc; i++) {
X@@ -71,11 +68,7 @@
X 
X    i = glob (d, 0, NULL, &globbuf); 
X    if (i != 0) {
X-      if (i == GLOB_NOMATCH) {
X-	 fprintf (stderr, "No files match %s\n", d);
X-      } else {
X-	 fprintf (stderr, "Died while globbing %s\n", d);
X-      }
X+      fprintf (stderr, "Died while globbing %s\n", d);
X       free (d);
X       my_exit (1);
X    } else {
X@@ -258,7 +251,7 @@
X    int trouble_flag;
X 
X    rc_locs = NULL;
X-   find_rc_glob_locations (type, name, "/etc/printrc",  &rc_locs);
X+   find_rc_glob_locations (type, name, PRINTRC,  &rc_locs);
X    find_rc_glob_locations (type, name, "~/.printrc",  &rc_locs);
X 
X    set_flag = 0;
X@@ -282,7 +275,7 @@
X    }
X 
X    if (  (set_flag == 0) || (trouble_flag == 1)  ) {
X-      if (0 != append_to_rc_file ("/etc/printrc", buf) ) {
X+      if (0 != append_to_rc_file (PRINTRC, buf) ) {
X          append_to_rc_file ("~/.printrc", buf);  /* Return code not checked.
X 	                                          * What else can we do?
X 						  */
X@@ -299,7 +292,7 @@
X    int trouble_flag;
X 
X    rc_locs = NULL;
X-   find_rc_glob_locations (type, name, "/etc/printrc",  &rc_locs);
X+   find_rc_glob_locations (type, name, PRINTRC,  &rc_locs);
X    find_rc_glob_locations (type, name, "~/.printrc",  &rc_locs);
X 
X    trouble_flag = 0;
X@@ -315,11 +308,11 @@
X 
X    /* In this case, buf should have been set to some commands that
X     * indicate to delete the object.  For example, say printer foo is
X-    * defined in /etc/printrc.  Ordinary  users cannot delete it, but
X+    * defined in /usr/local/etc/printrc.  Ordinary  users cannot delete it, but
X     * they may add the command "printer foo delete" to their own rc file.
X     */
X    if (trouble_flag == 1)  {
X-      if (0 != append_to_rc_file ("/etc/printrc", buf) ) {
X+      if (0 != append_to_rc_file (PRINTRC, buf) ) {
X          append_to_rc_file ("~/.printrc", buf);  /* Return code not checked.
X 	                                          * What else can we do?
X 						  */
END-of-pdq/patches/patch-ab
echo x - pdq/patches/patch-ac
sed 's/^X//' >pdq/patches/patch-ac << 'END-of-pdq/patches/patch-ac'
X--- src/pdq_main.c.orig	Sat May 15 07:06:41 1999
X+++ src/pdq_main.c	Sat May 15 07:07:22 1999
X@@ -34,7 +34,8 @@
X #include "shepherd.h"
X #include "reaper.h"
X 
X-                 
X+#define PRINTRC "/usr/local/etc/printrc"                 
X+
X rc_items *rc;     
X job_info *job;   
X 
X@@ -61,7 +62,7 @@
X    str_reset (&job->invoke_time, ctime(&t));
X    job->invoke_time [strlen(job->invoke_time)-1] = 0; /* Strip \n */
X 
X-   try_parse_rc_glob ("/etc/printrc", rc);
X+   try_parse_rc_glob (PRINTRC, rc);
X    try_parse_rc_glob ("~/.printrc", rc);
X    pdq_process_argv (argc, argv, job, rc, &file, &nfiles);
X 
END-of-pdq/patches/patch-ac
echo x - pdq/patches/patch-ad
sed 's/^X//' >pdq/patches/patch-ad << 'END-of-pdq/patches/patch-ad'
X--- src/util.c.orig	Sat May 15 01:34:56 1999
X+++ src/util.c	Sat May 15 02:07:16 1999
X@@ -16,6 +16,7 @@
X  *
X  */
X 
X+#include <stdio.h>
X #include <unistd.h>
X #include <string.h>
X #include <pwd.h>
END-of-pdq/patches/patch-ad
echo x - pdq/patches/patch-ae
sed 's/^X//' >pdq/patches/patch-ae << 'END-of-pdq/patches/patch-ae'
X--- src/xpdq_main.c.orig	Sat May 15 07:10:19 1999
X+++ src/xpdq_main.c	Sat May 15 11:44:32 1999
X@@ -39,6 +39,8 @@
X #include "option.h"
X #include "shepherd.h"
X 
X+#define PRINTRC "/usr/local/etc/printrc"
X+
X void (*my_exit) (int code);
X 
X void xpdq_exit (int code) {
X@@ -90,7 +92,7 @@
X    rc = new_rc_items();
X    job = NULL;
X 
X-   try_parse_rc_glob ("/etc/printrc", rc);
X+   try_parse_rc_glob (PRINTRC, rc);
X    try_parse_rc_glob ("~/.printrc", rc);
X 
X    gtk_init (&argc, &argv);
END-of-pdq/patches/patch-ae
echo x - pdq/patches/patch-af
sed 's/^X//' >pdq/patches/patch-af << 'END-of-pdq/patches/patch-af'
X--- src/xpdq_printer.c.orig	Sat May 15 07:19:13 1999
X+++ src/xpdq_printer.c	Sat May 15 11:43:47 1999
X@@ -29,23 +29,30 @@
X #include "printer.h"
X #include "argument.h"
X 
X+#define PRINTRC "/usr/local/etc/printrc"
X+
X void xpdq_add_printer (void) {
X 
X    pwizard_state *wizard;
X    dl_list *list;
X+   char *error;
X 
X    list = first_list_element (rc->driver_list);
X    if (list == NULL) {
X-      xpdq_error ("There are no printer drivers defined in\n"
X-         "/etc/printrc or ~/.printrc.  Without printer drivers,\n"
X-	 "the wizard cannot add printers.");
X+      error = malloc(256);
X+      sprintf (error, "There are no printer drivers defined in\n"
X+         "%s or ~/.printrc.  Without printer drivers,\n"
X+	 "the wizard cannot add printers.", PRINTRC);
X+      xpdq_error(error);
X       return;
X    }
X    list = first_list_element (rc->interface_list);
X    if (list == NULL) {
X-      xpdq_error ("There are no printer interfaces defined in\n"
X-         "/etc/printrc or ~/.printrc.  Without printer interfaces,\n"
X-	 "the wizard cannot add printers.");
X+      error = malloc(256);
X+      sprintf (error, "There are no printer drivers defined in\n"
X+         "%s or ~/.printrc.  Without printer drivers,\n"
X+	 "the wizard cannot add printers.", PRINTRC);
X+      xpdq_error(error);
X       return;
X    }
X    wizard = new_pwizard ();
END-of-pdq/patches/patch-af
echo x - pdq/patches/patch-ag
sed 's/^X//' >pdq/patches/patch-ag << 'END-of-pdq/patches/patch-ag'
X--- src/xpdq_wizard.c.orig	Sat May 15 11:45:15 1999
X+++ src/xpdq_wizard.c	Sat May 15 11:50:44 1999
X@@ -29,6 +29,8 @@
X #include "printer.h"
X #include "argument.h"
X 
X+#define PRINTRC "/usr/local/etc/printrc"
X+
X pwizard_state *new_pwizard() {
X 
X    pwizard_state *wizard;
X@@ -315,6 +317,7 @@
X    driver *d;
X    int i, row;
X    char *dname;
X+   char *error;
X 
X    panel = gtk_vbox_new (FALSE, 0);
X    gtk_container_border_width (GTK_CONTAINER (panel), 10);
X@@ -348,9 +351,11 @@
X    gtk_clist_set_selection_mode (GTK_CLIST(widget), GTK_SELECTION_BROWSE);
X    list = first_list_element (rc->driver_list);
X    if (list == NULL) {
X-      xpdq_error ("This system has no drivers.  Please make sure\n"
X-         "that there are drivers defined in /etc/printrc, ~/.printrc,\n"
X-	 "or in files included by /etc/printrc or ~/.printrc.");
X+      error = malloc(256);
X+      sprintf(error, "This system has no drivers.  Please make sure\n"
X+         "that there are drivers defined in %s, ~/.printrc,\n"
X+	 "or in files included by %s or ~/.printrc.", PRINTRC, PRINTRC);
X+      xpdq_error(error);
X    }
X    while (list != NULL) {
X       d = (driver *) list->data;
END-of-pdq/patches/patch-ag
echo x - pdq/patches/patch-ah
sed 's/^X//' >pdq/patches/patch-ah << 'END-of-pdq/patches/patch-ah'
X--- doc/pdq.1.orig	Sat May 15 12:57:49 1999
X+++ doc/pdq.1	Sat May 15 12:58:05 1999
X@@ -60,7 +60,7 @@
X option may also be used to select
X .IR printer .
X .SH FILES
X-.I /etc/printrc
X+.I /usr/local/etc/printrc
X .RS 
X The system wide configuration file.  See 
X .BR printrc (5) 
END-of-pdq/patches/patch-ah
echo x - pdq/patches/patch-ai
sed 's/^X//' >pdq/patches/patch-ai << 'END-of-pdq/patches/patch-ai'
X--- doc/printrc.5.orig	Sat May 15 12:59:52 1999
X+++ doc/printrc.5	Sat May 15 13:00:48 1999
X@@ -5,7 +5,7 @@
X .B printrc
X .SH DESCRIPTION
X This document describes the structure of the printrc files.  The files
X-.IR /etc/printrc " and " "~/.printrc" 
X+.IR /usr/local/etc/printrc " and " "~/.printrc" 
X are parsed, if they exist, and solely determine the print resources
X available, although each printrc file may include other rc files.
X .SH LEXICAL STRUCTURE
END-of-pdq/patches/patch-ai
echo x - pdq/patches/patch-aj
sed 's/^X//' >pdq/patches/patch-aj << 'END-of-pdq/patches/patch-aj'
X--- doc/xpdq.1.orig	Sat May 15 13:01:27 1999
X+++ doc/xpdq.1	Sat May 15 13:01:42 1999
X@@ -11,7 +11,7 @@
X There are no options, other than options of the underlying X11 toolkit and
X widget set (in this case gtk).
X .SH FILES
X-.I /etc/printrc
X+.I /usr/local/etc/printrc
X .RS 
X The system wide configuration file.  See 
X .BR printrc (5) 
END-of-pdq/patches/patch-aj
echo x - pdq/patches/patch-ak
sed 's/^X//' >pdq/patches/patch-ak << 'END-of-pdq/patches/patch-ak'
X--- lpd/lpd_interface.c.orig	Sat May 15 02:26:06 1999
X+++ lpd/lpd_interface.c	Sat May 15 02:26:25 1999
X@@ -80,7 +80,7 @@
X 
X 	MESSAGE (2, connecting...);
X 
X-	if ( connect(sckt, &serv_addr, sizeof(serv_addr)) != 0 ) { 
X+	if ( connect(sckt, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) != 0 ) { 
X 	   perror ("connect");
X 	   exit (1);
X 	} 
END-of-pdq/patches/patch-ak
echo c - pdq/pkg
mkdir -p pdq/pkg > /dev/null 2>&1
echo x - pdq/pkg/COMMENT
sed 's/^X//' >pdq/pkg/COMMENT << 'END-of-pdq/pkg/COMMENT'
XA straightforward, flexible print subsystem.
END-of-pdq/pkg/COMMENT
echo x - pdq/pkg/DESCR
sed 's/^X//' >pdq/pkg/DESCR << 'END-of-pdq/pkg/DESCR'
Xpdq is a straightforward, flexible print subsystem.
XIt has the following features:
Xo Modular driver and interface support.
Xo Jobs can be monitored through completion.
Xo Job status can be checked after completion.
Xo Users can only print files of declared types.
Xo Users can define their own printers.
Xo Multitasking, with no queues to get clogged.
Xo Scripts can be embedded in the rc files.
Xo Custom command-line options.
Xo Root privileges not required.
X
XWWW: http://feynman.tam.uiuc.edu/pdq/introduction.html
X
X- Yin-Jieh Chen
Xyinjieh@csie.nctu.edu.tw
END-of-pdq/pkg/DESCR
echo x - pdq/pkg/PLIST
sed 's/^X//' >pdq/pkg/PLIST << 'END-of-pdq/pkg/PLIST'
Xbin/pdq
Xbin/xpdq
Xbin/lpd_cancel
Xbin/lpd_print
Xbin/lpd_status
Xetc/printrc.sample
END-of-pdq/pkg/PLIST
exit


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199905150824.QAA80950>