import pnm2ppa-1.04-40.el8
This commit is contained in:
commit
0d5ed03006
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
SOURCES/pnm2ppa-1.04.tar.gz
|
||||
SOURCES/ppa-0.8.6.tar.gz
|
2
.pnm2ppa.metadata
Normal file
2
.pnm2ppa.metadata
Normal file
@ -0,0 +1,2 @@
|
||||
a3cd26788779bc80fa6c8265f3b2aacaaa5acd92 SOURCES/pnm2ppa-1.04.tar.gz
|
||||
97eedbb777940cd7fa9b2efa181c70f7146325af SOURCES/ppa-0.8.6.tar.gz
|
894
SOURCES/pbm2ppa-20000205.diff
Normal file
894
SOURCES/pbm2ppa-20000205.diff
Normal file
@ -0,0 +1,894 @@
|
||||
diff -up pbm2ppa-0.8.6/CALIBRATION.20000205 pbm2ppa-0.8.6/CALIBRATION
|
||||
--- pbm2ppa-0.8.6/CALIBRATION.20000205 1998-08-22 14:44:07.000000000 +0100
|
||||
+++ pbm2ppa-0.8.6/CALIBRATION 2008-09-24 15:15:53.000000000 +0100
|
||||
@@ -10,9 +10,22 @@ during this procedure (like 600)]
|
||||
The 'pbmtpg' program generates a full-page (8.5"x11") test pattern in
|
||||
pbmraw (P4) format on stdout. The output may be fed directly into pbm2ppa
|
||||
in order to print a calibration pattern on your printer with commands such as:
|
||||
+Assuming you printer is on /dev/lp0
|
||||
|
||||
- pbmtpg | pbm2ppa > /dev/lp1
|
||||
+ pbmtpg | pbm2ppa > /dev/lp0
|
||||
( as root )
|
||||
+(Note: /dev/lp0 is the default device for the primary parallel port on systems
|
||||
+with 2.2.x or later Linux kernels; it is /dev/lp1 on systems with
|
||||
+older Linux 2.0.x kernels)
|
||||
+
|
||||
+For other papersizes, the command must specify a valid size, for both
|
||||
+pbmtpg and pbm2ppa:
|
||||
+
|
||||
+ pbmtpg -a4 | pbm2ppa -s a4 > /dev/lp0
|
||||
+ pbmtpg -legal | pbm2ppa -s legal > /dev/lp0
|
||||
+ pbmtpg -letter | pbm2ppa -s letter > /dev/lp0
|
||||
+
|
||||
+For A4, US Legal of US Letter (default).
|
||||
|
||||
- or -
|
||||
|
||||
@@ -33,3 +46,7 @@ paper. Also, the margins should be able
|
||||
causing the printer to choke with 'blinking lights syndrome'.
|
||||
|
||||
[TODO: Add shearing adjustments to pbm2ppa and explain here]
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
diff -up pbm2ppa-0.8.6/defaults.1000.h.20000205 pbm2ppa-0.8.6/defaults.1000.h
|
||||
--- pbm2ppa-0.8.6/defaults.1000.h.20000205 1998-08-22 14:44:12.000000000 +0100
|
||||
+++ pbm2ppa-0.8.6/defaults.1000.h 2008-09-24 15:17:47.000000000 +0100
|
||||
@@ -1,19 +0,0 @@
|
||||
-/* defaults.h
|
||||
- * Default printer values. Edit these and recompile if so desired.
|
||||
- * [Note: a /etc/pbm2ppa.conf file will override these]
|
||||
- */
|
||||
-#ifndef _DEFAULTS_H
|
||||
-#define _DEFAULTS_H
|
||||
-
|
||||
-#define DEFAULT_PRINTER ( HP1000 )
|
||||
-
|
||||
-/* Refer to CALIBRATION file about these settings */
|
||||
-#define DEFAULT_X_OFFSET ( 100 )
|
||||
-#define DEFAULT_Y_OFFSET ( -650 )
|
||||
-
|
||||
-#define DEFAULT_TOP_MARGIN ( 150 )
|
||||
-#define DEFAULT_LEFT_MARGIN ( 150 )
|
||||
-#define DEFAULT_RIGHT_MARGIN ( 150 )
|
||||
-#define DEFAULT_BOTTOM_MARGIN ( 150 )
|
||||
-
|
||||
-#endif
|
||||
diff -up pbm2ppa-0.8.6/defaults.720.h.20000205 pbm2ppa-0.8.6/defaults.720.h
|
||||
--- pbm2ppa-0.8.6/defaults.720.h.20000205 1998-08-22 14:44:12.000000000 +0100
|
||||
+++ pbm2ppa-0.8.6/defaults.720.h 2008-09-24 15:17:47.000000000 +0100
|
||||
@@ -1,19 +0,0 @@
|
||||
-/* defaults.h
|
||||
- * Default printer values. Edit these and recompile if so desired.
|
||||
- * [Note: a /etc/pbm2ppa.conf file will override these]
|
||||
- */
|
||||
-#ifndef _DEFAULTS_H
|
||||
-#define _DEFAULTS_H
|
||||
-
|
||||
-#define DEFAULT_PRINTER ( HP720 )
|
||||
-
|
||||
-/* Refer to CALIBRATION file about these settings */
|
||||
-#define DEFAULT_X_OFFSET ( 169 )
|
||||
-#define DEFAULT_Y_OFFSET ( -569 )
|
||||
-
|
||||
-#define DEFAULT_TOP_MARGIN ( 150 )
|
||||
-#define DEFAULT_LEFT_MARGIN ( 150 )
|
||||
-#define DEFAULT_RIGHT_MARGIN ( 150 )
|
||||
-#define DEFAULT_BOTTOM_MARGIN ( 150 )
|
||||
-
|
||||
-#endif
|
||||
diff -up pbm2ppa-0.8.6/defaults.820.h.20000205 pbm2ppa-0.8.6/defaults.820.h
|
||||
--- pbm2ppa-0.8.6/defaults.820.h.20000205 1998-08-22 14:44:12.000000000 +0100
|
||||
+++ pbm2ppa-0.8.6/defaults.820.h 2008-09-24 15:17:47.000000000 +0100
|
||||
@@ -1,19 +0,0 @@
|
||||
-/* defaults.h
|
||||
- * Default printer values. Edit these and recompile if so desired.
|
||||
- * [Note: a /etc/pbm2ppa.conf file will override these]
|
||||
- */
|
||||
-#ifndef _DEFAULTS_H
|
||||
-#define _DEFAULTS_H
|
||||
-
|
||||
-#define DEFAULT_PRINTER ( HP820 )
|
||||
-
|
||||
-/* Refer to CALIBRATION file about these settings */
|
||||
-#define DEFAULT_X_OFFSET ( 75 )
|
||||
-#define DEFAULT_Y_OFFSET ( -500 )
|
||||
-
|
||||
-#define DEFAULT_TOP_MARGIN ( 80 )
|
||||
-#define DEFAULT_LEFT_MARGIN ( 80 )
|
||||
-#define DEFAULT_RIGHT_MARGIN ( 80 )
|
||||
-#define DEFAULT_BOTTOM_MARGIN ( 150 )
|
||||
-
|
||||
-#endif
|
||||
diff -up /dev/null pbm2ppa-0.8.6/defaults.h
|
||||
--- /dev/null 2008-09-24 08:53:03.196006296 +0100
|
||||
+++ pbm2ppa-0.8.6/defaults.h 2008-09-24 15:15:53.000000000 +0100
|
||||
@@ -0,0 +1,53 @@
|
||||
+/* defaults.h
|
||||
+ * Default printer values. Edit these and recompile if so desired.
|
||||
+ * [Note: a /etc/pbm2ppa.conf file will override these]
|
||||
+ */
|
||||
+
|
||||
+#ifndef _DEFAULTS_H
|
||||
+#define _DEFAULTS_H
|
||||
+
|
||||
+#ifndef DEFAULT_PRINTER
|
||||
+#define DEFAULT_PRINTER ( HP720 )
|
||||
+#endif
|
||||
+
|
||||
+/* for HP720 series */
|
||||
+/* Refer to CALIBRATION file about these settings */
|
||||
+#define HP720_X_OFFSET ( 169 )
|
||||
+#define HP720_Y_OFFSET ( -569 )
|
||||
+
|
||||
+#define HP720_TOP_MARGIN ( 150 )
|
||||
+#define HP720_LEFT_MARGIN ( 150 )
|
||||
+#define HP720_RIGHT_MARGIN ( 150 )
|
||||
+#define HP720_BOTTOM_MARGIN ( 150 )
|
||||
+
|
||||
+/* for HP820 series */
|
||||
+/* Refer to CALIBRATION file about these settings */
|
||||
+#define HP820_X_OFFSET ( 75 )
|
||||
+#define HP820_Y_OFFSET ( -500 )
|
||||
+
|
||||
+#define HP820_TOP_MARGIN ( 80 )
|
||||
+#define HP820_LEFT_MARGIN ( 80 )
|
||||
+#define HP820_RIGHT_MARGIN ( 80 )
|
||||
+#define HP820_BOTTOM_MARGIN ( 150 )
|
||||
+
|
||||
+/* for HP1000 series */
|
||||
+/* Refer to CALIBRATION file about these settings */
|
||||
+#define HP1000_X_OFFSET ( 100 )
|
||||
+#define HP1000_Y_OFFSET ( -650 )
|
||||
+
|
||||
+#define HP1000_TOP_MARGIN ( 150 )
|
||||
+#define HP1000_LEFT_MARGIN ( 150 )
|
||||
+#define HP1000_RIGHT_MARGIN ( 150 )
|
||||
+#define HP1000_BOTTOM_MARGIN ( 150 )
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
diff -up pbm2ppa-0.8.6/INSTALL.20000205 pbm2ppa-0.8.6/INSTALL
|
||||
--- pbm2ppa-0.8.6/INSTALL.20000205 1998-10-19 02:27:16.000000000 +0100
|
||||
+++ pbm2ppa-0.8.6/INSTALL 2008-09-24 15:15:53.000000000 +0100
|
||||
@@ -1,6 +1,6 @@
|
||||
Overview
|
||||
--------
|
||||
-This file contains some quick notes on installation in general. For a
|
||||
+ This file contains some quick notes on installation in general. For a
|
||||
complete step-by-step instruction on how to install pbm2ppa for your
|
||||
printer, please see INSTALL-MORE. (It was written for the 820, but it
|
||||
should work for all supported models) Thanks to Michael Buehlmann for
|
||||
@@ -9,14 +9,19 @@ writing that guide!
|
||||
Compilation
|
||||
-----------
|
||||
To compile, you should simply run 'make' with the series of your
|
||||
-printer. The following options are supported:
|
||||
+printer. This will set the default printer to the HP720 series.
|
||||
+To specify a different default printyer, the following options are supported:
|
||||
|
||||
make 720 # for 720 series - e.g. 722C
|
||||
make 820 # for 820 series - e.g. 820Cse
|
||||
make 1000 # for 1000 series
|
||||
|
||||
-If you choose to recompile for a different printer series, you must 'make
|
||||
-clean' first.
|
||||
+ If you choose to recompile for a different default printer series,
|
||||
+you must 'make clean' first. However, the default printer choice
|
||||
+selected at compilation time can be overridden with e.g., the
|
||||
+"pbm2pppa -v 820 ..." command line option, or specified by e.g.,
|
||||
+a "version 820" entry in the /etc/pbm2ppa.conf file.
|
||||
+Type "pbm2ppa -h" to see the list of options.
|
||||
|
||||
Installation
|
||||
------------
|
||||
@@ -26,17 +31,23 @@ but you might want to tweak them). See
|
||||
|
||||
The other binary created, pbm2ppa, is a converter from a PBM
|
||||
image to a stream of PPA data that can be sent directly to the printer.
|
||||
-The PBM image is expected to be 600 dpi, 8.5"x11". These files can be
|
||||
+The PBM image is expected to be 600 dpi, and the paper size
|
||||
+can be 8.5"x11" (US Letter), 8.5"x14" (US Legal) or A4. These files can be
|
||||
generated with ghostscript. Both the pbm and pbmraw devices are supported.
|
||||
pbmraw is MUCH faster, so use it if you have it available!
|
||||
+IMPORTANT: the PAPERSIZE option passed to ghostscript must match
|
||||
+the paper size specified for pbm2ppa.
|
||||
+Valid papersizes are: "letter" = "us" , "legal" , and "a4" .
|
||||
|
||||
Use
|
||||
---
|
||||
- To print a postscript file with this program, I use a simple
|
||||
-shell script:
|
||||
+ To print a postscript file with this program, on US Letter
|
||||
+paper and a HP 710/720 series printer, I use a simple shell script:
|
||||
|
||||
-cat $1 | gs -sDEVICE=pbm -q -dNOPAUSE -r600 -sOutputFile=- - | \
|
||||
-pbm2ppa - - | lpr
|
||||
+cat $1 | gs -sDEVICE=pbm -q -dNOPAUSE -r600 -sPAPERSIZE=letter -sOutputFile=- - | \
|
||||
+pbm2ppa -s letter -v 720 - - | lpr -l
|
||||
+
|
||||
+Valid printer versions are "720", "820" and "1000".
|
||||
|
||||
You can also set up a printer filter. See the documentation for
|
||||
your print spooler for information on how to do that, or look in
|
||||
diff -up pbm2ppa-0.8.6/INSTALL-MORE.20000205 pbm2ppa-0.8.6/INSTALL-MORE
|
||||
--- pbm2ppa-0.8.6/INSTALL-MORE.20000205 1998-10-19 02:27:17.000000000 +0100
|
||||
+++ pbm2ppa-0.8.6/INSTALL-MORE 2008-09-24 15:15:53.000000000 +0100
|
||||
@@ -36,14 +36,21 @@ or put in your printer number (720, 820
|
||||
file).
|
||||
|
||||
|
||||
-2. To adjust the paper size to DIN A4, use the -s a4 option to pbm2ppa or
|
||||
+2. To adjust the paper size to US Legal (8.5"x14"), use the -s legal option
|
||||
+to pbm2ppa or change your pbm2ppa.conf file to read "papersize legal"
|
||||
+To adjust the paper size to DIN A4, use the -s a4 option to pbm2ppa or
|
||||
change your pbm2ppa.conf file to read "papersize a4" (see step 5).
|
||||
-
|
||||
+For US Letter (8.5"x11") paper is the default; "-s us", "-s letter",
|
||||
+"papersize us" and "papersize letter" also specif this size.
|
||||
|
||||
3. You can now calibrate the printer with
|
||||
|
||||
-For US size paper:
|
||||
+For US Letter size paper:
|
||||
# pbmtpg | pbm2ppa > /dev/lp1 ( as root )
|
||||
+or
|
||||
+# pbmtpg -letter | pbm2ppa > /dev/lp1 ( as root )
|
||||
+For US Legal size paper:
|
||||
+# pbmtpg -legal | pbm2ppa -s a4 > /dev/lp1 ( as root )
|
||||
For A4 size paper:
|
||||
# pbmtpg -a4 | pbm2ppa -s a4 > /dev/lp1 ( as root )
|
||||
|
||||
diff -up pbm2ppa-0.8.6/Makefile.20000205 pbm2ppa-0.8.6/Makefile
|
||||
--- pbm2ppa-0.8.6/Makefile.20000205 1998-10-11 16:17:16.000000000 +0100
|
||||
+++ pbm2ppa-0.8.6/Makefile 2008-09-24 15:15:53.000000000 +0100
|
||||
@@ -1,36 +1,23 @@
|
||||
CC=gcc
|
||||
-CFLAGS=-Wall -O2
|
||||
+CFLAGS=-Wall -O2
|
||||
LDFLAGS=
|
||||
+PRINTER=HP720
|
||||
|
||||
-default:
|
||||
- @echo Please specify the type of printer you wish to compile this
|
||||
- @echo software for. Supported options are:
|
||||
- @echo
|
||||
- @echo make 720
|
||||
- @echo make 820
|
||||
- @echo make 1000
|
||||
- @echo
|
||||
- @exit
|
||||
+default: all
|
||||
|
||||
-720.h:
|
||||
- cp defaults.720.h defaults.h
|
||||
+720: PRINTER=HP720
|
||||
+720: all
|
||||
|
||||
-820.h:
|
||||
- cp defaults.820.h defaults.h
|
||||
+820: PRINTER=HP820
|
||||
+820: all
|
||||
|
||||
-1000.h:
|
||||
- cp defaults.1000.h defaults.h
|
||||
+1000: PRINTER=HP1000
|
||||
+1000: all
|
||||
|
||||
-720: 720.h all
|
||||
-
|
||||
-820: 820.h all
|
||||
-
|
||||
-1000: 1000.h all
|
||||
-
|
||||
-all: defaults.h pbm2ppa pbmtpg
|
||||
+all: pbm2ppa pbmtpg
|
||||
|
||||
clean:
|
||||
- rm -f *.o *~ pbmtpg pbm2ppa defaults.h
|
||||
+ rm -f *.o *~ pbmtpg pbm2ppa
|
||||
|
||||
pbm2ppa: pbm2ppa.o ppa.o pbm.o cutswath.o
|
||||
$(CC) $(LDFLAGS) -o pbm2ppa pbm2ppa.o ppa.o pbm.o cutswath.o
|
||||
@@ -39,4 +26,11 @@ pbmtpg: pbmtpg.o
|
||||
$(CC) $(CFLAGS) -o pbmtpg pbmtpg.o -lm
|
||||
|
||||
.c.o: $*.c ppa.h pbm.h
|
||||
- $(CC) $(CFLAGS) -c $*.c
|
||||
+ $(CC) $(CFLAGS) -DDEFAULT_PRINTER=$(PRINTER) -c $*.c
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
diff -up /dev/null pbm2ppa-0.8.6/pbm2ppa.1
|
||||
--- /dev/null 2008-09-24 08:53:03.196006296 +0100
|
||||
+++ pbm2ppa-0.8.6/pbm2ppa.1 2008-09-24 15:15:53.000000000 +0100
|
||||
@@ -0,0 +1,135 @@
|
||||
+.TH pnm2ppa "5 Feb 2000"
|
||||
+.SH NAME
|
||||
+pbm2ppa - convert portable bitmap (PBM) to HP's Printing Performance Architecture (PPA) file format
|
||||
+.SH SYNOPSIS
|
||||
+pbm2ppa [options] [ <\fIinfile\fR] > [ <\fIoutfile\fR]> ] ]
|
||||
+
|
||||
+.SH DESCRIPTION
|
||||
+Reads portable bitmap (PBM) format as input. Outputs a stream suitable for
|
||||
+processing by Hewlett-Packard's range of Printing Performance Architecture
|
||||
+(PPA) printers.
|
||||
+pnm2ppa supports the HP 710c, 712c, 720c, 722c, 820c, and 1000c
|
||||
+series printers.
|
||||
+.PP
|
||||
+(Portable bitmap (PBM) format output can be produced from PostScript(tm) input
|
||||
+by the GhostScript driver "pbmraw".)
|
||||
+.PP
|
||||
+
|
||||
+
|
||||
+.SH OPTIONS
|
||||
+.\"{{{ infile
|
||||
+.IP "\fB\\fIinfile\fR \fP"
|
||||
+Input file \fIinfile\fR is either a path to a file or device, or '-' to indicate stdin (defaults to stdin)
|
||||
+.\"}}}
|
||||
+
|
||||
+
|
||||
+.\"{{{ outfile
|
||||
+.IP "\fB\\fIoutfile\fR \fP"
|
||||
+Output file \fIoutfile\fR is either a path to a file or device, or '-' to indicate stdout (defaults to stdout)
|
||||
+.\"}}}
|
||||
+
|
||||
+
|
||||
+.\"{{{ -b bottommargin
|
||||
+.IP "\fB\-b \fIbottommargin\fR\fP"
|
||||
+Sets the bottom margin \fIbottommargin\fR in units of 1/600 inches (e.g., -b 150 = 0.25")
|
||||
+.\"}}}
|
||||
+
|
||||
+
|
||||
+.\"{{{ -d
|
||||
+.IP "\fB\-d\fP"
|
||||
+Displays the current configuration
|
||||
+.\"}}}
|
||||
+
|
||||
+
|
||||
+.\"{{{ -f configfile
|
||||
+.IP "\fB\-f \fIconfigfile\fR\fP"
|
||||
+Overrides reading the configuration from /etc/pnm2ppa.conf, and uses
|
||||
+\fIconfigfile\fR instead.
|
||||
+.\"}}}
|
||||
+
|
||||
+
|
||||
+.\"{{{ -h
|
||||
+.IP "\fB\-h\fP"
|
||||
+Displays program usage
|
||||
+.\"}}}
|
||||
+
|
||||
+
|
||||
+
|
||||
+.\"{{{ -l leftmargin
|
||||
+.IP "\fB\-l \fIleftmargin\fR\fP"
|
||||
+Sets the left margin \fIleftmargin\fR in units of 1/600 inches (e.g., -l 150 = 0.25")
|
||||
+.\"}}}
|
||||
+
|
||||
+
|
||||
+.\"{{{ -r rightmargin
|
||||
+.IP "\fB\-r \fIrightmargin\fR\fP"
|
||||
+Sets the right margin \fIrightmargin\fR in units of 1/600 inches (e.g., -r 150 = 0.25")
|
||||
+.\"}}}
|
||||
+
|
||||
+.\"{{{ -s papersize
|
||||
+.IP "\fB\-s \fIpapersize\fR\fP"
|
||||
+Sets the paper size. Possible values for \fIpapersize\fR are \fBa4\fP (A4),
|
||||
+\fBletter\fP or \fBus\fP (US Letter, 8.5"x11"), and \fBlegal\fR (US Legal,
|
||||
+8.5"x14").
|
||||
+The default is US Letter.
|
||||
+.\"}}}
|
||||
+
|
||||
+.\"{{{ -t topmargin
|
||||
+.IP "\fB\-t \fItopmargin\fR\fP"
|
||||
+Sets the top margin \fItopmargin\fR in units of 1/600 inches (ie -t 150 = 0.25")
|
||||
+.\"}}}
|
||||
+
|
||||
+.\"{{{ -v printertype
|
||||
+.IP "\fB\-v \fIprintertype\fP"
|
||||
+Selects the printer model. Possible values of \fIprintertype\fR are:
|
||||
+\fB710\fP, \fB712\fP, \fB720\fP, \fB722\fP, \fB820\fP and \fB1000\fP.
|
||||
+The default is the HP DeskJet 7X0 Series (710, 712, 720, 722).
|
||||
+.\"}}}
|
||||
+
|
||||
+
|
||||
+.\"{{{ -x xoffset
|
||||
+.IP "\fB\-x \fIxoffset\fR\fP"
|
||||
+Sets the x-offset \fBxoffset\fR from the left of the page. Units are 1/600 inches
|
||||
+.\"}}}
|
||||
+
|
||||
+.\"{{{ -y yoffset
|
||||
+.IP "\fB\-y \fIyoffset\fR\fP"
|
||||
+Sets the y-offset \fByoffset\fR from the top of the page. Units are 1/600 inches
|
||||
+.\"}}}
|
||||
+
|
||||
+
|
||||
+.SH NOTES
|
||||
+The configuration file is read in first. Command line arguments then modify the resulting definitions.
|
||||
+.PP
|
||||
+The -x and -y options accumulate. The -v option resets all definitions back to
|
||||
+an inbuilt default for that printer and should be used before subsequent -b -l -r, -t, -x, and -y arguments.
|
||||
+.SH "SEE ALSO"
|
||||
+pbm(5)
|
||||
+
|
||||
+.SH FILES
|
||||
+
|
||||
+.\"{{{ /etc/pbm2ppa.conf
|
||||
+.IP "\fB\fI/etc/pbm2ppa.conf\fR\fP"
|
||||
+Default configuration file
|
||||
+.\"}}}
|
||||
+
|
||||
+
|
||||
+.SH AUTHOR
|
||||
+This code is licensed under the GNU Public License version 2. See
|
||||
+LICENSE for details.
|
||||
+.PP
|
||||
+(c) 1998 Tim Norman
|
||||
+.PP
|
||||
+.SH HISTORY
|
||||
+This program was written by Tim Norman. It originally
|
||||
+supported black and white output on the 820 series. This program is
|
||||
+almost obsolete; its successor pnm2ppa will support color printing.
|
||||
+.SH BUGS
|
||||
+This is a stable driver, but does not support color printing.
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
diff -up pbm2ppa-0.8.6/pbm2ppa.c.20000205 pbm2ppa-0.8.6/pbm2ppa.c
|
||||
--- pbm2ppa-0.8.6/pbm2ppa.c.20000205 1998-09-16 01:00:27.000000000 +0100
|
||||
+++ pbm2ppa-0.8.6/pbm2ppa.c 2008-09-24 15:15:53.000000000 +0100
|
||||
@@ -17,10 +17,15 @@
|
||||
|
||||
/* Paper sizes in 600ths of an inch. */
|
||||
|
||||
-/* US is 8.5 in by 11 in */
|
||||
+/* US Letter is 8.5 in by 11 in */
|
||||
|
||||
-#define USWIDTH (5100)
|
||||
-#define USHEIGHT (6600)
|
||||
+#define LETTERWIDTH (5100)
|
||||
+#define LETTERHEIGHT (6600)
|
||||
+
|
||||
+/* US Legal is 8.5 in by 14 in */
|
||||
+
|
||||
+#define LEGALWIDTH (5100)
|
||||
+#define LEGALHEIGHT (8400)
|
||||
|
||||
/* A4 is 210 mm by 297 mm == 8.27 in by 11.69 in */
|
||||
|
||||
@@ -121,16 +126,35 @@ int print_pbm (FILE *in)
|
||||
|
||||
void set_printer_specific_defaults()
|
||||
{
|
||||
- printer.x_offset=DEFAULT_X_OFFSET;
|
||||
- printer.y_offset=DEFAULT_Y_OFFSET;
|
||||
switch(printer.version)
|
||||
{
|
||||
case HP720:
|
||||
+ printer.x_offset=HP720_X_OFFSET;
|
||||
+ printer.y_offset=HP720_Y_OFFSET;
|
||||
+ printer.top_margin=HP720_TOP_MARGIN;
|
||||
+ printer.left_margin=HP720_LEFT_MARGIN;
|
||||
+ printer.right_margin=HP720_RIGHT_MARGIN;
|
||||
+ printer.bottom_margin=HP720_BOTTOM_MARGIN;
|
||||
printer.marg_diff=2;
|
||||
printer.bufsize = 200*1024;
|
||||
break;
|
||||
case HP820:
|
||||
+ printer.x_offset=HP820_X_OFFSET;
|
||||
+ printer.y_offset=HP820_Y_OFFSET;
|
||||
+ printer.top_margin=HP820_TOP_MARGIN;
|
||||
+ printer.left_margin=HP820_LEFT_MARGIN;
|
||||
+ printer.right_margin=HP820_RIGHT_MARGIN;
|
||||
+ printer.bottom_margin=HP820_BOTTOM_MARGIN;
|
||||
+ printer.marg_diff=0x62;
|
||||
+ printer.bufsize = 100*1024;
|
||||
+ break;
|
||||
case HP1000:
|
||||
+ printer.x_offset=HP1000_X_OFFSET;
|
||||
+ printer.y_offset=HP1000_Y_OFFSET;
|
||||
+ printer.top_margin=HP1000_TOP_MARGIN;
|
||||
+ printer.left_margin=HP1000_LEFT_MARGIN;
|
||||
+ printer.right_margin=HP1000_RIGHT_MARGIN;
|
||||
+ printer.bottom_margin=HP1000_BOTTOM_MARGIN;
|
||||
printer.marg_diff=0x62;
|
||||
printer.bufsize = 100*1024;
|
||||
break;
|
||||
@@ -144,15 +168,17 @@ void show_usage(char* prog)
|
||||
{
|
||||
printf("usage: %s [ options ] [ <infile> [ <outfile> ] ]\n\n",prog);
|
||||
printf(" Prints a pbm- or pbmraw-format <infile> to HP720/820/1000-format <outfile>.\n\n");
|
||||
- printf(" -v <version> printer version (720, 820, or 1000)\n");
|
||||
- printf(" -x <xoff> vertical offset adjustment in 1\"/600\n");
|
||||
- printf(" -y <yoff> horizontal offset adjustment in 1\"/600\n");
|
||||
- printf(" -t <topmarg> top margin in 1\"/600 (default: 150 = 0.25\")\n");
|
||||
- printf(" -l <leftmarg> left margin in 1\"/600 (default: 150 = 0.25\")\n");
|
||||
- printf(" -r <rightmarg> right margin in 1\"/600 (default: 150 = 0.25\")\n");
|
||||
- printf(" -b <botmarg> bottom margin in 1\"/600 (default: 150 = 0.25\")\n");
|
||||
- printf(" -s <paper> paper size (us, a4, default: us)\n");
|
||||
+ printf(" -b <margin> bottom margin in 1\"/600 (default: 150 = 0.25\")\n");
|
||||
+ printf(" -d dumps the configuration to stdout");
|
||||
printf(" -f <cfgfile> read <cfgfile> as parameters\n\n");
|
||||
+ printf(" -h displays this help text");
|
||||
+ printf(" -l <margin> left margin in 1\"/600 (default: 150 = 0.25\")\n");
|
||||
+ printf(" -r <margin> right margin in 1\"/600 (default: 150 = 0.25\")\n");
|
||||
+ printf(" -s <paper> paper size (us,letter,legal,a4, default: us)\n");
|
||||
+ printf(" -t <margin> top margin in 1\"/600 (default: 150 = 0.25\")\n");
|
||||
+ printf(" -v <model> printer model (710, 712, 720, 722, 820, or 1000)\n");
|
||||
+ printf(" -x <offset> vertical offset adjustment in 1\"/600\n");
|
||||
+ printf(" -y <offset> horizontal offset adjustment in 1\"/600\n");
|
||||
printf(" The -x and -y options accumulate. The -v option resets the horizontal and\n");
|
||||
printf(" vertical adjustments to an internal default. <infile> and <outfile> default\n");
|
||||
printf(" to stdin and stdout. '-' is a synonym for stdin and stdout.\n\n");
|
||||
@@ -173,7 +199,13 @@ void show_usage(char* prog)
|
||||
|
||||
void parm_version(char* arg)
|
||||
{
|
||||
- if(!strcasecmp(arg,"hp720") || !strcmp(arg,"720"))
|
||||
+ if(!strcasecmp(arg,"hp710") || !strcmp(arg,"710"))
|
||||
+ printer.version=HP720;
|
||||
+ else if(!strcasecmp(arg,"hp712") || !strcmp(arg,"712"))
|
||||
+ printer.version=HP720;
|
||||
+ else if(!strcasecmp(arg,"hp720") || !strcmp(arg,"720"))
|
||||
+ printer.version=HP720;
|
||||
+ else if(!strcasecmp(arg,"hp722") || !strcmp(arg,"722"))
|
||||
printer.version=HP720;
|
||||
else if(!strcasecmp(arg,"hp820") || !strcmp(arg,"820"))
|
||||
printer.version=HP820;
|
||||
@@ -191,7 +223,10 @@ void parm_iversion(int arg)
|
||||
{
|
||||
switch(arg)
|
||||
{
|
||||
+ case 710:
|
||||
+ case 712:
|
||||
case 720:
|
||||
+ case 722:
|
||||
printer.version=HP720;
|
||||
break;
|
||||
case 820:
|
||||
@@ -262,10 +297,15 @@ void read_config_file(char* fname)
|
||||
printer.bottom_margin=value;
|
||||
else if(!strncmp(key,"papersize",len))
|
||||
{
|
||||
- if(!strcmp(buf,"us"))
|
||||
+ if(!strcmp(buf,"us") || !strcmp(buf,"letter"))
|
||||
+ {
|
||||
+ Width = LETTERWIDTH;
|
||||
+ Height = LETTERHEIGHT;
|
||||
+ }
|
||||
+ else if(!strcmp(buf,"legal"))
|
||||
{
|
||||
- Width = USWIDTH;
|
||||
- Height = USHEIGHT;
|
||||
+ Width = LEGALWIDTH;
|
||||
+ Height = LEGALHEIGHT;
|
||||
}
|
||||
else if(!strcmp(buf,"a4"))
|
||||
{
|
||||
@@ -313,15 +353,9 @@ int main (int argc, char *argv[])
|
||||
FILE *in=stdin, *out=stdout;
|
||||
struct stat tmpstat;
|
||||
|
||||
- printer.version = DEFAULT_PRINTER;
|
||||
- printer.x_offset = DEFAULT_X_OFFSET;
|
||||
- printer.y_offset = DEFAULT_Y_OFFSET;
|
||||
- printer.top_margin = DEFAULT_TOP_MARGIN;
|
||||
- printer.left_margin = DEFAULT_LEFT_MARGIN;
|
||||
- printer.right_margin = DEFAULT_RIGHT_MARGIN;
|
||||
- printer.bottom_margin = DEFAULT_BOTTOM_MARGIN;
|
||||
- Width = USWIDTH;
|
||||
- Height = USHEIGHT;
|
||||
+ printer.version = DEFAULT_PRINTER;
|
||||
+ Width = LETTERWIDTH;
|
||||
+ Height = LETTERHEIGHT;
|
||||
set_printer_specific_defaults();
|
||||
|
||||
if(!stat(defaultcfgfile,&tmpstat))
|
||||
@@ -356,10 +390,15 @@ int main (int argc, char *argv[])
|
||||
else if(!strcmp(argv[argn],"-s"))
|
||||
{
|
||||
argn++;
|
||||
- if(!strcmp(argv[argn],"us"))
|
||||
+ if(!strcmp(argv[argn],"us") || !strcmp(argv[argn],"letter"))
|
||||
{
|
||||
- Width = USWIDTH;
|
||||
- Height = USHEIGHT;
|
||||
+ Width = LETTERWIDTH;
|
||||
+ Height = LETTERHEIGHT;
|
||||
+ }
|
||||
+ else if(!strcmp(argv[argn],"legal"))
|
||||
+ {
|
||||
+ Width = LEGALWIDTH;
|
||||
+ Height = LEGALHEIGHT;
|
||||
}
|
||||
else if(!strcmp(argv[argn],"a4"))
|
||||
{
|
||||
@@ -414,3 +453,4 @@ int main (int argc, char *argv[])
|
||||
return print_pbm (in);
|
||||
}
|
||||
|
||||
+
|
||||
diff -up /dev/null pbm2ppa-0.8.6/pbm2ppa.conf
|
||||
--- /dev/null 2008-09-24 08:53:03.196006296 +0100
|
||||
+++ pbm2ppa-0.8.6/pbm2ppa.conf 2008-09-24 15:15:53.000000000 +0100
|
||||
@@ -0,0 +1,58 @@
|
||||
+# Sample configuration file for the HP720/HP820/HP1000 PPA Printers
|
||||
+#
|
||||
+# This file will be automatically read upon startup if it's placed in
|
||||
+# /etc/pbm2ppa.conf
|
||||
+#
|
||||
+
|
||||
+# uncomment options (remove "#" at beginning of line) to activate them
|
||||
+
|
||||
+#valid printer versions are 710, 712, 720, 722. 820, 100
|
||||
+# 710 = 712 = 720 = 722: HP DeskJet 710C, 712C, 720C, 722C (default)
|
||||
+# 820: HP DeskJet 820Cse, 820Cxi
|
||||
+# 1000: HP DeskJet 1000Cse, 1000Cxi
|
||||
+#version 720
|
||||
+#version 820
|
||||
+#version 1000
|
||||
+#
|
||||
+
|
||||
+# valid papersizes are us, letter, legal, a4
|
||||
+# US Letter (8.5"x11"): us, letter (default)
|
||||
+# US Legal (8.5"x14"): legal
|
||||
+# A4 : a4
|
||||
+#papersize letter
|
||||
+#papersize legal
|
||||
+#papersize a4
|
||||
+
|
||||
+
|
||||
+#Defaults for 720 series:
|
||||
+# X-offset, Y-Offset: (Adjust these for your printer, see CALIBRATE)
|
||||
+#xoff 169
|
||||
+#yoff -569
|
||||
+# 1/4 inch margins all around (at 600 DPI)
|
||||
+#top 150
|
||||
+#bottom 150
|
||||
+#left 150
|
||||
+#right 150
|
||||
+
|
||||
+#Defaults for 820 series:
|
||||
+# X-offset, Y-Offset: (Adjust these for your printer, see CALIBRATE)
|
||||
+#xoff 75
|
||||
+#yoff -500
|
||||
+# 1/4 inch margins all around (at 600 DPI)
|
||||
+#top 80
|
||||
+#bottom 150
|
||||
+#left 80
|
||||
+#right 80
|
||||
+
|
||||
+#Defaults for 820 series:
|
||||
+# X-offset, Y-Offset: (Adjust these for your printer, see CALIBRATE)
|
||||
+#xoff 100
|
||||
+#yoff -650
|
||||
+# 1/4 inch margins all around (at 600 DPI)
|
||||
+#top 150
|
||||
+#bottom 150
|
||||
+#left 150
|
||||
+#right 150
|
||||
+
|
||||
+
|
||||
+
|
||||
diff -up pbm2ppa-0.8.6/pbm2ppa.conf.hp1000.20000205 pbm2ppa-0.8.6/pbm2ppa.conf.hp1000
|
||||
--- pbm2ppa-0.8.6/pbm2ppa.conf.hp1000.20000205 1998-10-19 02:27:19.000000000 +0100
|
||||
+++ pbm2ppa-0.8.6/pbm2ppa.conf.hp1000 2008-09-24 15:17:47.000000000 +0100
|
||||
@@ -1,18 +0,0 @@
|
||||
-# Sample configuration file for the HP720
|
||||
-#
|
||||
-# This file will be automatically read upon startup if it's placed in
|
||||
-# /etc/pbm2ppa.conf
|
||||
-#
|
||||
-
|
||||
-version 1000
|
||||
-
|
||||
-papersize us
|
||||
-
|
||||
-xoff 100 # \ Adjust these for your printer.
|
||||
-yoff -650 # / (see CALIBRATE)
|
||||
-
|
||||
-# 1/4 inch margins all around (at 600 DPI)
|
||||
-top 150
|
||||
-bottom 150
|
||||
-left 150
|
||||
-right 150
|
||||
diff -up pbm2ppa-0.8.6/pbm2ppa.conf.hp720.20000205 pbm2ppa-0.8.6/pbm2ppa.conf.hp720
|
||||
--- pbm2ppa-0.8.6/pbm2ppa.conf.hp720.20000205 1998-10-19 02:27:20.000000000 +0100
|
||||
+++ pbm2ppa-0.8.6/pbm2ppa.conf.hp720 2008-09-24 15:17:47.000000000 +0100
|
||||
@@ -1,18 +0,0 @@
|
||||
-# Sample configuration file for the HP720
|
||||
-#
|
||||
-# This file will be automatically read upon startup if it's placed in
|
||||
-# /etc/pbm2ppa.conf
|
||||
-#
|
||||
-
|
||||
-version 720
|
||||
-
|
||||
-papersize us
|
||||
-
|
||||
-xoff 169 # \ Adjust these for your printer.
|
||||
-yoff -569 # / (see CALIBRATE)
|
||||
-
|
||||
-# 1/4 inch margins all around (at 600 DPI)
|
||||
-top 150
|
||||
-bottom 150
|
||||
-left 150
|
||||
-right 150
|
||||
diff -up pbm2ppa-0.8.6/pbm2ppa.conf.hp820.20000205 pbm2ppa-0.8.6/pbm2ppa.conf.hp820
|
||||
--- pbm2ppa-0.8.6/pbm2ppa.conf.hp820.20000205 1998-10-19 02:27:21.000000000 +0100
|
||||
+++ pbm2ppa-0.8.6/pbm2ppa.conf.hp820 2008-09-24 15:17:47.000000000 +0100
|
||||
@@ -1,18 +0,0 @@
|
||||
-# Sample configuration file for the HP820
|
||||
-#
|
||||
-# This file will be automatically read upon startup if it's placed in
|
||||
-# /etc/pbm2ppa.conf
|
||||
-#
|
||||
-
|
||||
-version 820
|
||||
-
|
||||
-papersize us
|
||||
-
|
||||
-xoff 75 # \ Adjust these for your printer.
|
||||
-yoff -500 # / (see CALIBRATE)
|
||||
-
|
||||
-# 1/4 inch margins all around (at 600 DPI)
|
||||
-top 80
|
||||
-bottom 150
|
||||
-left 80
|
||||
-right 80
|
||||
diff -up pbm2ppa-0.8.6/pbmtpg.c.20000205 pbm2ppa-0.8.6/pbmtpg.c
|
||||
--- pbm2ppa-0.8.6/pbmtpg.c.20000205 1998-09-16 01:00:28.000000000 +0100
|
||||
+++ pbm2ppa-0.8.6/pbmtpg.c 2008-09-24 15:15:53.000000000 +0100
|
||||
@@ -1,13 +1,19 @@
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
|
||||
-/* Support both US and A4. */
|
||||
+/* Support US Letter, Legal, and A4. */
|
||||
|
||||
-/* US is 8.5 in by 11 in */
|
||||
+/* US Letter is 8.5 in by 11 in */
|
||||
|
||||
-#define USWIDTH (5100)
|
||||
-#define USHEIGHT (6600)
|
||||
+#define LETTERWIDTH (5100)
|
||||
+#define LETTERHEIGHT (6600)
|
||||
+
|
||||
+/* US Legal is 8.5 in by 14 in */
|
||||
+
|
||||
+#define LEGALWIDTH (5100)
|
||||
+#define LEGALHEIGHT (8400)
|
||||
|
||||
/* A4 is 210 mm by 297 mm == 8.27 in by 11.69 in */
|
||||
|
||||
@@ -137,8 +143,24 @@ int main(int argc,char** argv)
|
||||
char buf[128];
|
||||
char *progname = *argv;
|
||||
|
||||
- Width = USWIDTH;
|
||||
- Height = USHEIGHT;
|
||||
+ Width = LETTERWIDTH;
|
||||
+ Height = LETTERHEIGHT;
|
||||
+ if(argc>1 && strcmp(argv[1], "-letter")==0)
|
||||
+ {
|
||||
+ Width = LETTERWIDTH;
|
||||
+ Height = LETTERHEIGHT;
|
||||
+ argc--;
|
||||
+ argv++;
|
||||
+ }
|
||||
+
|
||||
+ if(argc>1 && strcmp(argv[1], "-legal")==0)
|
||||
+ {
|
||||
+ Width = LEGALWIDTH;
|
||||
+ Height = LEGALHEIGHT;
|
||||
+ argc--;
|
||||
+ argv++;
|
||||
+ }
|
||||
+
|
||||
if(argc>1 && strcmp(argv[1], "-a4")==0)
|
||||
{
|
||||
Width = A4WIDTH;
|
||||
@@ -146,6 +168,9 @@ int main(int argc,char** argv)
|
||||
argc--;
|
||||
argv++;
|
||||
}
|
||||
+
|
||||
+
|
||||
+
|
||||
Pwidth = (Width+7)/8;
|
||||
bitmap = (char *)malloc(Pwidth*Height);
|
||||
|
||||
@@ -192,6 +217,7 @@ int main(int argc,char** argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
+ Width = 8*Pwidth ; /* here need 8*Pwidth as the Width ! */
|
||||
printf("P4\n%d %d\n",Width,Height);
|
||||
|
||||
for(x=0; x<Pwidth*Height; x++)
|
||||
@@ -199,3 +225,10 @@ int main(int argc,char** argv)
|
||||
|
||||
return 0;
|
||||
}
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
diff -up pbm2ppa-0.8.6/README.REDHAT.20000205 pbm2ppa-0.8.6/README.REDHAT
|
||||
--- pbm2ppa-0.8.6/README.REDHAT.20000205 1998-08-22 14:48:40.000000000 +0100
|
||||
+++ pbm2ppa-0.8.6/README.REDHAT 2008-09-24 15:15:53.000000000 +0100
|
||||
@@ -1,12 +1,28 @@
|
||||
-RedHat users may find the following tip from Panayotis Vryonis <vrypan@hol.gr>
|
||||
-helpful!
|
||||
+The best way to integrate support for the HP PPA Printers into RedHat's
|
||||
+Linux Print System Manager (printtool) is to replace e.g., the
|
||||
+rhs-printfilters-1.57-3 RPM package that comes with Red Hat 6.1,
|
||||
+with a PPA-aware version from the pnm2ppa project whic h has a
|
||||
+homepage at http://www.sourceforge.net/projects/?group_id=1322
|
||||
|
||||
-Here is a tip to intergrate HP720C support in RedHat's printtool:
|
||||
+At the time of writing, the latest release is
|
||||
+ rhs-printfilters-1.57-4ppa1
|
||||
+This package includes support for both pbm2ppa and the new
|
||||
+color driver pnm2ppa.
|
||||
|
||||
-Install pbm2ppa. Copy pbm2ppa to /usr/bin.
|
||||
-Edit "printerdb" (in my system it is found in
|
||||
-/usr/lib/rhs/rhs-printfilters )
|
||||
-and append the following lines:
|
||||
+ -------------------------------------
|
||||
+
|
||||
+If for some reason, they cannot use this PPA-aware version of
|
||||
+rhs-printfilters, RedHat users may still find the following tip from
|
||||
+Panayotis Vryonis <vrypan@hol.gr> helpful!
|
||||
+It will work with the standard rhs-printfilters that comes with the
|
||||
+Red Hat release:
|
||||
+
|
||||
+ Here is a tip to integrate HP720C support in RedHat's printtool:
|
||||
+
|
||||
+ Install pbm2ppa. Copy pbm2ppa to /usr/bin.
|
||||
+ Edit "printerdb" (in my system it is found in
|
||||
+ /usr/lib/rhs/rhs-printfilters )
|
||||
+ and append the following lines:
|
||||
----------------------Cut here
|
||||
-------------------------------------------
|
||||
StartEntry: DeskJet720C
|
||||
@@ -23,7 +39,11 @@ StartEntry: DeskJet720C
|
||||
EndEntry
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
-Now you can add an HP720C printer just like any other, using printtool.
|
||||
+ Now you can add an HP720C printer just like any other, using printtool.
|
||||
+
|
||||
+ [Author's (P. Vryonis) Note: The same should work for the 820 and
|
||||
+ 1000, but it hasn't been tested. Also, use the pbmraw GSDriver if
|
||||
+ you have it; it's faster. ]
|
||||
+
|
||||
+
|
||||
|
||||
-[Author's Note: The same should work for the 820 and 1000, but it hasn't
|
||||
-been tested. Also, use the pbmraw GSDriver if you have it; it's faster. ]
|
52
SOURCES/pnm2ppa-coverity-return-local.patch
Normal file
52
SOURCES/pnm2ppa-coverity-return-local.patch
Normal file
@ -0,0 +1,52 @@
|
||||
diff -up pnm2ppa-1.04/calibrate_ppa.c.coverity-return-local pnm2ppa-1.04/calibrate_ppa.c
|
||||
--- pnm2ppa-1.04/calibrate_ppa.c.coverity-return-local 2000-11-11 22:22:38.000000000 +0000
|
||||
+++ pnm2ppa-1.04/calibrate_ppa.c 2011-05-20 16:04:23.233425268 +0100
|
||||
@@ -75,7 +75,7 @@ main (int argc, char *argv[])
|
||||
BOOLEAN gamma = false ;
|
||||
FILE *outFile = NULL ;
|
||||
int testPattern = 0;
|
||||
- char *out_filepath = NULL;
|
||||
+ char out_filepath[MAXPATHLEN];
|
||||
char c;
|
||||
static struct option long_opts[] = {
|
||||
{"gamma",0,0,'g'},
|
||||
@@ -157,9 +157,7 @@ main (int argc, char *argv[])
|
||||
{
|
||||
if ( strlen(optarg) < MAXPATHLEN )
|
||||
{
|
||||
- char filepath[MAXPATHLEN];
|
||||
- strncpy(filepath, optarg, MAXPATHLEN);
|
||||
- out_filepath = filepath ;
|
||||
+ strncpy(out_filepath, optarg, MAXPATHLEN);
|
||||
use_stdout = false ;
|
||||
}
|
||||
}
|
||||
diff -up pnm2ppa-1.04/pnm2ppa.c.coverity-return-local pnm2ppa-1.04/pnm2ppa.c
|
||||
--- pnm2ppa-1.04/pnm2ppa.c.coverity-return-local 2000-11-11 19:53:03.000000000 +0000
|
||||
+++ pnm2ppa-1.04/pnm2ppa.c 2011-05-20 16:04:23.234425246 +0100
|
||||
@@ -145,20 +145,15 @@ print_pnm (FILE * fptr)
|
||||
char *
|
||||
readPath(char *input )
|
||||
{
|
||||
- char File_path[MAXPATHLEN];
|
||||
char *path = NULL;
|
||||
/* security audit ajv 20001007; be very careful with input strings!*/
|
||||
if (strlen(input) < MAXPATHLEN )
|
||||
{
|
||||
- if ( strncpy (File_path, input, MAXPATHLEN ))
|
||||
- {
|
||||
- /*
|
||||
- a user-specifed file *File_path may later be opened;
|
||||
- should any extra validation of this be performed now ?
|
||||
- */
|
||||
- path = File_path;
|
||||
- return path;
|
||||
- }
|
||||
+ path = strdup(input);
|
||||
+ /*
|
||||
+ a user-specifed file *path may later be opened;
|
||||
+ should any extra validation of this be performed now ?
|
||||
+ */
|
||||
}
|
||||
else
|
||||
{
|
52
SOURCES/pnm2ppa-ldflags.patch
Normal file
52
SOURCES/pnm2ppa-ldflags.patch
Normal file
@ -0,0 +1,52 @@
|
||||
diff -up pnm2ppa-1.04/Makefile.ldflags pnm2ppa-1.04/Makefile
|
||||
--- pnm2ppa-1.04/Makefile.ldflags 2018-03-01 15:38:09.225582684 +0100
|
||||
+++ pnm2ppa-1.04/Makefile 2018-03-01 15:50:34.307261745 +0100
|
||||
@@ -11,7 +11,6 @@ INSTALL=install
|
||||
|
||||
# production build
|
||||
CFLAGS=$(RPM_OPT_FLAGS) -DNDEBUG
|
||||
-LDFLAGS=-lm
|
||||
OBJS = pnm2ppa.o syslog.o ppa.o image.o dither.o cutswath.o hash_ink.o gamma.o
|
||||
SRC = pnm2ppa.c syslog.c ppa.c image.c dither.c cutswath.c hash_ink.c gamma.c
|
||||
|
||||
@@ -108,10 +107,10 @@ uninstall:
|
||||
rm -f $(CONFDIR)/pnm2ppa.conf
|
||||
|
||||
pnm2ppa: $(OBJS)
|
||||
- $(CC) $(LDFLAGS) $(CFLAGS) -o pnm2ppa $(OBJS)
|
||||
+ $(CC) -lm $(LDFLAGS) $(CFLAGS) -o pnm2ppa $(OBJS)
|
||||
|
||||
calibrate_ppa: calibrate_ppa.o pnmtools.o gamma.o
|
||||
- $(CC) $(LDFLAGS) $(CFLAGS) -o calibrate_ppa calibrate_ppa.o pnmtools.o gamma.o
|
||||
+ $(CC) -lm $(LDFLAGS) $(CFLAGS) -o calibrate_ppa calibrate_ppa.o pnmtools.o gamma.o
|
||||
|
||||
calibrate_ppa.o: calibrate_ppa.c global.h image.h defaults.h pnmtools.h
|
||||
$(CC) $(CFLAGS) -c calibrate_ppa.c
|
||||
@@ -144,7 +143,7 @@ syslog.o: syslog.c syslog.h global.h
|
||||
$(CC) $(CFLAGS) -c syslog.c
|
||||
|
||||
make_hash_ink: make_hash_ink.c palette.h hash_ink.h
|
||||
- $(CC) $(CFLAGS) -o make_hash_ink make_hash_ink.c
|
||||
+ $(CC) $(CFLAGS) -lm $(LDFLAGS) -o make_hash_ink make_hash_ink.c
|
||||
|
||||
hash_ink.c: make_hash_ink
|
||||
./make_hash_ink 4 3 > hash_ink.c
|
||||
diff -up pnm2ppa-1.04/pbm2ppa-0.8.6/Makefile.ldflags pnm2ppa-1.04/pbm2ppa-0.8.6/Makefile
|
||||
--- pnm2ppa-1.04/pbm2ppa-0.8.6/Makefile.ldflags 2018-03-01 15:38:09.226582676 +0100
|
||||
+++ pnm2ppa-1.04/pbm2ppa-0.8.6/Makefile 2018-03-01 15:53:22.016739424 +0100
|
||||
@@ -1,6 +1,5 @@
|
||||
CC=gcc
|
||||
CFLAGS=$(RPM_OPT_FLAGS)
|
||||
-LDFLAGS=
|
||||
PRINTER=HP720
|
||||
|
||||
default: all
|
||||
@@ -23,7 +22,7 @@ pbm2ppa: pbm2ppa.o ppa.o pbm.o cutswath.
|
||||
$(CC) $(LDFLAGS) -o pbm2ppa pbm2ppa.o ppa.o pbm.o cutswath.o
|
||||
|
||||
pbmtpg: pbmtpg.o
|
||||
- $(CC) $(CFLAGS) -o pbmtpg pbmtpg.o -lm
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) -o pbmtpg pbmtpg.o -lm
|
||||
|
||||
.c.o: $*.c ppa.h pbm.h
|
||||
$(CC) $(CFLAGS) -DDEFAULT_PRINTER=$(PRINTER) -c $*.c
|
33
SOURCES/pnm2ppa-redhat.patch
Normal file
33
SOURCES/pnm2ppa-redhat.patch
Normal file
@ -0,0 +1,33 @@
|
||||
diff -up pnm2ppa-1.04/Makefile.rh pnm2ppa-1.04/Makefile
|
||||
--- pnm2ppa-1.04/Makefile.rh 2000-11-02 18:33:08.000000000 +0000
|
||||
+++ pnm2ppa-1.04/Makefile 2008-09-24 15:18:26.000000000 +0100
|
||||
@@ -10,7 +10,7 @@ CC=gcc
|
||||
INSTALL=install
|
||||
|
||||
# production build
|
||||
-CFLAGS=-Wall -pedantic -O2 -g -DNDEBUG
|
||||
+CFLAGS=$(RPM_OPT_FLAGS) -DNDEBUG
|
||||
LDFLAGS=-lm
|
||||
OBJS = pnm2ppa.o syslog.o ppa.o image.o dither.o cutswath.o hash_ink.o gamma.o
|
||||
SRC = pnm2ppa.c syslog.c ppa.c image.c dither.c cutswath.c hash_ink.c gamma.c
|
||||
diff -up pnm2ppa-1.04/pbm2ppa-0.8.6/Makefile.rh pnm2ppa-1.04/pbm2ppa-0.8.6/Makefile
|
||||
--- pnm2ppa-1.04/pbm2ppa-0.8.6/Makefile.rh 2008-09-24 15:18:26.000000000 +0100
|
||||
+++ pnm2ppa-1.04/pbm2ppa-0.8.6/Makefile 2008-09-24 15:18:26.000000000 +0100
|
||||
@@ -1,5 +1,5 @@
|
||||
CC=gcc
|
||||
-CFLAGS=-Wall -O2
|
||||
+CFLAGS=$(RPM_OPT_FLAGS)
|
||||
LDFLAGS=
|
||||
PRINTER=HP720
|
||||
|
||||
diff -up pnm2ppa-1.04/pnm2ppa.conf.rh pnm2ppa-1.04/pnm2ppa.conf
|
||||
--- pnm2ppa-1.04/pnm2ppa.conf.rh 2000-10-28 16:02:57.000000000 +0100
|
||||
+++ pnm2ppa-1.04/pnm2ppa.conf 2008-09-24 15:18:26.000000000 +0100
|
||||
@@ -12,7 +12,6 @@
|
||||
# will be used. The printer version can also be set with the command line
|
||||
# option e.g., "-v 720".
|
||||
|
||||
-version ERROR # PNM2PPA WIIL *NOT* WORK UNTIUL THIS ENTRY IS REMOVED!!!!
|
||||
#version 720 # 710, 712, 722 also acceptable
|
||||
#version 820
|
||||
#version 1000
|
264
SPECS/pnm2ppa.spec
Normal file
264
SPECS/pnm2ppa.spec
Normal file
@ -0,0 +1,264 @@
|
||||
Name: pnm2ppa
|
||||
Summary: Drivers for printing to HP PPA printers
|
||||
Epoch: 1
|
||||
Version: 1.04
|
||||
Release: 40%{?dist}
|
||||
URL: http://sourceforge.net/projects/pnm2ppa
|
||||
Source: http://download.sourceforge.net/pnm2ppa/pnm2ppa-%{version}.tar.gz
|
||||
# Following sourcelink is dead currently.
|
||||
Source1: http://www.httptech.com/ppa/files/ppa-0.8.6.tar.gz
|
||||
# Upstream sync.
|
||||
Patch2: pbm2ppa-20000205.diff
|
||||
# Use RPM_OPT_FLAGS.
|
||||
Patch3: pnm2ppa-redhat.patch
|
||||
# Don't return a local variable out of scope (bug #704568).
|
||||
Patch4: pnm2ppa-coverity-return-local.patch
|
||||
# add ldflags to Makefile
|
||||
Patch5: pnm2ppa-ldflags.patch
|
||||
License: GPLv2+
|
||||
|
||||
# gcc is no longer in buildroot by default
|
||||
BuildRequires: gcc
|
||||
|
||||
%description
|
||||
Pnm2ppa is a color driver for HP PPA host-based printers such as the
|
||||
HP710C, 712C, 720C, 722C, 820Cse, 820Cxi, 1000Cse, and 1000Cxi.
|
||||
Pnm2ppa accepts Ghostscript output in PPM format and sends it to the
|
||||
printer in PPA format.
|
||||
|
||||
Install pnm2ppa if you need to print to a PPA printer.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
#pbm2ppa source
|
||||
%setup -q -T -D -a 1
|
||||
%patch2 -p0 -b .20000205
|
||||
%patch3 -p1 -b .rh
|
||||
%patch4 -p1 -b .coverity-return-local
|
||||
%patch5 -p1 -b .ldflags
|
||||
|
||||
for file in docs/en/LICENSE pbm2ppa-0.8.6/LICENSE; do
|
||||
sed "s|\r||g" $file > $file.new && \
|
||||
touch -r $file $file.new && \
|
||||
mv $file.new $file
|
||||
done
|
||||
|
||||
%build
|
||||
# set redhat build flags
|
||||
%set_build_flags
|
||||
%make_build
|
||||
pushd pbm2ppa-0.8.6
|
||||
%make_build
|
||||
popd
|
||||
|
||||
|
||||
%install
|
||||
install -d $RPM_BUILD_ROOT%{_bindir}
|
||||
install -d $RPM_BUILD_ROOT%{_sysconfdir}
|
||||
install -d $RPM_BUILD_ROOT%{_mandir}/man1
|
||||
make INSTALLDIR=$RPM_BUILD_ROOT%{_bindir} CONFDIR=$RPM_BUILD_ROOT%{_sysconfdir} \
|
||||
MANDIR=$RPM_BUILD_ROOT%{_mandir}/man1 install
|
||||
install -p -m 0755 utils/Linux/detect_ppa $RPM_BUILD_ROOT%{_bindir}
|
||||
install -p -m 0755 utils/Linux/test_ppa $RPM_BUILD_ROOT%{_bindir}
|
||||
install -p -m 0755 pbm2ppa-0.8.6/pbm2ppa $RPM_BUILD_ROOT%{_bindir}
|
||||
install -p -m 0755 pbm2ppa-0.8.6/pbmtpg $RPM_BUILD_ROOT%{_bindir}
|
||||
install -p -m 0644 pbm2ppa-0.8.6/pbm2ppa.conf $RPM_BUILD_ROOT%{_sysconfdir}
|
||||
install -p -m 0644 pbm2ppa-0.8.6/pbm2ppa.1 $RPM_BUILD_ROOT%{_mandir}/man1
|
||||
|
||||
chmod 644 docs/en/LICENSE
|
||||
mkdir -p pbm2ppa
|
||||
for file in CALIBRATION CREDITS INSTALL INSTALL-MORE LICENSE README ; do
|
||||
install -p -m 0644 pbm2ppa-0.8.6/$file pbm2ppa/$file
|
||||
done
|
||||
|
||||
|
||||
%files
|
||||
%license docs/en/LICENSE
|
||||
%doc docs/en/CREDITS docs/en/INSTALL docs/en/README
|
||||
%doc docs/en/RELEASE-NOTES docs/en/TODO
|
||||
%doc docs/en/INSTALL.REDHAT.txt docs/en/COLOR.txt docs/en/CALIBRATION.txt
|
||||
%doc docs/en/INSTALL.REDHAT.html docs/en/COLOR.html docs/en/CALIBRATION.html
|
||||
%doc test.ps
|
||||
%doc pbm2ppa
|
||||
%{_bindir}/pnm2ppa
|
||||
%{_bindir}/pbm2ppa
|
||||
%{_bindir}/pbmtpg
|
||||
%{_bindir}/calibrate_ppa
|
||||
%{_bindir}/test_ppa
|
||||
%{_bindir}/detect_ppa
|
||||
%{_mandir}/man1/pnm2ppa.1*
|
||||
%{_mandir}/man1/pbm2ppa.1*
|
||||
%config(noreplace) %{_sysconfdir}/pnm2ppa.conf
|
||||
%config(noreplace) %{_sysconfdir}/pbm2ppa.conf
|
||||
|
||||
%changelog
|
||||
* Tue Jul 24 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1:1.04-40
|
||||
- correcting license
|
||||
|
||||
* Wed Jul 11 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1:1.04-39
|
||||
- ship license in %%license tag
|
||||
|
||||
* Thu Mar 01 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1:1.04-38
|
||||
- 1548734 - pnm2ppa: Partial Fedora build flags injection
|
||||
|
||||
* Mon Feb 19 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1:1.04-37
|
||||
- gcc is no longer in buildroot by default
|
||||
|
||||
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.04-36
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
* Thu Feb 08 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1:1.04-35
|
||||
- remove old stuff https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/MRWOMRZ6KPCV25EFHJ2O67BCCP3L4Y6N/
|
||||
|
||||
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.04-34
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
||||
|
||||
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.04-33
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||
|
||||
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.04-32
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||
|
||||
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.04-31
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||
|
||||
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.04-30
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||
|
||||
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.04-29
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
||||
|
||||
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.04-28
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||
|
||||
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.04-27
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||
|
||||
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.04-26
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||
|
||||
* Tue Oct 23 2012 Tim Waugh <twaugh@redhat.com> - 1:1.04-25
|
||||
- Fixed license tag. pnm2ppa is GPLv2+; pbm2ppa is GPLv2.
|
||||
|
||||
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.04-24
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.04-23
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
* Fri May 20 2011 Tim Waugh <twaugh@redhat.com> - 1:1.04-22
|
||||
- Don't return a local variable out of scope (bug #704568).
|
||||
|
||||
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.04-21
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||
|
||||
* Tue Oct 05 2010 Parag Nemade <paragn AT fedoraproject.org> - 1:1.04-20
|
||||
- Merge-review cleanup (#226303)
|
||||
|
||||
* Fri Mar 5 2010 Tim Waugh <twaugh@redhat.com> - 1:1.04-19
|
||||
- Consistent use of macros.
|
||||
- Removed ancient obsoletes tag.
|
||||
- Clean buildroot in install section not prep section.
|
||||
- Make setup quiet.
|
||||
- Use noreplace for config files.
|
||||
|
||||
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.04-18
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
||||
|
||||
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.04-17
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
|
||||
|
||||
* Wed Sep 24 2008 Tim Waugh <twaugh@redhat.com> 1:1.04-16
|
||||
- Removed patch fuzz.
|
||||
|
||||
* Wed Feb 13 2008 Tim Waugh <twaugh@redhat.com> 1:1.04-15
|
||||
- Rebuild for GCC 4.3.
|
||||
|
||||
* Wed Aug 29 2007 Tim Waugh <twaugh@redhat.com> 1:1.04-14
|
||||
- Added dist tag.
|
||||
- Fixed summary.
|
||||
- Better buildroot tag.
|
||||
- More specific license tag.
|
||||
|
||||
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 1:1.04-13.2.2
|
||||
- rebuild
|
||||
|
||||
* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 1:1.04-13.2.1
|
||||
- bump again for double-long bug on ppc(64)
|
||||
|
||||
* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 1:1.04-13.2
|
||||
- rebuilt for new gcc4.1 snapshot and glibc changes
|
||||
|
||||
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
|
||||
- rebuilt
|
||||
|
||||
* Wed Mar 16 2005 Tim Waugh <twaugh@redhat.com> 1:1.04-13
|
||||
- Rebuild for new GCC.
|
||||
|
||||
* Wed Feb 9 2005 Tim Waugh <twaugh@redhat.com> 1:1.04-12
|
||||
- s/Copyright:/License:/.
|
||||
- s/Serial:/Epoch:/.
|
||||
- Rebuilt.
|
||||
|
||||
* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
|
||||
- rebuilt
|
||||
|
||||
* Thu Feb 19 2004 Tim Waugh <twaugh@redhat.com>
|
||||
- rebuilt
|
||||
|
||||
* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
|
||||
- rebuilt
|
||||
|
||||
* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
|
||||
- rebuilt
|
||||
|
||||
* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
|
||||
- rebuilt
|
||||
|
||||
* Wed Nov 20 2002 Tim Powers <timp@redhat.com>
|
||||
- rebuild in current collinst
|
||||
|
||||
* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
|
||||
- automated rebuild
|
||||
|
||||
* Thu May 23 2002 Tim Powers <timp@redhat.com>
|
||||
- automated rebuild
|
||||
|
||||
* Wed Jan 09 2002 Tim Powers <timp@redhat.com>
|
||||
- automated rebuild
|
||||
|
||||
* Sun Jun 24 2001 Elliot Lee <sopwith@redhat.com>
|
||||
- Bump release + rebuild.
|
||||
|
||||
* Mon Dec 11 2000 Crutcher Dunnavant <crutcher@redhat.com>
|
||||
- Upgrade to 1.04, editied the pbm2ppa patch to add <string.h>
|
||||
- to pbmtpg.c, which uses strmp, edited the redhat patch to
|
||||
- apply cleanly.
|
||||
|
||||
* Thu Aug 17 2000 Bill Nottingham <notting@redhat.com>
|
||||
- tweak summary
|
||||
|
||||
* Thu Aug 3 2000 Bill Nottingham <notting@redhat.com>
|
||||
- build upstream package
|
||||
|
||||
* Tue Jul 11 2000 Duncan Haldane <duncan_haldane@users.sourceforge.net>
|
||||
- updated for 1.0 release.
|
||||
|
||||
* Mon Jul 10 2000 Florian La Roche <Florian.LaRoche@redhat.com>
|
||||
- remove execute bits from config file and man-page
|
||||
|
||||
* Sun Apr 09 2000 <duncan_haldane@users.sourceforge.net>
|
||||
- added optional updated rhs-printfilter files
|
||||
|
||||
* Thu Feb 10 2000 Bill Nottingham <notting@redhat.com>
|
||||
- adopt upstream package
|
||||
|
||||
* Sun Feb 6 2000 <duncan_haldane@users.sourceforge.net>
|
||||
- new pnm2ppa release, and add pbm2ppa driver.
|
||||
|
||||
* Thu Jan 6 2000 <duncan_haldane@users.sourceforge.net>
|
||||
- created rpm
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user