[26086] in Source-Commits

home help back first fref pref prev next nref lref last post

/svn/athena r25383 - in trunk/debathena/debathena: . pharos-support pharos-support/debian

daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Wed Aug 17 13:57:38 2011

Date: Wed, 17 Aug 2011 13:57:32 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201108171757.p7HHvWB4010891@drugstore.mit.edu>
To: source-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: jdreed
Date: 2011-08-17 13:57:31 -0400 (Wed, 17 Aug 2011)
New Revision: 25383

Added:
   trunk/debathena/debathena/pharos-support/
   trunk/debathena/debathena/pharos-support/debian/
   trunk/debathena/debathena/pharos-support/debian/changelog
   trunk/debathena/debathena/pharos-support/debian/compat
   trunk/debathena/debathena/pharos-support/debian/control.in
   trunk/debathena/debathena/pharos-support/debian/copyright
   trunk/debathena/debathena/pharos-support/debian/install
   trunk/debathena/debathena/pharos-support/debian/rules
   trunk/debathena/debathena/pharos-support/pharos
   trunk/debathena/debathena/pharos-support/pharos.8
Log:
In pharos-support:
  * First version


Added: trunk/debathena/debathena/pharos-support/debian/changelog
===================================================================
--- trunk/debathena/debathena/pharos-support/debian/changelog	                        (rev 0)
+++ trunk/debathena/debathena/pharos-support/debian/changelog	2011-08-17 17:57:31 UTC (rev 25383)
@@ -0,0 +1,7 @@
+debathena-pharos-support (1.0) unstable; urgency=low
+
+  * First version
+
+ -- Jonathan Reed <jdreed@mit.edu>  Wed, 17 Aug 2011 10:44:02 -0400
+
+

Added: trunk/debathena/debathena/pharos-support/debian/compat
===================================================================
--- trunk/debathena/debathena/pharos-support/debian/compat	                        (rev 0)
+++ trunk/debathena/debathena/pharos-support/debian/compat	2011-08-17 17:57:31 UTC (rev 25383)
@@ -0,0 +1 @@
+6

Added: trunk/debathena/debathena/pharos-support/debian/control.in
===================================================================
--- trunk/debathena/debathena/pharos-support/debian/control.in	                        (rev 0)
+++ trunk/debathena/debathena/pharos-support/debian/control.in	2011-08-17 17:57:31 UTC (rev 25383)
@@ -0,0 +1,15 @@
+Source: debathena-pharos-support
+Section: debathena/base
+Priority: extra
+Standards-Version: 3.9.1
+Maintainer: Debathena Project <debathena@mit.edu>
+Build-Depends: @cdbs@
+
+Package: debathena-pharos-support
+Architecture: all
+Depends: cups | cupsys,
+ hpijs,
+ ${misc:Depends}
+Description: Pharos Support for Debathena
+ This package adds a new CUPS backend for Pharos queues to allow users
+ to specify an alternate username

Added: trunk/debathena/debathena/pharos-support/debian/copyright
===================================================================
--- trunk/debathena/debathena/pharos-support/debian/copyright	                        (rev 0)
+++ trunk/debathena/debathena/pharos-support/debian/copyright	2011-08-17 17:57:31 UTC (rev 25383)
@@ -0,0 +1,21 @@
+  Copyright © 2011 Massachusetts Institute of Technology
+
+  Permission is hereby granted, free of charge, to any person
+  obtaining a copy of this software and associated documentation files
+  (the "Software"), to deal in the Software without restriction,
+  including without limitation the rights to use, copy, modify, merge,
+  publish, distribute, sublicense, and/or sell copies of the Software,
+  and to permit persons to whom the Software is furnished to do so,
+  subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be
+  included in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+  ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+  SOFTWARE.

Added: trunk/debathena/debathena/pharos-support/debian/install
===================================================================
--- trunk/debathena/debathena/pharos-support/debian/install	                        (rev 0)
+++ trunk/debathena/debathena/pharos-support/debian/install	2011-08-17 17:57:31 UTC (rev 25383)
@@ -0,0 +1,2 @@
+pharos usr/lib/cups/backend
+pharos.8 usr/share/man/man8

Added: trunk/debathena/debathena/pharos-support/debian/rules
===================================================================
--- trunk/debathena/debathena/pharos-support/debian/rules	                        (rev 0)
+++ trunk/debathena/debathena/pharos-support/debian/rules	2011-08-17 17:57:31 UTC (rev 25383)
@@ -0,0 +1,12 @@
+#!/usr/bin/make -f
+
+DEB_DH_FIXPERMS_ARGS = -X/usr/lib/cups/backend/pharos
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+
+# CUPS decides whether to execute a backend as root or lp based on whether
+# it's executable as lp or not.  We need to be executed as root in order
+# to exec the lpd backend.  "Yay".
+binary-install/debathena-pharos-support::
+	chmod 744 debian/debathena-pharos-support/usr/lib/cups/backend/pharos
+


Property changes on: trunk/debathena/debathena/pharos-support/debian/rules
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/debathena/debathena/pharos-support/pharos
===================================================================
--- trunk/debathena/debathena/pharos-support/pharos	                        (rev 0)
+++ trunk/debathena/debathena/pharos-support/pharos	2011-08-17 17:57:31 UTC (rev 25383)
@@ -0,0 +1,51 @@
+#!/bin/sh
+#
+# Usage: $0 [job_id] [username] [title] [copies] [options] [filename]
+#
+# Exit codes: 0 - Success
+#             1 - Failed
+#             2 - Auth required
+#             3 - Hold (try again later)
+#             4 - Stop (don't retry)
+#             5 - Cancel (cancel job and remove from queue
+
+discovery() {
+    printf "%s %s \"%s\" \"%s\"\n" network pharos Unknown "MIT Pharos Printer"
+}
+
+usage() {
+    echo "$0 job-id username title copies options [filename]"
+}
+
+case $# in
+    0)
+	discovery && exit 0
+	;;
+    5|6)
+	;;
+    *)
+	usage && exit 1
+	;;
+esac
+
+# I wonder if this works for Jerry Saltzer?
+DEVICE_URI="$(echo $DEVICE_URI | tr 'A-Z' 'a-z' | sed -e 's|^pharos://||')"
+PHAROS_QUEUE="$(echo $DEVICE_URI | awk -F/ '{print $1}')"
+case "$PHAROS_QUEUE" in
+    bw|color)
+	;;
+    *)
+	# Unknown Printer
+	exit 4         #CUPS_BACKEND_STOP
+	;;
+esac
+USERNAME="$(echo $DEVICE_URI | awk -F/ '{print $2}')"
+# Should we test for [A-Za-z] instead?
+if [ -z "$USERNAME" ]; then
+    USERNAME="$2"
+fi
+JOBID="$1"
+shift 2
+export DEVICE_URI="lpd://mitprint.mit.edu/${PHAROS_QUEUE}"
+exec /usr/lib/cups/backend/lpd "$JOBID" "$USERNAME" "$@"
+


Property changes on: trunk/debathena/debathena/pharos-support/pharos
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/debathena/debathena/pharos-support/pharos.8
===================================================================
--- trunk/debathena/debathena/pharos-support/pharos.8	                        (rev 0)
+++ trunk/debathena/debathena/pharos-support/pharos.8	2011-08-17 17:57:31 UTC (rev 25383)
@@ -0,0 +1,27 @@
+.TH pharos 8 "August 2011" Debathena debathena-pharos-support
+.SH NAME
+pharos \- CUPS backend for Pharos queues
+.SH SYNOPSIS
+(This command should never be invoked manually)
+.SH DESCRIPTION
+The
+.B pharos
+backend takes URIs of the form
+.I pharos://queue/user
+where 
+.I queue
+is one of the supported MIT Pharos queues ('bw' or 'color') and
+.I user
+is a Kerberos username.  This backend is only intended for use when
+the local username does not match the user's Kerberos username.  
+
+The backend does some argument parsing and invokes the built-in CUPS 
+.B lpd
+backend.
+.SH BUGS
+Probably.
+.SH AUTHOR
+Debathena Project
+.SH "SEE ALSO"
+The CUPS documentation for the lpd backend, if it existed in man page
+format and was accurate, but it doesn't and isn't.


home help back first fref pref prev next nref lref last post