[packages/ink] - updated to 0.5.3 - upstream dropped parallel port support; extracted it from 0.5.2 as parport patc

qboosh qboosh at pld-linux.org
Fri Aug 31 22:34:16 CEST 2018


commit a635075df008d30cf83ce8a34ae6ef8867440527
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Aug 31 22:37:03 2018 +0200

    - updated to 0.5.3
    - upstream dropped parallel port support; extracted it from 0.5.2 as parport patch

 ink-parport.patch | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ink.spec          |  15 ++++++--
 2 files changed, 121 insertions(+), 3 deletions(-)
---
diff --git a/ink.spec b/ink.spec
index 366a3a3..1ab0583 100644
--- a/ink.spec
+++ b/ink.spec
@@ -1,14 +1,20 @@
+#
+# Conditional build:
+%bcond_without	parport	# parallel port (IEEE 1284) support
+
 Summary:	Tool for checking ink level of a printer
 Summary(pl.UTF-8):	Narzędzie sprawdzające poziom atramentu w drukarce
 Name:		ink
-Version:	0.5.2
+Version:	0.5.3
 Release:	1
 License:	GPL v2
 Group:		Applications/Printing
 Source0:	http://downloads.sourceforge.net/ink/%{name}-%{version}.tar.gz
-# Source0-md5:	9dac3e63797d8b0e53fb57b31e648ae8
+# Source0-md5:	7ddb245c1b0314a4348f2a43e8d37885
+Patch0:		%{name}-parport.patch
 URL:		http://ink.sourceforge.net/
-BuildRequires:	libinklevel-devel >= 0.7.0
+BuildRequires:	libinklevel-devel >= 0.9.3
+Requires:	libinklevel >= 0.9.3
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -20,6 +26,9 @@ atramentu w drukarce.
 
 %prep
 %setup -q
+%if %{with parport}
+%patch0 -p1
+%endif
 
 %build
 %configure
diff --git a/ink-parport.patch b/ink-parport.patch
new file mode 100644
index 0000000..250053e
--- /dev/null
+++ b/ink-parport.patch
@@ -0,0 +1,109 @@
+diff -Nur ink-0.5.3.orig/ink.1.in ink-0.5.3/ink.1.in
+--- ink-0.5.3.orig/ink.1.in	2018-07-11 21:48:26.000000000 +0200
++++ ink-0.5.3/ink.1.in	2018-08-31 22:28:55.221785474 +0200
+@@ -5,7 +5,7 @@
+ .SH SYNOPSIS
+ .B
+ ink 
+-\-p usb [\-n <portnumber>] [\-t <threshold>]
++\-p usb|parport [\-n <portnumber>] [\-t <threshold>]
+ .PP
+ .B
+ ink
+@@ -17,16 +17,16 @@
+ .SH DESCRIPTION
+ ink is a command line tool for checking the ink level of your printers. 
+ .PP
+-Printers connected via USB port are supported. Canon BJNP network printers are supported too.
++Printers connected via parallel port and USB port are supported. Canon BJNP network printers are supported too.
+ .PP
+ ink makes use of libinklevel.
+ .SH OPTIONS 
+ .TP
+-.B -p usb
+-Probe USB port.
++.B -p usb|parport
++Probe USB or parallel port.
+ .TP
+ .B -n <portnumber>
+-Number of the USB printer (starting from zero)
++Number of the USB printer (starting from zero) or port to probe (/dev/parportX).
+ .TP
+ .B -t <threshold> 
+ Only display ink levels less than or equal to threshold.
+@@ -38,6 +38,13 @@
+ Probe the Canon BJNP printer at the specified location.
+ .SH FILES
+ .TP
++.B /dev/parportX and /dev/lpX
++Devices used to read ink level on linux systems with parallel port printers.
++Ink NEEDS read and write access to these devices.
++.TP
++.B /dev/lptX
++Devices used to read ink level on FreeBSD systems with parallel port printers.
++Ink NEEDS read and write access to these devices.
+ .SH AUTHOR
+ This manual page was originally written by Adam Cecile <gandalf at le-vert.net> for the Debian system (but may be used by others). It has been updated by Markus Heinz <markus.heinz at uni-dortmund.de> to reflect new features of recent ink versions.
+ Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or any later version published by the Free Software Foundation.
+diff -Nur ink-0.5.3.orig/ink.c ink-0.5.3/ink.c
+--- ink-0.5.3.orig/ink.c	2018-07-11 21:50:14.000000000 +0200
++++ ink-0.5.3/ink.c	2018-08-31 22:32:37.548449748 +0200
+@@ -18,9 +18,11 @@
+ void print_version_information(void);
+ 
+ void usage(void) {
+-  printf("ink -p \"usb\" [-n <portnumber>] [-t <threshold>]\n");
++  printf("ink -p \"usb\"|\"parport\" [-n <portnumber>] [-t <threshold>]\n");
+   printf("ink -p \"bjnp\" | -b \"bjnp://<printer.my.domain>\" | -v\n\n");
+ 
++  printf("'ink -p parport' Query first parallel port printer\n");
++  printf("'ink -p parport -n 1' Query second parallel port printer\n");
+   printf("'ink -p usb' Query first usb port printer\n");
+   printf("'ink -p usb -n 1' Query second usb port printer\n");
+   printf("'ink -p bjnp' Query first bjnp network printer\n");
+@@ -98,6 +100,9 @@
+     switch (c) {
+ 
+     case 'p':
++      if (strcmp(optarg, "parport") == 0) {
++	port = PARPORT;
++      } else
+       if (strcmp(optarg, "usb") == 0) {
+         port = USB;
+       } else if (strcmp(optarg, "bjnp") == 0) {
+@@ -164,10 +169,35 @@
+       printf("An unknown error occured.\n");
+       break;
+ 
++    case DEV_PARPORT_INACCESSIBLE:
++      printf("Could not access '/dev/parport%d'.\n", portnumber);
++      break;
++
++    case DEV_LP_INACCESSIBLE:
++
++#if (HOST_OS == LINUX)
++
++      printf("Could not access '/dev/lp%d'.\n", portnumber);
++
++#elif (HOST_OS == FREEBSD)
++
++      printf("Could not access '/dev/lpt%d'.\n", portnumber);
++
++#endif
++
++      break;
++
+     case COULD_NOT_GET_DEVICE_ID:
+       printf("Could not get device id.\n");
+       break;
+ 
++    case DEV_USB_LP_INACCESSIBLE:
++
++      printf("Could not access '/dev/usb/lp%d' or '/dev/usblp%d'.\n", 
++             portnumber, portnumber);
++
++      break;
++
+     case UNKNOWN_PORT_SPECIFIED:
+       printf("Unknown port specified.\n");
+       break;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ink.git/commitdiff/a635075df008d30cf83ce8a34ae6ef8867440527



More information about the pld-cvs-commit mailing list