debian/0000755000000000000000000000000011661166355007200 5ustar debian/watch0000644000000000000000000000006511146307010010211 0ustar version=3 http://sf.net/p910nd/p910nd-(.+)\.tar\.bz2 debian/p910nd.init0000644000000000000000000000666211526500114011073 0ustar #! /bin/sh ### BEGIN INIT INFO # Provides: p910nd # Required-Start: $remote_fs $syslog $network # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: p910nd daemon providing network printer access # Description: Start p910nd to provide port 9100+n printer service ### END INIT INFO # Author: Mario Izquierdo (mariodebian) # # Do NOT "set -e" # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="network print daemon" NAME=p910nd DAEMON=/usr/sbin/$NAME PIDFILE=/var/run/p9100d.pid SCRIPTNAME=/etc/init.d/$NAME # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 # create /var/run and /var/lock/p910nd (Debian policy 3.8.1) [ ! -d /var/run ] && mkdir -p /var/run [ ! -d /var/lock/p910nd ] && mkdir -p /var/lock/p910nd P910ND_OPTS="" P910ND_NUM="" # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME DAEMON_ARGS=" $P910ND_OPTS $P910ND_NUM" # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh # Define LSB log_* functions. # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. . /lib/lsb/init-functions # # Function that starts the daemon/service # do_start() { # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ || return 1 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ $DAEMON_ARGS \ || return 2 } # # Function that stops the daemon/service # do_stop() { # Return # 0 if daemon has been stopped # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 # Wait for children to finish too if this is a daemon that forks # and if the daemon is only ever run from this initscript. # If the above conditions are not satisfied then add some other code # that waits for the process to drop all resources that could be # needed by services started subsequently. A last resort is to # sleep for some time. start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON [ "$?" = 2 ] && return 2 # Many daemons don't delete their pidfiles when they exit. rm -f $PIDFILE return "$RETVAL" } case "$1" in start) # disable start if [ "$P910ND_START" != "1" ]; then log_warning_msg "Not starting p910nd daemon. Please edit /etc/default/p910nd first." exit 0 fi log_daemon_msg "Starting $DESC" "$NAME" do_start case "$?" in 0|1) log_end_msg 0 ;; 2) log_end_msg 1 ;; esac ;; stop) log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in 0|1) log_end_msg 0 ;; 2) log_end_msg 1 ;; esac ;; restart|force-reload) # # If the "reload" option is implemented then remove the # 'force-reload' alias # log_daemon_msg "Restarting $DESC" "$NAME" do_stop case "$?" in 0|1) do_start case "$?" in 0) log_end_msg 0 ;; 1) log_end_msg 1 ;; # Old process is still running *) log_end_msg 1 ;; # Failed to start esac ;; *) # Failed to stop log_end_msg 1 ;; esac ;; *) echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 exit 3 ;; esac : debian/copyright0000644000000000000000000000237511146307010011121 0ustar This package was debianized by Mario Izquierdo (mariodebian) on Sun, 08 Feb 2009 17:43:54 +0100. It was downloaded from http://p910nd.sourceforge.net/ Upstream Author: Ken Yap Copyright: 2001 - 2009 Ken Yap This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 dated June, 1991. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License with the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL-2; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. On Debian GNU/Linux systems, the complete text of the GNU General Public License, version 2, can be found in /usr/share/common-licenses/GPL-2. The Debian packaging is copyright 2009, Mario Izquierdo (mariodebian) and is licensed under the same license. debian/dirs0000644000000000000000000000001111163660463010050 0ustar usr/sbin debian/patches/0000755000000000000000000000000011660306556010625 5ustar debian/patches/20-use-debian.init-script.patch0000644000000000000000000000070211526466742016351 0ustar Description: Use debian/p910nd.init script instead of upstream one Index: p910nd/Makefile =================================================================== --- p910nd.orig/Makefile 2011-02-15 13:10:57.615777564 +0100 +++ p910nd/Makefile 2011-02-15 13:12:27.415759053 +0100 @@ -18,7 +18,7 @@ PROG = p910nd CONFIG = p910nd.conf -INITSCRIPT = p910nd.init +INITSCRIPT = debian/p910nd.init MANPAGE = p910nd.8 INSTALL = install BINDIR = /usr/sbin debian/patches/30-disable-start-by-default.patch0000644000000000000000000000066111526467044016662 0ustar Description: Don't start daemon by default Index: p910nd/p910nd.conf =================================================================== --- p910nd.orig/p910nd.conf 2011-02-15 13:09:31.050744374 +0100 +++ p910nd/p910nd.conf 2011-02-15 13:13:25.179740514 +0100 @@ -2,3 +2,7 @@ P910ND_NUM="" # Additional daemon arguments, see man 8 p910nd P910ND_OPTS="" + + +# Debian specific (set to 1 to enable start by default) +P910ND_START=0 debian/patches/40-fix-port-number-bigger-than-9.patch0000644000000000000000000000116111526467153017461 0ustar Description: Exit daemon if port number is bigger than 9, two digits breaks LOCKFILE Index: p910nd/p910nd.c =================================================================== --- p910nd.orig/p910nd.c 2011-02-15 13:09:31.002744695 +0100 +++ p910nd/p910nd.c 2011-02-15 13:14:31.474773119 +0100 @@ -652,6 +652,12 @@ argc -= optind; argv += optind; if (argc > 0) { + /* exit if port number is bigger than 9 */ + /*(2 digits breaks some things, ex LOCKFILE) */ + if ( strlen(argv[0]) > 1) { + fprintf(stderr, "Error, port number > 9\n"); + return(-1); + } if (isdigit(argv[0][0])) lpnumber = argv[0][0]; } debian/patches/50-use-var-lock-p910nd-instead-off-var-lock-subsys.patch0000644000000000000000000000202311660306641022640 0ustar Description: Use /var/lock/p910nd instead of /var/lock/subsys Index: p910nd/p910nd.8 =================================================================== --- p910nd.orig/p910nd.8 2011-11-14 22:41:41.904615879 +0100 +++ p910nd/p910nd.8 2011-11-14 22:49:52.299047607 +0100 @@ -83,7 +83,7 @@ .SH "SEE ALSO" printcap(5), hosts_access(5) .SH FILES -/var/run/p9100d.pid, /var/lock/subsys/p9100d, /etc/hosts.allow, /etc/hosts.deny +/var/run/p9100d.pid, /var/lock/p910nd/p9100d, /etc/hosts.allow, /etc/hosts.deny .SH COPYRIGHT .I p910nd is under the GNU Public License Version 2 Index: p910nd/p910nd.c =================================================================== --- p910nd.orig/p910nd.c 2011-11-14 22:47:41.986401420 +0100 +++ p910nd/p910nd.c 2011-11-14 22:49:27.274923524 +0100 @@ -122,7 +122,7 @@ #ifdef LOCKFILE_DIR #define LOCKFILE LOCKFILE_DIR "/p910%cd" #else -#define LOCKFILE "/var/lock/subsys/p910%cd" +#define LOCKFILE "/var/lock/p910nd/p910%cd" #endif #ifndef PRINTERFILE #define PRINTERFILE "/dev/lp%c" debian/patches/series0000644000000000000000000000031111660306502012024 0ustar 10-replace-sysconfig-etc_default.patch 20-use-debian.init-script.patch 30-disable-start-by-default.patch 40-fix-port-number-bigger-than-9.patch 50-use-var-lock-p910nd-instead-off-var-lock-subsys.patch debian/patches/10-replace-sysconfig-etc_default.patch0000644000000000000000000000072111526466646017766 0ustar Description: Use /etc/default instead of /etc/sysconfig as CONFIGDIR Index: p910nd/Makefile =================================================================== --- p910nd.orig/Makefile 2011-02-15 13:09:31.178741585 +0100 +++ p910nd/Makefile 2011-02-15 13:10:57.615777564 +0100 @@ -22,7 +22,7 @@ MANPAGE = p910nd.8 INSTALL = install BINDIR = /usr/sbin -CONFIGDIR = /etc/sysconfig +CONFIGDIR = /etc/default SCRIPTDIR = /etc/init.d MANDIR = /usr/share/man/man8 debian/README.Debian0000644000000000000000000000200111526500207011216 0ustar p910nd for Debian ----------------- p910nd is not started by default. You need to edit /etc/default/p910nd and change some options: * P910ND_OPTS: Use this variable to set p910nd options. See man p910nd(8) for all options * P910ND_NUM: Printer number ( use port: 9100 + P910ND_NUM ) * P910ND_START: In Debian this variable enable or disable p910nd start. p910nd exposes TCP ports and admin is responsible for securing it. Set to "1" to enable p910nd. Example: Start p910nd in 9100 port with /dev/usb/lp1 USB printer. P910ND_OPTS=" -f /dev/usb/lp1" P910ND_NUM="0" P910ND_START="1" In Debian p910nd is compiled with USE_LIBWRAP. Access control can be done with /etc/hosts.allow and /etc/hosts.deny. The service name is p910nd. Example (only allow local network): /etc/hosts.allow p910nd: 192.168.0. /etc/hosts.deny p910nd: ALL -- Mario Izquierdo (mariodebian) Tue, 15 Feb 2011 14:22:38 +0100 debian/docs0000644000000000000000000000001211526466217010044 0ustar changelog debian/rules0000755000000000000000000000067111660311312010244 0ustar #!/usr/bin/make -f # -*- makefile -*- #export DH_VERBOSE=1 override_dh_auto_clean: rm -f changelog dh_auto_clean override_dh_auto_build: $(MAKE) USE_WRAP=1 LOCKFILE_DIR=\"/var/lock/p910nd\" # upstream don't provide changelog file, generate from p910nd.c header head -93 p910nd.c | tail -75 | sed -e 's/ \*//g' > changelog override_dh_installinit: dh_installinit --update-rcd-params='start 20 2 3 4 5 . stop 20 0 1 6 .' %: dh $@ debian/compat0000644000000000000000000000000211146307010010355 0ustar 7 debian/changelog0000644000000000000000000000356311660310355011047 0ustar p910nd (0.95-1) unstable; urgency=low * New upstream version * Standards-Version bumped to 3.9.2 (no changes needed) * Remove patch 60-fix-sin-addr-sockaddr.patch (upstream applied) * Add 50-use-var-lock-p910nd-instead-off-var-lock-subsys.patch: - Use /var/lock/p910nd instead of /var/lock/subsys (Closes: #634225) (LP: #884658) (LP: #548739) -- Mario Izquierdo (mariodebian) Mon, 14 Nov 2011 23:04:00 +0100 p910nd (0.94-1) unstable; urgency=low * New upstream version * Switch from cdbs + dpatch to dh7 + quilt * New patch 60-fix-sin-addr-sockaddr.patch: - Use get_ip_str instead of inet_ntoa (struct sockaddr_storage don't have sin_addr or sin_port) * Generate upstream changelog from p910nd.c headers * Remove 50-change-lock-dir: - Use Makefile LOCKFILE_DIR instead * Add README.Debian (Closes: #607852) -- Mario Izquierdo (mariodebian) Tue, 15 Feb 2011 14:37:28 +0100 p910nd (0.93-3) unstable; urgency=low * Add debian/README.source (Debian Policy manual, section 4.14) * Standards-Version bumped to 3.9.1 (no changes needed) -- Mario Izquierdo (mariodebian) Tue, 28 Sep 2010 15:34:43 +0200 p910nd (0.93-2) unstable; urgency=low * Fix debian/p910nd.init: - Rename PIDFILE p910nd => p9100d - Set verbose by default * Standards-Version bumped to 3.8.2: debian/p910nd.init fixed, /var/run and /var/lock/p190nd created on init.d script, since these 2 dirs could be mounted as a temporary filesystem. * debian/p910nd.init: - Fix LSB start/stop and depends headers (Closes: #541250) -- Mario Izquierdo (mariodebian) Wed, 12 Aug 2009 20:46:09 +0200 p910nd (0.93-1) unstable; urgency=low * Initial version (Closes: #514615) -- Mario Izquierdo (mariodebian) Sun, 22 Feb 2009 15:36:51 +0100 debian/control0000644000000000000000000000153611660310076010576 0ustar Source: p910nd Section: net Priority: extra Maintainer: Mario Izquierdo (mariodebian) Build-Depends: debhelper (>= 7.0.50~), libwrap0-dev Standards-Version: 3.9.2 Homepage: http://p910nd.sourceforge.net/ Vcs-Git: http://tcosproject.org/git/p910nd.git Vcs-Browser: http://tcosproject.org/cgit/p910nd.git Package: p910nd Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: small printer daemon intended for diskless workstations p910nd is a small daemon that copies any data received on the port it is listening on to the corresponding printer port. . It is primarily intended for diskless Linux hosts running as printer drivers but there is no reason why it could not be used on diskful hosts. . Port 9100 is copied to /dev/lp0, 9101 to /dev/lp1 and 9102 to /dev/lp2. The default is port 9100 to /dev/lp0. debian/source/0000755000000000000000000000000011526462635010500 5ustar debian/source/format0000644000000000000000000000001411526462635011706 0ustar 3.0 (quilt) debian/examples0000644000000000000000000000002411146307010010714 0ustar banner.pl client.pl