diff options
53 files changed, 16115 insertions, 0 deletions
@@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program 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; either version 2 of the License, or + (at your option) any later version. + + This program 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 + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/CVS/Entries b/CVS/Entries new file mode 100644 index 0000000..1beaae2 --- /dev/null +++ b/CVS/Entries @@ -0,0 +1,19 @@ +/COPYING/3.1/Mon Feb 3 16:35:19 2003//Tfoomatic-3_0-branch +/ChangeLog/3.62.2.19/Mon Dec 20 21:37:00 2004//Tfoomatic-3_0-branch +/Makefile.in/3.4.2.5/Sat Jan 24 02:16:19 2004//Tfoomatic-3_0-branch +/README/3.9.2.6/Tue Sep 14 20:16:43 2004//Tfoomatic-3_0-branch +/STANDARD_installation/1.1.4.3/Thu Jan 22 02:47:21 2004//Tfoomatic-3_0-branch +/TODO/3.1.2.2/Thu Jan 22 02:47:21 2004//Tfoomatic-3_0-branch +/USAGE/3.9.2.7/Tue Sep 14 20:16:43 2004//Tfoomatic-3_0-branch +/acinclude.m4/3.0.2.2/Thu Jan 22 02:47:21 2004//Tfoomatic-3_0-branch +/configure.in/3.7.2.6/Sun Jan 25 13:13:22 2004//Tfoomatic-3_0-branch +/filter.conf/3.3.2.2/Thu Jan 22 02:47:21 2004//Tfoomatic-3_0-branch +/foomatic-gswrapper.1.in/3.0.2.2/Thu Jan 22 03:42:35 2004//Tfoomatic-3_0-branch +/foomatic-gswrapper.in/3.4.2.3/Sat Dec 4 17:53:32 2004//Tfoomatic-3_0-branch +/foomatic-rip.1.in/3.6.2.2/Thu Jan 22 03:42:35 2004//Tfoomatic-3_0-branch +/foomatic-rip.in/3.43.2.9/Mon Dec 20 21:37:00 2004//Tfoomatic-3_0-branch +/install-sh/3.0/Fri Oct 11 01:20:44 2002//Tfoomatic-3_0-branch +/makeMan.in/3.3.2.2/Thu Jan 22 03:42:35 2004//Tfoomatic-3_0-branch +/make_configure/3.0.2.2/Thu Jan 22 02:47:21 2004//Tfoomatic-3_0-branch +/mkinstalldirs/1.1.2.2/Thu Jan 22 02:47:21 2004//Tfoomatic-3_0-branch +D/debian//// diff --git a/CVS/Repository b/CVS/Repository new file mode 100644 index 0000000..f734b23 --- /dev/null +++ b/CVS/Repository @@ -0,0 +1 @@ +foomatic-filters diff --git a/CVS/Root b/CVS/Root new file mode 100644 index 0000000..a363882 --- /dev/null +++ b/CVS/Root @@ -0,0 +1 @@ +/var/lib/cvs @@ -0,0 +1 @@ +Tfoomatic-3_0-branch diff --git a/ChangeLog b/ChangeLog new file mode 100755 index 0000000..00f6544 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,3514 @@ +2004-12-20 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Fixed bug of foomatic-rip replacing a JCL + command (ex: "@PJL HOLDKEY=1234") if another which is contained + in the first one is supplied (ex: "@PJL HOLD=STORE"). Thanks to + Jociel Cavalcante Andrade (jcainfo at inf dot ufes dot br) for + reporting the bug and testing the fix. + +2004-12-04 Chris Lawrence <lawrencc@debian.org> + + * foomatic-rip.in: Include -*- perl -*- for Emacs mode selection. + + * foomatic-gswrapper.in: Instead of testing for /dev/fd/*, use + them directly; this gets around some unreliability with + Ghostscript prefiltering that is described in Debian bug report + #271519 (http://bugs.debian.org/271519). Also include -*- perl + -*- for Emacs mode selection. + + * debian/README.Debian, debian/changelog, debian/compat, + debian/control, debian/copyright, debian/dirs, debian/docs, + debian/foomatic-filters.config, + debian/foomatic-filters.postinst, + debian/foomatic-filters.postrm, + debian/foomatic-filters.templates, debian/parseconfig.pl, + debian/po/POTFILES.in, debian/po/de.po, debian/po/fr.po, + debian/po/ja.po, debian/po/nl.po, debian/po/pt_BR.po, + debian/po/templates.pot, debian/po/tr.po, debian/rules: New + files; add Debian packaging information. + +2004-11-18 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Fixed problem of foomatic-rip crashing with + error 29 (ESPIPE = "Illegal seek") on "close STDIN;" on some + non-Linux platforms as Unixware 7.1.0, fixed problem of CUPS + page accounting PostScript code in foomatic-rip overriding + already exisiting /EndPage procedures. Added output of error + code when foomatic-rip dies. Thanks to Helge Blischke + (h dot blischke at srz dot de) for all these fixes and + enhancements. + +2004-09-14 Till Kamppeter <till.kamppeter@gmx.net> + + * *: Tagged CVS for the release of foomatic-filters 3.0.2. + Tag name: "foomatic-filters-3_0_2". + + * README, USAGE: Updated for version 3.0.2. + +2004-08-26 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: SECURITY FIX: foomatic-rip could execute + arbitrary commands as user "lp" (or however the spooler's + special user is named) on the print server. Advisory ID: + CAN-2004-0801. + + The fixes: + + - Let unprintable characters be removed from all command line + options and environment variables. + + - Let shell escape characters be removed from file names, queue + names, driver options, and some other input strings. + + - Let "open" commands for file access always use "<" or ">" to + specify reading or writing. + +2004-06-15 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Made workaround for OpenOffice.org 1.1.0 bug + being applied to all OpenOffice.org 1.1.x versions (Thanks to + Nigel Tamplin, nigel at metica dot com). + +2004-03-28 Till Kamppeter <till.kamppeter@gmx.net> + + * USAGE, foomatic-rip.in: Replaced "GIMP-Print" by "Gimp-Print". + +2004-03-26 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Fixed building of PDQ driver description file. + +2004-02-18 Till Kamppeter <till.kamppeter@gmx.net> + + * *: Tagged CVS for the release of foomatic-filters 3.0.1. + Tag name: "foomatic-filters-3_0_1". + + * README, USAGE: Updated for version 3.0.1. + +2004-01-24 Till Kamppeter <till.kamppeter@gmx.net> + + * *: Tagged CVS for the release of foomatic-filters 3.0.1rc3. + Tag name: "foomatic-filters-3_0_1rc3". + + * README, USAGE: Updated for version 3.0.1rc3. + + * configure.in: Removed the AC_OUTPUT() entry to create a Makefile + in the tests directory. + +2004-01-24 Till Kamppeter <till.kamppeter@gmx.net> + + * *: Tagged CVS for the release of foomatic-filters 3.0.1rc2. + Tag name: "foomatic-filters-3_0_1rc2". + + * README, USAGE: Updated for version 3.0.1rc2. + +2004-01-23 Till Kamppeter <till.kamppeter@gmx.net> + + * Removed some more files which do not belong into the stable + release. + + * Makefile.in, configure.in, tests/*: Removed Patrick Powells + "make test" facility, it did not work. + +2004-01-21 Grant Taylor <gtaylor@linuxprinting.org> + + * Secondary checkin, to remove/add files that changed between + branches. + + * Reverted snafu unstable code checkin introduced onto the stable + 3.0 branch on Jan 16, and present until Jan 21. + +2003-12-21 Till Kamppeter <till.kamppeter@gmx.net> + + * Makefile.in: Fixed compatibility for non-bash systems: Used + "VAR=VALUE; export VAR" instead of "export VAR=VALUE" (Thanks + to Florian Diesch <diesch@spamfence.net>). + +2003-12-01 Till Kamppeter <till.kamppeter@gmx.net> + + * configure.in, Makefile.in: Added fixes and improvements for + NetBSD compatibility. Thanks to Bruce J.A. Nourish + (bjan+foomatic-devel at bjan dot net) for this contribution. + +2003-11-22 Till Kamppeter <till.kamppeter@gmx.net> + + * README, USAGE: Updated for version number 3.1.0. + + * *: Tagged all files of the repository with "foomatic-3_0-bp", + started stable branch "foomatic-3_0-branch". + +2003-11-20 Till Kamppeter <till.kamppeter@gmx.net> + + * *: Tagged CVS for the release of foomatic-filters 3.0.1rc1. + Tag name: "foomatic-filters-3_0_1rc1". + + * README, USAGE: Updated for version 3.0.1rc1. + +2003-11-19 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in, filter.conf: Added support for CUPS raster + drivers to foomatic-rip. Now CUPS raster drivers can be used + with every spooler. + +2003-10-24 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Fixed bug of sometimes an extra blank page + being printed after the job. + +2003-10-21 Till Kamppeter <till.kamppeter@gmx.net> + + * configure.in: Added option "--disable-file-converter-check" to + disable checking whether there is a file converter installed. + +2003-10-20 Till Kamppeter <till.kamppeter@gmx.net> + + * configure.in: Added /usr/local/libexec to LIBSEARCHPATH for *BSD + compatibilty. Thanks to Sebastian Horzela (sh at horzela dot + com). + + * configure.in: For CUPS a2ps, enscript, or mpage is not needed, + here texttops of CUPS is used be default. So let ./configure + also check for texttops. + + * tests/Makefile.in: Continue testing when comparing the result of + a test with the reference file fails, give only a warning in + such a case. + +2003-10-20 Patrick Powell <papowell@lprng.com> + + * added 'use strict' and -w to the Perl options. + + * fixed a large number of undefined or out of scope variable + references discovered by the 'use strict' and -w. + + * added 'use Cwd' to get current working directory + + * Modified foomatic-rip to auto-sense the LPRng configuration. + This eliminates the need for the --lprng option, unless you want + to use it. You now set the ppd_file option in the printcap to + specify the location of the PPD file: + + lp:filter=/path/to/foomatic-rip + :ppd_file=/path/to/ppdfile + or + lp:filter=/path/to/foomatic-rip --ppd=/path/to/ppdfile \ + [options] + or + lp:filter=/path/to/foomatic-rip --lprng [options] \ + /path/to/ppdfile + (legacy documented foomatic method) + + If you specify both, the command line overrides the :ppd_file + New versions of the LPRng 'checkpc' program will check for the + presence of the :ppd_file if it is specified. + + * Modified fomatic-rip to be less 'verbose' and not put out blank + lines when used with LPRng. Changed 'dieing' to 'dying' in + error messages, as well as removing some typeos in other places. + + * Modified the configure.in, Makefile.in, and makeMan.in scripts + to use the current/latest autoconf conventions. Using + ${INSTALL} to do installation and mkinstalldirs to create + directories. Modified the configure script to NOT override the + use of sysconfdir. You can now run the configure script from a + subdirectory. This implies that your filter.conf file will now + be installed in ${sysconfdir}/foomatic/filter.conf, not in + /etc/foomatic/filter.conf. The other foomatic installation + scripts should also be modified to follow this convention. + + * The configure script now checks for at least one page converter + (a2ps, enscript, mpage) and errors if one is not installed. + + * modified the code for 'echo' to be compatible with the comments in + foomatic-rip. The filter.conf file can now set the echo program. + +2003-09-13 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: When option settings on the last page of a job + changed and the last page was read completely into the FIFO + before it was printed, the renderer was not restarted to take + into account the option changes. + + Added a new workaround for a new bug in the PostScript generated + by OpenOffice.org 1.1.0. + +2003-08-21 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Fix on PostScript code insertion for nested + +2003-08-14 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Fixed checks for CPS printer spooler. + +2003-08-01 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Fixes on JCL header merging, support for nested + composite options. + +2003-07-30 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: If a printer/driver combo has Foomatic-defined + JCL options and the driver already generates a JCL header, the + JCL options are merged into the header produced by the driver. + +2003-06-26 Till Kamppeter <till.kamppeter@gmx.net> + + * configure.in, makeMan.in, foomatic-rip.in: Support for IRIX. + + * foomatic-rip.in: Updated comments. + +2003-06-25 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Let "echo" commands in the renderer command + line being replaced by $myecho, so that printing on non-GNU + systems with user-selected GNU "echo" command works. + +2003-04-29 Till Kamppeter <till.kamppeter@gmx.net> + + * *: Tagged CVS for the release of foomatic-filters 3.0.0. + Tag name: "foomatic-filters-3_0_0". + + * README, USAGE: Updated for version 3.0.0. + + * foomatic-rip.1.in: Updated linuxprinting.org link for 3.0.0. + +2003-04-22 Till Kamppeter <till.kamppeter@gmx.net> + + * *: Tagged CVS for the release of foomatic-filters 3.0.0rc2. + Tag name: "foomatic-filters-3_0_0rc2". + + * README, USAGE: Updated for version 3.0.0rc2. + + * foomatic-rip.1.in: Added missing substitutions for special + characters in postpipe. + +2003-04-21 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: added restriction for allowed strings by means + of lists of allowed characters (PPD keyword: + '*FoomaticRIPOptionAllowedChars <option>: "..."') and Perl + regular expressions (PPD: '*FoomaticRIPOptionAllowedRegExp + <option>: "..."'). The allowed characters are checked by a + '/^[...]*$/' expression in the Perl scripts, so ranges with '-', + forbidden characters with a leading '^', or special characters + as '\w', '\d', '\x07', ... are allowed. Regular expressions are + applied via a '/.../' expression. These restrictions are done + for security reasons, to avoid for example a string like "|| rm + -rf * ||" in a command line option. + + The string 'None' is always mapped to the empty string, + as PPD files and the command of some spoolers do not accept an + empty string as argument value. + + Several bug fixes done for the string options. + +2003-04-13 Till Kamppeter <till.kamppeter@gmx.net> + + * *: Tagged CVS for the release of foomatic-filters 3.0.0rc1. + Tag name: "foomatic-filters-3_0_0rc1". + + * README, USAGE: Updated for version 3.0.0rc1. + +2003-04-12 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Introduced string and password options. + +2003-04-07 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Currently, the renderer is re-started whenever + an arbitrary option is changed from one page to the next one. + For PostScript options this is not really needed when one resets + the PostScript state from before the beginning of the page. Done + tests with saving the state before and restoring it after every + page, but this did not work as the "showpage" cannot be bracketed + by "(g)save"/"(g)restore". See Adobe's "PostScript Language + Document Structuring Convention (DSC) Specification Version 3.0" + (http://partners.adobe.com/asn/developer/technotes/postscript.html), + section 4.3, "Use of showpage" (p. 26). Problem is that "showpage", + "(g)save", and "(g)restore" are often in macros/subroutines, so + they are not easily visible so that one can easily insert option + settings or saving/restoring of the PostScript state at the correct + place. So for now inserting saving/restoring lines is commented out + in foomatic-rip and the renderer is restarted at every option + change ("optionsequal(, , , 0)") and not only after changes of + JCL or command line options ("optionsequal(, , , 1)"). + + Fixed bug of Prolog and DocumentSetup sections created by + foomatic-rip when first "%%Page: ..." is found not being added + to the PostScript header data . + +2003-04-06 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Added support for applying options only to + selected pages via the command line. Now options can be + preceeded by a page specification: + + CUPS, GNUlpr, CPS, no spooler: + lpr -o 1:InputSlot=Letterhead + lpr -o even:Watermark=on + lpr -o 1,6-10,15,20-:MediaType=YellowPaper + + LPRng: + lpr -Z 1-2:MediaType=Cardboard + + LPD: + lpr -J "1,6-10,15,20-:MediaType=YellowPaper" + + PPR (RIP): + ppr --ripopts "1:InputSlot=Letterhead" + + PPR (Interface) + ppr -i "1:InputSlot=Letterhead" + + The syntax is "even", "odd", or giving comma-separated page + numbers or page ranges. Applying options to selected pages with + PDQ is not supported. + +2003-03-22 Till Kamppeter <till.kamppeter@gmx.net> + + * *: Tagged CVS for the release of foomatic-filters 3.0.0beta2. + Tag name: "foomatic-filters-3_0_0beta2". + + * README, USAGE, foomatic-rip.1.in: Updated for version + 3.0.0beta2. + +2003-03-07 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Workaround for bug in OpenOffice.org. + OpenOffice.org puts "%%BeginSetup...%%EndSetup" section with + option settings valid for the whole document after the first + "%%Page:..." line. So without the workaround all settings made + with the "Properties" button in the "File"|"Print" dialog + applied only to the first page, the other pages were printed + with the printer's default settings. Fixed also some typos. + +2003-03-06 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Fixed bug that unreadable/missing files are not + removed from the list of files to be printed. + +2003-03-05 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Fixed bug of settings for composite options + stuffed into the PostScript job data by applications (as + OpenOffice.org) being ignored; added support for + "FoomaticRIPDefault..." keywords in numerical options (see + http://www.linuxprinting.org/pipermail/foomatic-devel/2003q1/001250.html). + +2003-02-22 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Introduced mode for the spooler CPS (Coherent + Printing System). + +2003-02-13 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Fixed bug in reading a custom page size from + the PostScript input file. + +2003-02-03 Till Kamppeter <till.kamppeter@gmx.net> + + * *: Tagged CVS for the release of foomatic-filters 3.0.0beta1. + Tag name: "foomatic-filters-3_0_0beta1". + + * README, USAGE: Updated for version 3.0.0beta1. + + * COPYING: Added file containing the GPL. + +2002-12-19 Till Kamppeter <till.kamppeter@gmx.net> + + * *: Tagged CVS for the release of foomatic-filters 2.9.1. + Tag name: "foomatic-filters-2_9_1". + + * README, USAGE: Updated for version 2.9.1. + +2002-12-09 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Introduced support for composite options. + +2002-12-08 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-gswrapper.in: If there is no /dev/fd/3, don't use + /dev/fd/3 for standard output. Use the good old "| cat >&3". + +2002-12-04 Till Kamppeter <till.kamppeter@gmx.net> + + * *: Tagged CVS for the release of foomatic-filters 2.9.0. + Tag name: "foomatic-filters-2_9_0". + +2002-12-01 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-gswrapper.in: If there is no /dev/fd/0, don't use + /dev/fd/* for standard input, standard output, and standard + error. Support of block reading from standard input ("-_" + instead of "-" on GhostScript command line), use block + reading preferrably. + + * foomatic-rip.in: Made sure that an absolute path for the PPD + file is inserted in the PDQ driver description file, suppress + log output on standard error whenn generating a PDQ driver + description file. + +2002-11-29 Till Kamppeter <till.kamppeter@gmx.net> + + * *: Tagged CVS for the release of foomatic-filters 2.9.0pre1. + Tag name: "foomatic-filters-2_9_0pre1". + +2002-11-28 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Fixed comment text. + + * filter.conf: Updated comment text. + + * USAGE: Fixed typo. + +2002-11-27 Till Kamppeter <till.kamppeter@gmx.net> + + * Makefile.in, configure.in, makeMan.in: Updated Makefile + infrastructure to let the package correctly build the man page + and link foomatic-rip into the filter directories of CUPS and + PPR. + + * foomatic-rip.in: Allow more than one occurence of the same spot + ("%A", "%B", ...) in the RIP command line prototype, so that one + option setting can act on several points of the command line + (was an old TODO point of Grant). + + * foomatic-rip.1.in: Continued working on the man page for + foomatic-rip. + + * foomatic-gswrapper.in: Fall back to "| cat >&3" and "-" instead + of "/dev/fd/3" and "/dev/fd/0", if the file descriptor directory + /dev/fd does not exist. + + * README, USAGE, TODO: Updated the package documentation. + +2002-11-26 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Added instructions for using a custom page size + to the documentation page output ("-o docs") for the PPR RIP + mode of foomatic-rip. + + * src/*.in, src/Makefile, lpdomatic.8.in, directomatic.1.in: + Removed the old spooler-specific filters, they are replaced + by foomatic-rip now. + + * Makefile.in, configure.in: Removed stuff to build the old + src/*omatic filter. + + * foomatic-rip.1.in: Added man page for foomatic-rip. + +2002-11-25 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Various fixes and adaptations to make + foomatic-rip well working together with the new + foomatic-configure: + + Support for raw queues under all spoolers and spooler-less + printing. + + When foomatic-rip is used as a PPR RIP, it accepts also options + through the new "--ripopts" option of the "ppr" command of PPR + 1.50 now. + + Accept "-o <option>=<value>" on the command line also when one + uses foomatic-rip as a PPR RIP, so one can easily set defaults + using + + ppad rip <printer> foomatic-rip x -o <option>=<value> -o <switch> + + + Fixed bug which broke renderer command lines composed from + several shell commands in debug mode. + + Read Foomatic IDs from the PPD file. + + Make default configuration file for spooler-less printing being + /etc/foomatic/direct/.config and PPD files being searched in + /etc/foomatic/direct. + + In debug mode debug logging is started in the beginning of the + parsing of the command line options, right after checking the + options relevant for logging. + +2002-11-16 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Added legacy interface for old Foomatic 2.0 PPD + files. Now foomatic-rip accepts all PPD files except the ones + for native CUPS drivers. + + Fixed output of sample command line in the help page generator, + also do not display options with only one choice on the help + page. + + Do not range check numerical options when building the command + line, we did it already when obtaining the option settings from + the command line, the PPD file, and the job data. + +2002-11-15 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Now all spoolers, including PDQ, are supported + and tested successfully. With foomatic-rip all spoolers can be + used with PPD files now, either PPD files supplied by printer + manufacturers for their PostScript printers or Foomatic (2.9.x) + PPD files. + + Added "buildpdqdriver()" function and "--genpdq"/"--appendpdq" + command line options to build PDQ driver declaration files which + call foomatic-rip for the dirty work and offer all options + available in the PPD file to the PDQ user. They accept all file + types, so PostScript and all, what the file conversion filter in + use ("a2ps", "enscript", "mpage") understands, can be printed. + + Setup of a printer under PDQ as follows: + + cp foomatic-rip /usr/bin + cp myprinter.ppd /etc/foomatic (or ~/.foomatic/) + chmod 666 /dev/lp* (or /dev/usb/lp*) + foomatic-rip -P myprinter \ + --genpdq /usr/lib/pdq/drivers/misc/myprinter.pdq + xpdq (set up the printer, right-click -> "Add Printer") + + The first three lines are the same as for spooler-less printing. + In The "foomatic-rip" line one can add options (with "-o") to + change the defaults in the PDQ driver declaration file. + + Improvements on documentation page generation: Support for "-o + switch"/"-o noswitch" for boolean options. Minor text + corrections. + +2002-11-14 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Now all spoolers (except PDQ) are tested + successfully. + + Added support for foomatic-rip running as a PPR + RIP (PPR 1.5x), before it could only run as a PPR interface. To + use it as a PPR RIP one sets up the print queue as follows: + + ln -s foomatic-rip /usr/lib/ppr/lib/ + ppad interface foo parallel /dev/lp0 + ppad ppd foo /path/to/foo.ppd + ppad rip foo foomatic-rip other x + + (the "x" in the end of the last line is needed to work around a + bug.) + + Use "PPR_VERSION" environment variable to auto-detect whether + PPR is the spooler. + + The parsing of the command line options did not work with the + Getopt::Long Perl library when using LPRng as the spooler. The + problem is that LPRng uses short options (one hyphen and one + letter) and lets the argument follow without space + ("-ZPageSize=A4"), on this Getopt::Long chokes. Replaced + Getopt::Long by a self-made method to parse the options. + + Prepared foomatic-rip for PDQ support. + + Added comment about the supported spoolers. + +2002-11-13 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: The basic functionality of foomatic-rip is now + implemented, all features of the old "*omatic" filters are also + available in foomatic-rip. + + Now text and other non-PostScript files can be printed, + foomatic-rip calles "a2ps", "enscript", or "mpage" automatically + when it detects a non-PostScript file. + + Improved command lines of "a2ps", "enscript", and "mpage" to + generate wider margins (so that nothing gets cut off) and + wrapping of too long lines (to not loose information). + + The "docs" option lets a help page being printed, independent of + the file originally sent. This works also with manufacturer- + supplied PPD files of PostScript printers. CUPS prints the + documentation page with its native "texttops" filter by default, + but this can be changed to "a2ps", "enscript", or "mpage" with + "textfilter" line in /etc/foomatic/filter.conf. + + Custom page sizes work also on manufacturer-supplied PPD files + now, + + Fixed control of quiet, verbose, and debug mode from the command + line ("-q", "-v", "--debug"). + + foomatic-rip used without spooler does not have any console + output any more (except error messages). Use the "-v" + ("Verbose") for log output on the console and "--debug" for + debug log files. + + Debugging files are now /tmp/foomatic-rip.log (log file) and + /tmp/foomatic-rip.ps (PostScript data pre-processed by + foomatic-rip, as it is stuffed into the renderer). + + When using CUPS as the spooler, lists of the command line + options with which foomatic-rip was called are only written to + the log when in debug mode, so that Mac OS X does not produce + lines for the "error_log" of CUPS which have more than 1024 + characters, as this makes CUPS aborting the job. + + Fixed PPR spooler auto-detection. Now foomatic-rip should + work as a PPR interface as ppromatic. + + Additional comments about non-PostScript and documentation + printing and also about the kid processes of foomatic-rip + and what they do. + + Minor clean-ups. + +2002-11-11 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Now it should be possible not only to use the + new (Perl-free, version 2.9.x) Foomatic PPD files with + foomatic-rip, but also manufacturer-supplied PPD files of + PostScript printers. This way one can use these PPD files with + every spooler and also spooler-less. + + The settings of "PageSize" and "PageRegion" are kept in sync + now, so on does not need to take care whether "PageSize" or + "PageRegion" is used to set the paper size. + + The "*JCL..." keywords in PostScript files of PostScript + printers are recognized, so the JCL options of the files are + taken into account and the user can adjust them. + + Remove "dossy" ("\r\n") line ends from the lines read from the + PPD file, so also PPD files downloaded under Windows should be + correctly parsed. + + Bugfix: Allow trailing whitespace in "*OrderDependency" lines of + the PPD file, for all other keywords trailing whitespace was + already allowed. + + Added more comments about the PostScript parsing, especially + about stuffing in PostScript code from command line options + and default settings. + + Workaround for "dvips" bug that it misses inserting a + "%%BeginProlog" comment. This will now be handled correctly. + + Make sure that code for default and command line option settings + get also inserted in the job when it has the DSC magic string + ("%!PS-Adobe-..") but is not DSC-conforming in reality. + + To be more general, use the expression "JCL" (Job Control + Language) instead of "PJL" (Print Job Language) for variable + names and comments. + + Some minor clean-ups. + +2002-11-10 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: Now it should be possible to print with all + spoolers, but only PostScript, no plain text or help pages. + + Added code to parse the command line options, + now one can control jobs also by command line options and not + only by stuffing settings into the PostScript file. + + Insert code of PostScript options into the appropriate sections + of the PostScript job. This is not done for CUPS as there the + "pstops" filter does it already. + + Correct option settings for numerical options which the "pstops" + already inserts. "pstops" inserts the default setting when the + user-supplied value is not one of the choices in the PPD file. + Now foomatic-rip replaces the default value by the correct value + from the command line (or from "/.lpoptions). + + Inserted page accounting code for CUPS. + + If an enumerated choice option has only one choice, set this one + as the default choice. There was no default set before. + + Support for postpipes (command line into which to stuff the + output of the renderer). + +2002-11-09 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: foomatic-rip is one filter to be used with + all spoolers now (Currently CUPS works without accounting + and spooler-less printing only to stdout and without + inserting of command line options). + + Completed spooler auto-detection and loading of queue and + job information needed for executing the job. + + Introduced loop to print more than one file per job (needed + for spooler-less printing). + + Parse definition of a postpipe (command into which output of + renderer will be piped) in the PPD file, using the syntax + '*FoomaticRIPPostPipe: "..."'. Use of the postpipe needs still + to be implemented. The postpipe is needed for LPD/LPRng/GNUlpr + and spooler-less printing. + +2002-11-07 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: foomatic-rip works also as a CUPS filter, + without any modifications and without wrapper. Accounting + and help page is not supported yet. It is planned to also use + it as filter for the other spoolers without wrapper (spooler + auto-detection). + + Made foomatic-rip also recognizing option + settings embedded in PostScript files with "dossy" line ends + ("\r\n"). + + Made it more tolerant against not exactly DSC-conforming + PostScript. as for example CUPS' "pstops" does not put page- + specific option settings between "%%BeginPageSetup" and + "%%EndPageSetup". + + Handle the problem that there can be a "%%PS-Adobe" header, but + the document is not DSC-conforming. Stop parsing when the next + DSC section is not found after a certain amount of lines. + + Parse also "%%BeginProlog", "%%EndProlog", "%%BeginSetup", + "%%EndSetup", "%%BeginFeature", and "%%EndFeature" comments so + that additional option settings can be inserted. + +2002-11-06 Till Kamppeter <till.kamppeter@gmx.net> + + * src/*omatic.pl.in: Made filters also recognizing option settings + embedded in PostScript files with "dossy" line ends ("\r\n"). + +2002-11-03 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-rip.in: "foomatic-rip", the filter to translate + PostScript input to the printer's native language using printer + capability info from a new Perl-free PPD file. It expects the + name of the PPD file in the environment variable PPD or with the + "-p" command line option and the PostScript on standard input, + the job translated to the printer's native language appears as + standard output. + + The filter recognizes DSC-conforming PostScript documents and + searches for inserted options settings at all allowed places + without loading the whole document into memory. It handles also + command line and PJL arguments given onely for certain pages, in + this case the renderer (usually GhostScript) is restarted with a + new command line and/or new prepended PJL. For + non-DSC-conforming documents only settings in the beginning of + the file are recognized. + + * Makefile.in, configure.in: Taken into account the new + "foomatic-rip" filter. + +2002-10-19 Till Kamppeter <till.kamppeter@gmx.net> + + * src/*omatic.pl.in: Support for custom page sizes. A choice named + "Custom" in the "PageSize" option is considered as custom page + size. Its "<ev_driverval>" should contain a placeholder "%0" for + the page width and "%1" for the page height (both in points). + Alternatively the "<ev_driverval>" can contain two zeros ("0") + from which the first will be replaced by the page width and the + second by the page height. PPD files will get Adobe-complient + for the custom page size support. So CUPS and the printing + dialog of Mac OS X should have no problems with the custom paper + size. Now custom paper sizes are available for all spoolers: + + CUPS: lpr -P huge -o PageSize=Custom.500x750cm bigposter.ps + LPRng: lpr -P huge -Z PageSize=Custom.500x750cm bigposter.ps + GNUlpr: lpr -P huge -o PageSize=Custom.500x750cm bigposter.ps + LPD: lpr -P huge -JPageSize=Custom.500x750cm bigposter.ps + PPR: ppr -P huge -F "*PageSize Custom" -i 500x750cm bigposter.ps + PDQ: pdq -P huge -oPageSize_Custom -aPageWidth=500 + -aPageHeight=750 -oPageSizeUnit_cm bigposter.ps + No spooler: directomatic -P huge -o PageSize=Custom.500x750cm + bigposter.ps + +2002-10-10 Till Kamppeter <till.kamppeter@gmx.net> + + * *: Set revision number of all files to 3.0. + +2002-10-09 Till Kamppeter <till.kamppeter@gmx.net> + + * README, USAGE: Updated documentation according to the splitted + packages. + +2002-10-08 Till Kamppeter <till.kamppeter@gmx.net> + + * *: Splitted Foomatic into four packages: + + - foomatic-filters: Filter scripts used by the spoolers to + convert the incoming PostScript data into the printer's + native format using a printer/driver specific PPD file + - foomatic-db-engine: Foomatic's database engine generates + PPD files from the data in Foomatic's XML database. It also + contains scripts to directly generate print queues and handle + jobs. + - foomatic-db: The collected knowledge about printers, drivers, + and driver options in XML files, used by foomatic-db-engine + to generate PPD files. + - foomatic-db-hpijs: Foomatic XML data generator for HP's HPIJS + driver. + + This package is foomatic-filters. + + * configure.in, Makefile.in: Removed all portions not needed for + foomatic-filters. + + * configure.in, Makefile.in, makeMan.in, lpdomatic.8.in, + directomatic.1.in: Made insertion of paths in man pages working + without Defaults.pm. + + * configure.in: Fixed check to set /etc instead of /usr/local/etc + as $sysconfdir. + + * mfomatic.in: This file was not maintained for long time and + noone asked for it, removed. + +2002-10-07 Till Kamppeter <till.kamppeter@gmx.net> + + * data-generators/hpijs/hpijs-printermap, + db/source/printer/HP-Business_Inkjet_3000.xml: The HP Business + Inkjet 3000 does not work with the HPIJS driver. + + * db/source/printer/122496.xml, + db/source/printer/HP-DesignJet_750.xml: Removed hint that IJS + driver has problem with large paper sizes. This is fixed. + +2002-10-06 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/opt/*: Added "largeformat-PageSize.xml" special page + size option for large format printers (drivers "dnj650c" and + "Postscript"). Now Foomatic supports paper sizes larger than A3 + with these printers. + +2002-10-05 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added the "lz11" driver entry (enhanced version + of "cZ11" for the Lexmark Z11 printer). + + * db/source/printer/*: Fixed auto-detection info of the HP Color + LaserJet 4500 and removed wrong auto-detection info from the + Kyocera FS-1200. + +2002-10-03 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added driver entry "lxm3200-tweaked", the + "lxm3200" driver modified to also support the Lexmark Z31 and + Z12. + + * db/source/printer/*: Rated the Lexmark Z31 as "Mostly" and the + Z12 as "Partially", due to the "lxm3200-tweaked" driver. + + * db/source/printer/Epson-Stylus_CX3200.xml: Changed rating to + "Paperweight" (nothing known about this device yet). + + * db/source/*/*: Fixed "stc300.upp" driver, execution information + was missing, new URL. + + * db/source/*/*: Added the Epson MJ 520C to the list of supported + printers of the "stcolor", "stcany.upp", and "stc300.upp" + drivers. It is unclear whether it works with Gimp-Print. + +2002-10-02 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Added more japanese Epson inkjets: Epson CL + 700, 750, Epson EM 900C, 900CN, 930C, 930CN, MC 2000, 7000, + 9000, MJ 520C, 5100C, 6000C, 8000C, PM 760C, 800C, 820C, 850PT, + 2200C, 3300C, 5000C, PX 7000, 9000. + + * db/source/printer/*: Added the Epson Stylus Photo 825, 1290S, + EX3, Stylus CX3200. + + * db/source/printer/*: Removed broken printer entries for the + Epson PM 760C, 770C, 800C, 820C/3300C, "Stylus PM760", "Stylus + PM820". + + * db/source/printer/*: Re-rated the Epson Stylus Photo 785, 825, + 875, 895, 915, and 925 from "Perfectly" to "Mostly" because one + cannot access the photo card readers with free software. Also + updated the text appropriately. + + * db/source/printer/Epson-Stylus_Pro*: Removed hint that IJS + driver has problem with large paper sizes. This is fixed. + + * db/source/driver/filter*, db/source/opt/jap*: Removed the + "filter*" drivers. I don't know where one can download these + drivers. + + * db/source/driver/PM*: Updated the driver entries to use the new, + correct printer entries. + +2002-10-01 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Added japanese Epson inkjets: Epson MC + 5000, 1000, PM 700C, 730C, 750C, 770C, 780C, 790PT, 880C, 950C, + 2000C, 3000C, 3500C, 4000PX, 7000C, 9000C, 10000. + +2002-09-30 Till Kamppeter <till.kamppeter@gmx.net> + + * data-generators/hpijs/hpijs-printermap, db/source/printer/*: + Bugfix: The HP DeskJet 612x printers do not support full-bleed + printing. + + * data-generators/hpijs/hpijs-printermap, db/source/*/*: Added + the HP Business Inkjet 3000, DesignJet 5500, 5500ps, LaserJet + 5100, Color LaserJet 2500, 5500. + +2002-09-29 Till Kamppeter <till.kamppeter@gmx.net> + + * data-generators/hpijs-rss/*: Added support for HPIJS patched by + Matthias Bunte and Richard Spencer-Smith (see + http://www.linuxprinting.org/download/printing/hpijs/). The + driver entry name is "hpijs-rss". + + * data-generators/hpijs/hpijs-generator: Mentioned that the + current Foomatic data is also for HPIJS 1.2.2. + + * data-generators/hpijs/hpijs-printermap, db/source/printer/*: + Added the HP DeskJet 450, 3320, 6122, 6127, PhotoSmart P230, PSC + 2150. + + * data-generators/hpijs*/hpijs*-generator: Corrected "Best + Grayscale" modes for the HP DeskJet 350, 6xxC series, and the + Apollo printers, the mode supports only 600x300 (not 300x300) + dpi and all except the DeskJet 350 and the 63xC series use + both and not only the black cartridge. + + * db/source/printer/*: Changed recommended driver to "hpijs-rss" + when it was "hpijs" before (the patched version has better + output quality). + + * db/source/printer/*: Raised ratings of all "DJ9xx"-class HP + inkjets without fax facility from "Mostly" to + "Perfectly". Updated the texts of all "DJ9xx"-class models + (because of the patched HPIJS, "hpijs-rss"). + + * db/source/printer/*: Raised ratings of the HP PPA printers + (supported by the "pnm2ppa" driver from "Mostly" to "Perfectly", + the driver supports their full functionality. + + * db/source/driver/PostScript.xml: Added link to Kurt Pfeifle's + tutorial chapter about PostScript to the text of the + "Postscript" driver entry. + +2002-09-27 Till Kamppeter <till.kamppeter@gmx.net> + + * src/cupsomatic.pl.in: Made command line option list only be + logged in debug mode. Mac OS X adds very many options to the + CUPS filter chain and so the option list gets longer than 1024 + bytes and this CUPS cannot handle in its error_log file. + +2002-09-26 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/driver/Postscript.xml: Updated text for new PPD file + download place. + +2002-09-11 Till Kamppeter <till.kamppeter@gmx.net> + + * data-generators/hpijs/hpijs-generator: The 300-dpi normal mode + for the "LJMono" device class uses 600 dpi internally and so + does not work on the 300-dpi-only printers as the HP LaserJet 4L. + Restricted these printers to use the 300-dpi draft mode which + does real 300 dpi. + +2002-08-31 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/opt/*, db/source/driver/pnm2ppa.xml: Cleaned up + options for the "pnm2ppa" driver. + +2002-08-30 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/HP-LaserJet_1000.xml: Updated text and rating + ("Partially") according to a longer posting of the author of the + "pbmtozjs" driver. + + * db/source/driver/oki4w.xml: Added additional hint about the + setup of print queues with this driver to the text. + +2002-08-29 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/driver/pbmtozjs.xml, + db/source/opt/pbmtozjs-PageSize.xml: Added driver for the + HP LaserJet 1000. + + * db/source/printer/HP-LaserJet_1000.xml: Updated text and rating + ("Mostly"). + + * foomatic-configure.in, configure.in, Makefile.in, makeDefaults.in, + USAGE: Added support for HPOJ 0.9. + + * README, USAGE: Corrected version number. + +2002-08-27 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Added the HP PSC 2110 and 2210, replaced + the HP PSC 300 by the HP PSC 370 and 380, text fixes for the + HP DeskJet 5550 and 5551, PhotoSmart 7150, 7350, and 7550, + Epson Stylus C61 and C62. + + * db/source/printer/*: Corrected/updated "Recommended driver" and + texts for Epson Stylus Photo 950, 960, 2100, 2200, Stylus Pro + 7600, 9600, and HP DeskJet 3420. + + * data-generators/hpijs/hpijs-printermap: Added HP PSC 370, 380, + 2110, 2210, removed HP PSC 300. + +2002-08-24 Till Kamppeter <till.kamppeter@gmx.net> + + * src/cupsomatic.pl.in, src/directomatic.pl.in, src/lpdomatic.pl.in: + Now option settings stuffed into the PPD files have priority + against settings done via command line options given with the + printing command. This is done to make sure that settings given + in applications (also on clients with other spooler/OS) have are + taken into account. + + * src/cupsomatic.pl.in: Numerical options give on the command line + and not being exactly of a value given as choice in the + PPD-O-Matic PPD file are now overriding the PPD defaults which + "pstops" inserts into the PostScript, but they are overridden + when an application stuffs settings into the PostScript file. + +2002-08-22 Till Kamppeter <till.kamppeter@gmx.net> + + * data-generators/hpijs/hpijs-generator, + data-generators/hpijs/hpijs-printermap: Updated to HPIJS 1.2.1, + previous file versions in data-generators/hpijs/ tagged with + "hpijs-1_2-files". + + * *: Before the update to HPIJS 1.2.1 tagged all files of the + repository with "hpijs-1_2". + + * db/source/printer/*: Switched "recommended driver" of the HP + DeskJet 400 and 420C to "hpijs", updated text and rating of HP + DeskJet 420C. + +2002-08-17 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Added the Epson Stylus Photo 830, 915, 925, + Epson Stylus C41UX, C41SX, C42SX, C61, C62, C82. + + * db/source/printer/*: Fixes on text and rating for the Epson + Stylus Color 880, 980, 8 3, C42UX, C80. + +2002-08-12 Till Kamppeter <till.kamppeter@gmx.net> + + * Makefile.in: In the "inplace" mode the line "use lib/;" and not + "use lib/Foomatic/;" must be inserted to make the scripts using + the Foomatic libraries from the source tree and not the system- + wide ones. + +2002-08-10 Till Kamppeter <till.kamppeter@gmx.net> + + * data-generators/hpijs/hpijs-generator: Given the short name + "Resolution" to the "Quality, MediaType, Ink Type" option, + so it gets accessable in the GIMP. + +2002-08-09 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Text fixes for the HP OfficeJet 6xx/7xx and + OfficeJet Pro 1175C (thanks to David Paschal for all the info). + + * db/source/printer/186729.xml: Corrected auto-detection data for + the HP DeskJet 970C. + +2002-08-08 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Adapted texts of the printer entries to the + new HPOJ 0.9 (all devices scan with SANE now and photo cards are + supported by the stable version), also corrected the address of + the SANE home page in the printer entries. Raised HP PhotoSmart + 7x50 and DeskJet 555x to "Perfectly" because full-bleed printing + works now (thanks to David Paschal for all the info). + + * db/source/printer/HP-PhotoSmart_7550.xml: Added HP PhotoSmart + 7550. + + * data-generators/hpijs/hpijs-printermap: Added HP PhotoSmart + 7550. + + * data-generators/hpijs/hpijs-[pg]*: Added full-blead support for + the HP PhotoSmart 7x50 and DeskJet 555x. + +2002-08-07 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Change the recommended drivers for + Gimp-Print-supported printers from "gimp-print-ijs" to + "gimp-print", the IJS interface of Gimp-Print has problems with + non-english locales. + + * data-generators/hpijs/hpijs-generator: Fixed bug that the old + models (HP DeskJet 6xx, Apollo) do only 600x300 dpi and not 600 + dpi in best grayscale mode. + + * db/source/opt/69.xml: Set default quality mode for the "cdjXXX" + and "chp2200" drivers to "Normal" instead of "Presentation". + +2002-08-06 Manfred Wassmann <manolo@NCC-1701.B.Shuttle.de> + + * foomatic-combo-xml.1.in: Applied Eric S. Raymonds patch. Adds + missing header and fixes typo. + +2002-07-27 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/HP-DeskJet_656C.xml: Corrected text, max. + resolution and rating. + +2002-07-24 Till Kamppeter <till.kamppeter@gmx.net> + + * src/cupsomatic.pl.in: CUPS 1.1.15 mangles the "docs" option and so + the documentation page was not printed any more. Fixed. + +2002-07-23 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/Epson-Stylus_Pro_?600*.xml: Re-arranged + entries for the Epson Stylus Pro 7600/9600 not being separate + for different ink types to fit to the Foomatic generator of + Gimp-Print. + + * db/source/printer/*: Raised the ratings of the Epson Stylus C42UX, + Stylus Photo 950, 960, 2100, 2000 from "Paperweight" to + "Partially", there is preliminary support by Gimp-Print. + +2002-07-20 Till Kamppeter <till.kamppeter@gmx.net> + + * *: Raised revision number of all files to 2.9. + + * db/source/printer/Epson-Stylus_Photo_960: Added Epson Stylus + Photo 960. + + * db/source/printer/Epson-Stylus_Photo_950: Text update. + +2002-07-19 Till Kamppeter <till.kamppeter@gmx.net> + + * README, USAGE: Foomatic version 2.0.0 (Stable branch of + Foomatic, package splitting and PPD-centric Foomatic will be + developed in head branch, version 2.9.x) + + * *: Before any further development is done, tagged all files + of the repository with "foomatic-2_0_0" and "foomatic-2_0-bp", + started stable branch "foomatic-2_0-branch". + +2002-07-18 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-combo-xml.c: Added facilities for drivers to suppress + the usage of PJL option by adding a "<nopjl />" flag to the + "<execution>" section of a driver's XML file. This can be used + for drivers which produce their own XML headers as "hpijs" and + "hl1250". + + * README: Documentation for the new "<nopjl />" flag. + + * data-generators/hpijs/hpijs-generator: Added "<nopjl />" flag to + "hpijs" driver. + + * db/source/driver/hl1250.xml: Added "<nopjl />" flag to "hl1250" + driver. + + * foomatic-perl-data.c: Let "<nopjl />" flag also be put into the + combo Perl data structure, to use it on the "Execution Details" + pages of linuxprinting.org. + + * lib/Foomatic/DB.pm: Added hint in "Execution Details" when a + driver suppressing PJL options is used with a PJL-capable + printer. + + * db/source/printer/*: Changed recommended driver of the HP + DeskJet 500, 510, 520, 500C, 540C, OfficeJet, OfficeJet LX, + OfficeJet 300, 330, and 350 to "hpijs". + +2002-07-17 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/Epson-Stylus_C42UX.xml: Added the Epson Stylus + C42UX ("Paperweight"). + + * src/cupsomatic.pl.in: Fixed bug of PostScript code for CUPS + page logging not working correctly for PostScript level 1 + files rendered by a PostScript level 2/3 interpreter. + + * data-generators/hpijs/hpijs-generator, + data-generators/hpijs/hpijs-printermap: Updated to HPIJS 1.2, + previous file versions in data-generators/hpijs/ tagged with + "hpijs-1_1-files". + + * *: Before the update to HPIJS 1.2 tagged all files of the + repository with "hpijs-1_1". + + * db/source/printer/*: Added the HP DeskJet 670TV, 843C, 916C, + 933C, 934C, 935C, and PhotoSmart P130. + + * db/source/printer/*: Text/rating updates of many HP printers due + to HPIJS 1.2. + +2002-07-15 Till Kamppeter <till.kamppeter@gmx.net> + + * src/cupsomatic.pl.in: Fixed bug of PostScript code for CUPS + page logging not working correctly on all documents and also + not working when more than one copy was requested. + +2002-07-14 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Corrected link in the entries of the + Samsung SmartGDI printers. + + * db/source/driver/gdi.xml: Mentione that the provided MagicFilter + file only works with MagicFilter 1.2. + +2002-07-10 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure.in: Fixed incompatibility with Perl 5.0.x: + "delete" could not delete array elements. Thanks to Olaf Till + (i7tiol at t-online dot de). + + * db/source/printer/*: Added auto-detection info to the HP LaserJet + 2100. Due to the 2100 and 2100M having the same auto-detection + info, they can be confused by frontends, so used "pxlmono" as + recommended driver because it works on both. + + * db/source/driver/*: Added HP LaserJet 2100M to the printer lists + of the PCL 5/6 printer drivers. + +2002-07-09 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Updated text of HP DeskJet 5550, 5551, + PhotoSmart 7150. + + * db/source/printer/HP-PhotoSmart_7350.xml: Added HP PhotoSmart + 7350. + +2002-07-06 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*, data-generators/hpijs/hpijs-printermap: Added new + HP printers: HP DeskJet 3420, 3820, 5550, 5551, PhotoSmart 7150, + Color LaserJet 4600. + + * db/source/printer/*: Re-rated Epson Stylus C20/C40 and Stylus + Color 680 to "Perfectly", added hint about head-alignment to the + Epson Stylus Photo 810/820. Text cleanup for Epson Stylus Color + 880/980. + + * db/source/printer/317321.xml: Re-rated Epson Stylus Color 480 + to "Perfectly". Cartridge change with "mtink" was confirmed. + +2002-06-26 Till Kamppeter <till.kamppeter@gmx.net> + + * README: Improvements of the description of the Foomatic XML data + structure. + +2002-06-25 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Corrected tags for PJL support in HP + printer entries. Many old LaserJets do not support PJL. + + * db/source/printer/*: Removed many "Unverified" tags from + HP printer entries. + + * db/source/printer/23104.xml: Re-rated LaserJet 2D to "Mostly", + the duplex unit is not supported, + + * data-generators/hpijs/hpijs-printermap: Added the HP DesignJet + ColorPro CAD to the printers supported by HPIJS, it is a + repackaged HP 2500C. Re-rated it to "Perfectly". + + * src/cupsomatic.in, src/lpdomatic.in, src/ppromatic.in, + src/directomatic.in, lib/Foomatic/DB.pm: Removed the usage of + the PJL commands "JOB" and "EOJ" because not all PJL-capable + printers support it. + +2002-06-22 Till Kamppeter <till.kamppeter@gmx.net> + + * README: Updated the description of the Foomatic XML data + structure. + + * USAGE: Updated for OpenOffice.org 1.0, added work-around for bug + that OpenOffice.org and Star Office do not print the Euro currency + symbol, added hint how to get PPD from remote CUPS server. + +2002-06-21 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Added the Epson Stylus Pro 7600 and 9600 + printers. + +2002-06-16 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Added the Epson AcuLaser C4000 and C4000PS. + + * db/source/*/*: Added the "alc4000" driver entry and updated the + "PostScript" driver entry for thr Epson AcuLaser C4000 and + C4000PS. + +2002-06-13 Till Kamppeter <till.kamppeter@gmx.net> + + * README: Added commented example of a Foomatic PPD with embedded + Perl data structure. + + * Foomatic-Devel-Ideas.txt: New file to collect ideas about the + further development of Foomatic. + +2002-06-12 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Added hint to the "mtink" + (http://xwtools.automatix.de/) printer maintenance tool to the + entries for the Epson Stylus Color 480/580. It allows software- + controlled cartridge changing. + +2002-06-10 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Added the Epson Stylus Photo 950, 2100, and + 2200. + +2002-06-02 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/Epson-EPL-5900L.xml: Added the Epson EPL-5900L + ("Paperweight"). + +2002-05-30 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Changed recommended driver for large-format + printers (A2 and bigger) from "gimp-print-ijs" to "gimp-print" + and added a comment. IJS cannot handle very large raster + graphics. + + * db/source/printer/Epson-Stylus_Pro_7500.xml: Raised rating to + "Perfectly", I had no problem to print booth posters for the + LinuxTag 2002 with it. + +2002-05-29 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/opt/cdj5XX-BlackCorrect.xml: Corrected weird short + name of the "BlackCorrect" option for the "cdj5xx" drivers. + +2002-05-28 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*, data-generators/hpijs/hpijs-generator, + data-generators/hpijs/hpijs-printermap: Added HP DeskJet 957C, + 959C, and 975C to the database. + +2002-05-24 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*, data-generators/hpijs/hpijs-generator, + data-generators/hpijs/hpijs-printermap: Added HP DeskJet 850C, + 855C, 870C, 890C, 1100C, OfficeJet Pro 1150C to the supported + printers of the "hpijs" driver. David Suffield, developer of + "hpijs" at HP told that they work with that driver. + + * db/source/driver/*: Corrected URLs of the drivers which come with + GhostScript (GNU GhostScript 7.05 instead of 6.51). + +2002-05-23 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Fixed URLs in several printer entries + (added missing "http://"). + +2002-05-19 Till Kamppeter <till.kamppeter@gmx.net> + + * README, USAGE: Added information that make_configure needs libxml + 2.x.Fixed some typos. + + * foomatic-fix-xml.in: Fixed initial comment. + +2002-05-18 Till Kamppeter <till.kamppeter@gmx.net> + + * data-generators/hpijs/*, db/source/*/hpijs*, Makefile.in: Included + generator script for HPIJS in the Foomatic package, the + appropriate entries are generated during the build process now. + + * Makefile.in: Added "uninstall" targets. + +2002-05-16 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/Lexmark-Z13.xml: Added the Lexmark Z13 to the + printer database. + + * db/source/*/*: Fixed HPIJS data for the HP DeskJet 825C/845C: they + do grayscale with the black cartridge and not with the color + cartridge. + +2002-05-15 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-preferred-driver.in: Updated driver priority list to + give higher priority to the old HP LaserJet/PCL drivers coming + with GhostScript than to Gimp-Print. The old drivers work better + on laser printers. + + * db/source/printer/*: Use the old GhostScript driers ("ljet4", + "laserjet", ...) instead of "gimp-print-ijs" as recommended + driver for laser printers. + +2002-05-11 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-preferred-driver.in: Updated driver priority list. + + * db/source/printer/*: Use "gimp-print-ijs" as recommended driver + where "gimp-print" was the recommended driver before. + + * db/source/driver/lm1100.xml: Added hint how to compile it with + gcc 3.1 to the description text. + +2002-05-10 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/driver/hpijs.xml: Corrected version number in "hpijs" + driver entry to be 1.1. + +2002-05-09 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added HP Business Inkjet 2230 and 2280 printers. + + * db/source/*/*: Updated HPIJS driver entries to version 1.1. + + * db/source/printer/HP-PhotoSmart_P100.xml: Raised the HP PhotoSmart + P100 to "Perfectly". + +2002-05-07 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added the printer models HP OfficeJet, OfficeJet + LX, OfficeJet 300, 330, 350, PhotoSmart. Updated driver entries + "pcl3", "hpdj", and "djet500" appropriately. + + * db/source/printer/*: small corrections on the HP DeskJet 520, + 560C, Olivetti JP450, DEC DECwriter 110i. + +2002-05-05 Till Kamppeter <till.kamppeter@gmx.net> + + * lib/Foomatic/DB.pm: Let paper size also be read from + "-dDEVICEWIDTHPOINTS=..."/"-dDEVICEHEIGHTPOINTS=...", needed for + "gimp-print-ijs" and "hpijs" drivers. + +2002-04-22 Manfred Wassmann <manolo@NCC-1701.B.Shuttle.de> + + * foomatic-perl-data.1.in: Created basic manpage for + foomatic-perl-data. + +2002-04-18 Till Kamppeter <till.kamppeter@gmx.net> + + * lib/Foomatic/DB.pm: Added some more paper sizes to the + "getpapersize()" function, according to DeviceForm.cpp on the OMNI + CVS. + +2002-04-17 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Corrected "hpijs" entry for the HP 2500C/2500CN, + they belong to the "DJ9xxVIP" group (as the HP DeskJet 990C), so + they work perfectly with "hpijs". Replaced model string "HP + BUSINESS INKJET 2250" by "DESKJET 990", the former string is + not recognized by "hpijs" (in contrary to the driver's + documentation). + + * db/source/*/*: Added the Sony IJP-V100 multi-function device. + + * lib/Foomatic/DB.pm: Added '*PSVersion: "(3010.000) 653"' entry + for GhostScript 6.53 to the PPD files. In the "getpapersize()" + function let the ISO B sizes be returned, when the paper size + name is only "Bx" without "JIS" or "ISO". This is also the + default of GhostScript. + + * Makefile.in: Fixed bug of database going to + /usr/local/share/share/foomatic. + + * foomatic-configure.in: Made "foomatic-configure -Q -q -r" + working correctly with CUPS 1.1.14. + + * Makefile.in, makeDefaults.in, configure.in, lib/Foomatic/DB.pm: + Eliminated dependency on the "libwww-perl" Perl library, used + command line tools "wget" or "curl" instead. Now Foomatic should + work only with standard Perl libraries as being part of Perl + itself. + + * USAGE, README: Added the requirement of one of the tools "wget" + and "curl". + + * db/source/driver/gdi.xml: Updates URLs. + +2002-04-16 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added HP 2000C/2500C/2500CM to the "hpijs" + driver, Removed 1200-dpi hires mode from HP Business Inkjet 22xx + models. + + * db/source/*/*: Added HP Business Inkjet 2600 + + * db/source/*/*: Text corrections on HP Business Inkjet 22xx + printers. + + * foomatic-kitload.in: Let existing files not being overwritten + unless the "-f" ("force") switch is used, improved screen + output, "CVS" subdirectories in the kit get ignored. + + * lib/Foomatic/DB.pm: In the "getexecdocs()" function apply the + "htmlify()" to all strings which are shown on the web page. + Added paper sizes for the "omni" driver to the + "getpapersizes()" function. + +2002-04-15 Till Kamppeter <till.kamppeter@gmx.net> + + * USAGE: Improvements on the installation instructions. + + * make_configure: Added a workaround for a bug in the autoconf + macros of libxml2. + + * db/source/*/*: Fixed entries for the HP 2000C/2500C/2500CM + printers. + +2002-04-14 Till Kamppeter <till.kamppeter@gmx.net> + + * configure.in, acinclude.m4, Makefile.in, Makefile, install-sh, + make_configure, makeMan.in, makeMan, makeDefaults.in, + makeDefaults, foomatic-addpjloptions.in, foomatic-addpjloptions, + foomatic-cleanupdrivers.in, foomatic-cleanupdrivers, + foomatic-compiledb.in, foomatic-compiledb, + foomatic-configure.in, foomatic-configure, foomatic-datafile.in, + foomatic-datafile, foomatic-fix-xml.in, foomatic-fix-xml, + foomatic-getpjloptions.in, foomatic-getpjloptions, + foomatic-gswrapper.in, foomatic-gswrapper, foomatic-kitload.in, + foomatic-kitload, foomatic-ppdload.in, foomatic-ppdload, + foomatic-preferred-driver.in, foomatic-preferred-driver, + foomatic-printjob.in, foomatic-printjob, mfomatic.in, mfomatic, + README, USAGE, src/cupsomatic.pl.in, src/cupsomatic.pl, + src/directomatic.pl.in, src/directomatic.pl, + src/lpdomatic.pl.in, src/lpdomatic.pl, src/ppromatic.pl.in, + src/ppromatic.pl: Introduced a GNU-autoconf-generated "configure" + script, now one can easily install Foomatic with the well-known + "./configure; make; make install". + +2002-04-12 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-ppdload: Switched foomatic-ppdload to the new + Perl-XML/Grove-free DB.pm. + + * foomatic-ppdload, foomatic-ppdload.8.in: Added "-R" option to + remove a printer from the "ppd" driver. + + * README: Removed paragraph that foomatic-ppdload needs the old + Perl-XML/Grove DB.pm. + + * lib/Foomatic/PPD.pm: Let the "PageRegion" option in the PPD file + being skipped when creating Foomatic XML data. It is te same + option as "PageSize". + + * db/source/driver/Postscript.xml: Corrected HTML tags. + +2002-04-10 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-perl-data.c: Added reading of auto-detection data also + for the USB and SNMP connection types. Added support for returning + commants and texts in other languages the english ("-l <language>" + command line option). + + * db/source/printer/HP-PSC_750.xml: Added USB auto-detection info. + +2002-04-09 Till Kamppeter <till.kamppeter@gmx.net> + + * lib/Foomatic/DB.pm: Made the "sortargs()" and "sortvals()" + functions working with Perl 5.0x. The "sort()" function of these + old Perl versions only supports the two items to compare being + given to the copmaring function via the global variables "$a" + and "$b", and not via "@_". linuxprinting.org runs Perl 5.005. + Made also the choices for the options better sorted, especially + Letter/A4 paper sizes in the beginning of the list, resolutions + and "Upper"/"Middle"/"Lower" trays correctly sorted, "Default" + in the beginning of the lists. + +2002-04-08 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-perl-data.c: New C program to parse the XML code to + generate Perl data structures from it. Uses libxml (libxml 2.x + recommended because otherwise XML files beginning with a blank + line cannot be read). + + * lib/Foomatic/DB.pm: Removed disk cache and XML/Grove Perl + library usage completely, all XML handling is done by C code + now. Added paper sizes of the Dymo-CoStar/Avery label printers + to the "getpapersize()" function, now the "ImageableArea" and + "PaperDimension" entries in the PPD files are built correctly + for these printers. Added possibility to output a combo XML file + with the option default settings set to the values of the queue + currently worked on. + + * lib/Foomatic/DB_perl_xml.pm: Stored old XML/Grove/disk cache + version of the Foomatic database library. Added documentation + for this file as comments in its beginning. + + * foomatic-configure, foomatic-printjob: Removed "grove-pathval" + expression from "use Foomatic::DB.pm" line. + + * foomatic-configure: When a printer queue is set up or modified, + the option default settings are also set in the + /etc/foomatic/<queue>.xml.gz printer/driver combo XML file. So + frontends can also read the option settings from the XML file. + + * foomatic-ppdload: Re-linked to old lib/Foomatic/DB_perl_xml.pm, + Perl-XML/Grove-free version not implemented yet. + + * foomatic-compiledb, foomatic-compiledb.8.in, + foomatic-compiledb.1.in: In the cache-less time this has a new + purpose: It generates data files for a chosen spooler (or combo + XML files) and for either selected or all drivers. Moved man + page to section 1, foomatic-compiledb works from a normal user + account now (due to the removed cache). + + * foomatic-datafile.8.in, foomatic-datafile.1.in: Moved man + page to section 1, foomatic-datafile works from a normal user + account now (due to the removed cache). + + * foomatic-fix-xml: Remove leading blank lines from the XML files + in the local Foomatic database. The leading blank lines make the + XML files not readable by libxml 1.x. + + * Makefile: Added compilation and installation of + foomatic-perl-data.c. + + * Makefile, makeDefault: Commented out all cache-related stuff. + + * Makefile: Moved foomatic-datafile and foomatic-compiledb from + /usr/sbin to /usr/bin. + + * README, USAGE: Foomatic version 1.9 (Foomatic without + Perl-XML/Grove and without disk cache). + + * db/source/*/*: Replaced all occurences of a cross character + (used in resolutions as "600x300 dpi") by an "x" (the letter + "X"). libxml chokes on the cross. Removed leading blank lines + from the XML files, because this breaks libxml 1.x. + +2002-04-03 Till Kamppeter <till.kamppeter@gmx.net> + + * lib/Foomatic/DB.pm: Added new paper sizes of Gimp-Print to the + paper size table of the "getpapersize" function, fixed a bug of + wrong calculation of "wXXXhYYY" and "XXXxYYY" paper sizes in the + same function. + +2002-03-29 Till Kamppeter <till.kamppeter@gmx.net> + + * src/ppromatic.pl: Made ppromatic also working in non-english + configurations. + +2002-03-28 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/HP-LaserJet_12?0.xml: New user report + for the LaserJet 1200/1220. + + * db/source/*/*: Added new Kyocera models: FS-1000+, FS-1010, + FS-1800, FS-1900, FS-3800, FS-9100DN, FS-9500-DN. + + * db/source/driver/stp.xml: Added warning that this file is only + for Gimp-Print 4.0.x. + +2002-03-27 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-combo-xml.c: Added possibility to modify the default + option settings in the generated XML ("-o" command line option + for foomatic-combo-xml). + +2002-03-26 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/153056.xml: Updated text of the HP DeskJet + 340C according to a new user report. + + * db/source/*/*: Added Lexmark Z83 multi-function device. + +2002-03-24 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/HP-LaserJet_12?0.xml: LaserJet 1200/1220 is + very slow in graphics, added user report. + +2002-03-21 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Updated text of all HP printers and + multi-function devices which need HPOJ or the modified printer.c + kernel module to be able to print via USB. + + * db/source/printer/*: Updated text of the HP PhotoSmart 1[012]xx + printers because they need the modified USB printer.c kernel + module from the HPOJ website to work together with HPOJ. + + * db/source/*/*: Added the Okidata OL400e, HP OfficeJet D125, and + HP LaserJet 3310 MFP and updated the driver data appropriately. + + * db/source/*/*: Removed spaces from the names of the Okidata + OLxxx models, so that they get correctly sorted in the printer + listings. Modified option entries appropriately. + +2002-03-20 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Updated text of many HP and Apollo printers + and moved many of them from "Mostly" to "Perfectly". + + * db/source/printer/*: Updated text of HP OfficeJet G and K series + because they need HPOJ also when one only wants to print via + USB. + + * db/source/*/*: Added the Apollo P-1220 Barbie, P1250, P2250, + P-2550, and P-2650. Updated the driver data appropriately. + +2002-03-19 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Updated data for the "hpijs" driver to fit + to HPIJS 1.0.4. Modified printer entries appropriate to the new + features ("hpijs" also recommended on large format printers, + DeskJet 990 and compatibles work "Perfectly"). + +2002-03-18 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Modified text of HP LaserJet 1200, USB + printing only works with HPOJ. + +2002-03-17 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-combo-xml.c: Introduced two debug output levels ("-v", + "-vv"). Now I do not need a special debug version any more. + +2002-03-17 Manfred Wassmann <manolo@NCC-1701.B.Shuttle.de> + + * makeDefaults: Added flag $DEBUG to enable debug messages from + Perl modules. It is not exported by default, you can import it + by adding qw(:DEFAULT $DEBUG) to the "use Foomatic::Defaults" + clause. + + * lib/Foomatic/DB.pm: Cache is disabled if CACHEDIR is set to an + empty string at compile time, ie. "make CACHEDIR=". + +2002-03-17 Manfred Wassmann <manolo@NCC-1701.B.Shuttle.de> + + * debian/*: Docs README, TODO, USAGE were not included in the + debian package. + Changed handling of local changes by the debconf interface. + +2002-03-16 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Modified text of HP LaserJet 31x0 + multi-function devices, because of the available code pieces for + a free software driver for these models. + +2002-03-14 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Corrected entries for Brother printers + driven by the "hl7x0" driver. + +2002-03-12 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Fixed default "Quality" setting for the photo- + capable HP DeskJet 6xxC printers with the "hpijs" driver. + +2002-03-09 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Fixed Foomatic data for the B4 and B5 paper sizes + of the "hpijs" driver. + * db/source/*/*: "Photo Full Bleed" paper size is only supported by + the PhotoSmart P100 for the "hpijs" driver, fixed Foomatic data. + +2002-03-08 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added the Canon BJC-255SP and BJC-265SP. Modified + "bjx250gs" driver entry appropriately. + +2002-03-07 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure: When "foomatic-configure" creates a queue + for LPRng, the permissions for the /var/log/lp-errs file are set + correctly now. + +2002-03-05 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added Lexmark E210 laser printer (Samsung ML-4500 + clone, "gdi" driver). + + * foomatic-configure: Fixed bug that of float options in + PPD-O-Matic PPD files only the integer part of the default value + was read. + + * foomatic-gswrapper: Fixed Red Hat bug #58319 + (https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=58319). + Some PostScript files cannot be handled by "gs ... - < file", + but they need "gs ... /dev/fd/0 < file". + + * lib/Foomatic/DB.pm: Fixed quoting for PDQ, now more complicated + driver command lines with quotes and shell script variables also + work with the PDQ-O-Matic config file generator. Assured that for + every call of GhostScript "foomatic-gswrapper" is used, to fix + Red Hat bug #58319 for all drivers, especially "Postscript". + + * src/*omatic.pl: Assured that for every call of GhostScript + "foomatic-gswrapper" is used, to fix Red Hat bug #58319 for all + drivers, especially "Postscript". + +2002-03-04 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added new HP multi-function devices: HP OfficeJet + D135, D145, D155, LaserJet 3300 MFP, 3320 MFP, 3320N MFP, 3330 + MFP. Updated driver and option entries appropriately. + + * db/source/*/*: Fixed default driver for HP LaserJet 6P, added + HP DeskJet 610CL to the "hpijs" driver, fixed text for the + HP DeskJet 1125C. + + * src/lpdomatic.pl: Replaced "if ( @pjlprepend > 0 )" by "if ( + @pjlprepend > 1 )" so that PJL headers are only used when really + a PJL options is there. Many printers are listed as PJL-capable + in the database, but in reality they are not. + +2002-03-03 Till Kamppeter <till.kamppeter@gmx.net> + + * src/cupsomatic.pl, src/ppromatic.pl: Fixed reading default option + choices with a "+" from the PPD file. + +2002-03-02 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Fixed the entry for the Brother MFC-9600, it does + 600 dpi with the "hl1250" driver. + +2002-03-01 Till Kamppeter <till.kamppeter@gmx.net> + + * src/cupsomatic.pl: Disabled accounting for the "Postscript" + driver, it leads to an extra blank page coming out with every + job. + + * db/source/*/*: Added Canon S100, S200, S300, S500, S630, + BJC-2110, Lexmark Optra C710, HP DeskJet 200, DeskJet 841C, + Okidata Okipage 14ex, OL400, Xerox Able 1406, Anitech M24, + Citizen printiva600U, printiva700, printiva1700, Alps MD-2010, + MD-2300, MD-5500. Added these printers to the appropriate driver + entries. + + * db/source/*/*: Added the "ppmtomd" driver for MicroDry (Alps MD, + Citizen printiva, Okidata DP) printers. + + * db/source/*/*: Set "hpijs" as the recommended driver for all + printers supported by this driver. + + * db/source/*/*: Raised Lexmark Z53 from "Paperweight" to + "Perfectly", it is compatible to the Z52. + +2002-02-20 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Updated Foomatic data for the "hpijs" driver to + version 1.0.3. + +2002-02-18 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/driver/lj5*: Removed HP LaserJet 6P, it does not work + with the "lj5gray"/"lj5mono" drivers. + +2002-02-13 Manfred Wassmann <manolo@NCC-1701.B.Shuttle.de> + + * debian/{control,rules} Added Debconf interface to manage + filter.conf. + + * debian/foomatic-bin.{config,templates,postinst} New files needed + by debconf. + +2002-02-09 Manfred Wassmann <manolo@NCC-1701.B.Shuttle.de> + + * lib/Foomatic/DB.pm: Check if existing cache file is empty. + + +2002-02-06 Tim Waugh <twaugh@redhat.com> + + * lib/Foomatic/DB.pm: Cache files created by "foomatic-combo-xml" + were not read sometimes, fixed. + +2002-02-05 Till Kamppeter <till.kamppeter@gmx.net> + + * Makefile: Added "remove_trash" target to remove temporary and + backup files created by editors and the patch utility. In + "testing_clean" target added "-f" to the "rm" command for the + links to the cache so that make does not stop with an error when + the links are not there. + +2002-02-04 Till Kamppeter <till.kamppeter@gmx.net> + + * Makefile, src/*omatic, filter.conf: Modified Foomatic to only + make the filter scripts out of the source files in src/. Fixed + bugs on filter script source files: "enscript -b <title>", not + "enscript -b=<title>"; empty title gave a line on the top of the + page when using "mpage". Added "-J" (job title) option to + directomatic. Added sample filter.conf. + + * cupsomatic, ppromatic, lpdomatic, directomatic: Removed obsolete + filter scripts. + + * directomatic.1.in: Added "-J" (job title) option. + +2002-02-03 Till Kamppeter <till.kamppeter@gmx.net> + + * USAGE: Corrected link for the "ptal" CUPS backend script. + +2002-02-03 Manfred Wassmann <manolo@NCC-1701.B.Shuttle.de> + + * src/Makefile: Make generated scripts executable. + +2002-02-03 Manfred Wassmann <manolo@NCC-1701.B.Shuttle.de> + + * debian/rules: Set LPRNG_CONF=/etc/lprng/lpd.conf. + + * src/lpdomatic.pl: Integrated changes from lpdomatic 1.10. + Overwrite PATH in INPLACE version too. Changed revision to 2.1 + to avoid $lomversion clashes with the old scripts. + + * src/cupsomatic.pl, src/directomatic.pl, src/ppromatic.pl: + Bootstrapped from corresponding filter scripts. + + * src/Makefile: cupsomatic, directomatic and ppromatic get also + built. + +2002-02-02 Till Kamppeter <till.kamppeter@gmx.net> + + * Makefile, makeDefaults, foomatic-configure, USAGE, README: Added + support for HPOJ (http://hpoj.sourceforge.net/, low-level driver + for HP's multi-function devices) with "ptal:/..." URIs. + +2002-01-31 Tim Waugh <twaugh@redhat.com> + + * lib/Foomatic/DB.pm (get_overview_xml): Create directory, like + get_overview_grove does. Also fixed quoting. + +2002-01-30 Manfred Wassmann <manolo@NCC-1701.B.Shuttle.de> + + * lpdomatic: Corrected the path to the configuration file. + +2002-01-29 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-kitload, foomatic-kitload.8.in: Added "-d" option to + install the kit into a staging area from which a package will + be built (as "DESTDIR=..." in GNU automake/autoconf). This is + a patch from Roger Leigh. + + * makeDefaults: Added the possibility to set the cache directory + alternatively with FOOMATIC_CACHEDIR instead of CACHEDIR. + + * cupsomatic, ppromatic, lpdomatic, directomatic: Modified parser + for options embedded in the job data so that option and value + names can contain all printable characters except white space + and "=". This fixed a problem with the "Color Mode" option of + the "pcl3" driver. + +2002-01-28 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added the HP LaserJet 3P with PCL5 extension. + +2002-01-27 Till Kamppeter <till.kamppeter@gmx.net> + + * USAGE: Minor text modifications for XPP 1.1. + + * db/source/*/*: Renamed the database entry for the Canon LIPS-II+ + from "Canon-LIPS-II+" to "Canon-LIPS-IIplus". With the "+" in its + ID the printer entry was not accessible on the linuxprinting.org + web site. + +2002-01-24 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-gswrapper: Replaced "-sOutputFile=|cat>&3" by + "-sOutputFile=/dev/fd/3" to make foomatic-gswrapper working with + all versions of GhostScript, of the shell, and of Unix. + +2002-01-24 Manfred Wassmann <manolo@NCC-1701.B.Shuttle.de> + + * foomatic-configure.1.in: Corrected manpage section in header. + * foomatic-kitload.8.in: Filled some gaps. + * lpdomatic.8.in: Describe how to print the docs. + * src/lpdomatic.pl: PJL patch from Tim Waugh. Can select one of + the builtin enscriptcommands by setting textfilter to "a2ps", + "mpage" or "enscript" (without arguments). + * debian/rules: Cleanup database. + +2002-01-23 Manfred Wassmann <manolo@NCC-1701.B.Shuttle.de> + + * src: Introduced the subdirectory. + * Makefile: Include a target to make the filter scripts from src/. + * src/lpdomatic.pl: New source file from which lpdomatic can be + generated. + * src/Makefile: Builds lpdomatic from src/lpdomatic.pl. + +2002-01-22 Till Kamppeter <till.kamppeter@gmx.net> + + * lpdomatic: Cleaned up user-editable settings part. + +2002-01-21 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/opt/160.xml: Added Epson EPL lasers to constraint in + "Mode" option of "pxlmono"/"pxlcolor", they print only in bw. + + * db/source/printer/*: The Epson EPL-5900/5900PS works perfectly + with "pxlmono", updated text, rating, and recommended driver. + + * db/source/printer/*: Raised the rating for the Lexmark Z42 and + Compaq IJ1200 to "Mostly", to reflect the experience of the + author of "drv_z42" with these printers. + + * db/source/printer/*: Corrected the ratings/texts for the Epson + Stylus Pro 7000/7500/9000/9500/10000. + + * lpdomatic/makeDefaults: Modified the config file support to not + need a Perl library to make it easier to install lpdomatic without + installing the whole Foomatic package. + +2002-01-20 Till Kamppeter <till.kamppeter@gmx.net> + + * lib/Foomatic/DB.pm: Added '*PSVersion: "(3010.000) 652"' entry + for GhostScript 6.52 to the PPD files. + +2002-01-20 Manfred Wassmann <manolo@NCC-1701.B.Shuttle.de> + + * lpdomatic: Corrected the use of ConfigFile.pm. + * makeDefaults: Write "1;" at the end of ConfigFile.pm. + * foomatic-configure: Added $J to lprng filter options, (prints + job title with a2ps). + * makeDefaults: Added code to write lib/Foomatic/ConfigFile.pm. + * lpdomatic: Adds --center-title=$optJ to a2ps command line. + Enscriptcommand and debug flag can be specified in a config file + in $ETCDIR/filter.conf. Syntax is tag\s*:\s*value. + Added tabulator/indentation settings for emacs. + +2002-01-18 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/Epson-AcuLaser_C1000.xml: Added the Epson + AcuLaser C1000 (Paperweight). + + * db/source/*/*: Applied a patch by Tim Waugh (twaugh at redhat + dot com) which makes the Perl one-liners for paper tray + selection on PCL laser printers working on both Perl 5.6.0 and + 5.6.1. The one-liners are in the GhostScript command lines of + the drivers entries for the PCL laser drivers ("lj5gray", + "ljet4", ...). + + * db/source/printer/*: Updated text of the Epson EPL-5900/5900PS + because of a bug in Epson's driver. + +2002-01-17 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Added new Epson laser printer models: + EPL-5900, EPL-N2120. + + * db/source/*/*: Added new driver entries "epl2120" and "epl5900" + for Epson-Kowa laser driver 1.0.4. + +2002-01-16 Till Kamppeter <till.kamppeter@gmx.net> + + * cupsomatic, lpdomatic, ppromatic, directomatic: Auto-detection + of file converters a2ps, enscript, mpage, usage of the printer's + paper size setting for conversion to PostScript, with a2ps the + possibility to print also PDF, images, etc with LPD/LPRng and + with directomatic (CUPS and PPR do this by themselves, they use + the converter only for the docs pages). + + * foomatic-configure: Fixed bug of "-Q" with PPR not working for + non-root users. CUPS queues are automatically set up with + PPD-O-Matic PPD files now (use "--oldppd" to get CUPS-O-Matic + PPD files), for PPD the PPD file is not stored twice any more, a + symbolic link is set instead. + + * README, ChangeLog, foomatic-configure.1.in: Updated documentation + to take into account the new "--oldppd" option. + + * db/source/*/*: HP removed the "HP only" clause from the license + of HPIJS, so HPIJS is free now. + +2002-01-15 Till Kamppeter <till.kamppeter@gmx.net> + + * lib/Foomatic/DB.pm: Fixed some incompatibilities in the PDQ file + generator which prevented HPIJS 1.0 from working with PDQ. + +2002-01-14 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure: Fixed bug of foomatic-configure stopping on + directomatic printer configuration when there is no directomatic + config file. + +2002-01-13 Till Kamppeter <till.kamppeter@gmx.net> + + * cupsomatic/ppromatic: The PPD default values of float options were + not read correctly, fixed. + +2002-01-12 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added HP e-printer e20 to HPIJS 1.0 datafiles. + + * db/source/printers/*: Removed "Unverified" flags and cleaned up + text in many datafiles of HP inkjet printers. + + * foomatic-preferred-driver: Only set new default driver when the + current one is not OK. + + * foomatic-configure: Insert ":ppdfile=<PPD file name>:\" lines + into /etc/printcap (for LPD/GNUlpr/LPRng), so that the graphical + printing frontend GPR finds the PPD-O-Matic PPD files + automatically. + +2002-01-11 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added "bjc250gs" driver and Canon BJC-250ex + printer. + +2002-01-10 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-gswrapper: Replaced "-sOutputFile=|cat >&3" by + "-sOutputFile=|cat>&3" because the second one also works when + "gs" is a wrapper script around the real GhostScript binary. + +2002-01-09 Till Kamppeter <till.kamppeter@gmx.net> + + * cupsomatic: Numerical options given on the command line were + ignored when using a PPD-O-Matic PPD file for the CUPS queue. + Fixed. + +2002-01-08 Till Kamppeter <till.kamppeter@gmx.net> + + * Makefile, makeDefaults, lpdomatic.8.in: Moved lpdomatic back to + /usr/sbin. + +2002-01-06 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure: Added support for direct, spooler-less + printing with directomatic, added auto-detection of PPR. + + * directomatic: Added support for having a default printer. + + * foomatic-datafile: Added "lprng" as possible datafile type (gives + the same result as "lpd"). + + * foomatic-configure.1.in: Completed the list of possible options, + corrected "-D" options ("Default", not "Delete"). + + * foomatic-printjob.1.in: Corrected command line for printing. + + * README, USAGE: Updated to take into account all recent changes. + +2002-01-06 Manfred Wassmann <manolo@NCC-1701.B.Shuttle.de> + + * foomatic-configure: Bails out if it encounters a lprng style + printcap, like those created by lprngtool, as it would hose it + otherwise. This needs a better solution. + * foomatic-configure.1.in: Added description of the above problem. + * debian/control: The conflict with the cupsomatic-ppd package is + indicated. + +2002-01-05 Till Kamppeter <till.kamppeter@gmx.net> + + * Makefile, makeDefaults: Added definitions for PPR and for + spooler-less printing. + + * db/source/driver/Postscript.xml: Updated the text to also + mention that PPD files can be used also with the PPR spooler or + the GPR printing frontend. + +2002-01-04 Till Kamppeter <till.kamppeter@gmx.net> + + * ppromatic: Made ppromatic stuffing the PostScript code of all + PostScript options into the job, in contrary to CUPS PPR only + stuffs in the code of options explicitly given on the command + line or in the "Switchset". + + * foomatic-configure: Added PPR support. + +2002-01-03 Till Kamppeter <till.kamppeter@gmx.net> + + * ppromatic: Made it possible to have PPD files in other + directories than /usr/share/ppr/PPDFiles, let ppromatic eat up + data on STDIN to make documentation printing ("-i docs") working + correctly. When original job is not completely read, PPR does + not dequeue the print job and stops the printer because it + assumes that the job was not correctly printed. + +2002-01-02 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added Compaq IJ1200 (Z42 clone), assigned Lexmark + 5700 drivers to Compaq IJ900 (5700 clone). Fixed text of Lexmark + 5700. + + * db/source/opt/hpijs-Quality.xml: Fixed typo in human-readable + text for 600-dpi-CMYK-normal quality. + +2002-01-01 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/opt/hpijs-PageSize.xml: Worked around a bug in HPIJS + 1.0 which breaks the paper size setting via PostScript commands. + + * lib/Foomatic/DB.pm: Added photo paper sizes for the HPIJS 1.0 + driver to the "getpapersize()" function. + +2002-01-01 Manfred Wassmann <manolo@NCC-1701.B.Shuttle.de> + + * debian/rules: see debian/changelog for details. + +2001-12-31 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/driver/*.xml: Updated URLs of the home pages for the + "cZ11" and "c2070" drivers. + +2001-12-30 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/Epson-EPL-5800L.xml: Added the Epson EPL-5800L + laser winprinter. + +2001-12-23 Manfred Wassmann <manolo@NCC-1701.B.Shuttle.de> + + * debian/foomatic-bin.manpages: Corrected section for lpdomatic + manpage. + * lpdomatic.1.in: Made this manpage useful. + * foomatic-gswrapper.1.in: Minor editing. + +2001-12-20 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/hpijs*: Updated the entries for the "hpijs" driver + to the new 1,0 release. + + * db/source/printer/*: More updates on the comments of the HP + inkjet printers. + +2001-12-19 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Updated comments and "Recommended driver" + settings of the HP/Apollo printers for the new "hpijs" 1.0 + version. + +2001-12-18 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Added/modified HP inkjets for the "hpijs" 1.0 + driver. + +2001-12-17 Till Kamppeter <till.kamppeter@gmx.net> + + * lib/Foomatic/DB.pm: Applied a patch from Crutcher Dunnavant + (crutcher@redhat.com) which sets all Perl variables in shell + command lines ($poid, $drv. $libdir, ...) into single quotes, so + that nothing breaks when a strange printer/driver ID or a + strangely named directory is used. + + * db/source/driver/*: Made Perl one-liner for paper tray selection + in PCL laser printer driver XML files less memory-consuming. + +2001-12-16 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/Minolta-PagePro_1100L.xml, + db/source/printer/642674.xml: Added the Paperweight "Minolta + PagePro 1100L". + +2001-12-14 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure: Made "-f" (Force compilation) flag working + for overview request ("-O"). + + * lib/Foomatic/DB.pm: Functions using "foomatic-combo-xml" check + the cache before and use it, if appropriate files + available. Printer ID set into single quotes in the + "foomatic-combo-xml" command line, to not break with the new + clear text printer IDs (Thanks to Crutcher Dunnavant, + crutcher@redhat.com for his suggestions). + + * Makefile: Let "make install" also install the man pages. + +2001-12-13 Till Kamppeter <till.kamppeter@gmx.net> + + * directomatic: Possibility to use a printer definition file in + ~/.foomatic/direct/ or in the current directory. + + * Makefile, makeDefaults: Added /etc/ppr directory, fixed typo. + +2001-12-12 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Set links for the new location of the + "Lexmark Foomatic Kit" in the comments of the database entries + for the Lexmark Z22, Z23, Z32, Z33, Z52, Z53. + +2001-12-11 Till Kamppeter <till.kamppeter@gmx.net> + + * lib/Foomatic/DB.pm: Made the "PaperDimension", "ImageableArea", + and "PageRegion" entries in CUPS and generic PPD files working + if the "PageSize" option is not the standard PostScript option, + but a command line option or something else (as in the + "ppmtocpva" or in the "pentaxpj" drivers. + + * db/source/opt/2.xml, db/source/driver/c2050.xml: Drivers + "c2050", "cZ11", and "cZ11somsom" had no "PageSize" option, + fixed. + +2001-12-11 Manfred Wassmann <manolo@NCC-1701.B.Shuttle.de> + + * directomatic.1.in manpage added. + + * debian/: Bugfixes in the Debian specific files. + +2001-12-10 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Updated home page address and comment of the + "lm1100" driver and added a "Brightness" option to that driver + and replaced the "Monochrome" option by "Ink Type". + + * db/source/drivers/lpstyl.xml: Re-hosted "lpstyl" driver on + linuxprinting,org, original home page is dead. Modified the + comments in the database entry file appropriately. + + * db/source/drivers/gdi.xml: Added filter for MagicFilter users to + easily integrate this driver. Modified the comments in the + database entry file appropriately. + + * db/source/*/*: Okipage 6w only works with "oki4w" 2.0, not with + 2.1. Modified the comments in the database entry files + appropriately. + + * db/source/printers/214153.xml: My Stylus Color 500 has problems + with Gimp-Print 4.2. Modified the comments in the database entry + files appropriately. + + * db/source/opt/cZ11somsom-*: Set default values of the ink + densities to 50 instead of 100. + + * db/source/driver/cZ11somsom.xml: Corrected command line to make + printing with the black cartridge working. + + * db/source/printer/89152.xml: Comments cleaned up for Canon + BJC-2000. + + * db/source/printer/Canon-BJC-2010.xml: New printer entry: Canon + BJC-2010. + + * db/source/driver/bjc600.xml, db/source/opt/6.xml: Added Canon + BJC-2010 to the "bjc600" driver. + + * db/source/printer/Canon-BJ-100.xml: New printer entry: Canon + BJ-100. + + * db/source/driver/bj200.xml: Added Canon BJ-100 to the "bj200" + driver. + + * db/source/printer/123584.xml: Added comments about the problems + with the Xerox DocuPrint XJ8C. + + * db/source/printer/Pentax-PocketJet*: Added the ultra-portable + printers from Pentax. + + * db/source/*/pentaxpj*: Added "pentaxpj" driver for the + ultra-portable Pentax PocketJet printers. + +2001-12-09 Till Kamppeter <till.kamppeter@gmx.net> + + * cupsomatic: Added support for the accounting facility of CUPS. + Only works with $debug = 0 and when GhostScript is rendering + the PostScript. + + * foomatic-ppdload, lib/Foomatic/PPD.pm: "new PPD" and "new + UIElem" replaced by "new Foomatic::PPD" and "new + Foomatic::UIElem", otherwise the "new" methods will not be found + in the respective libraries. + + * db/source/printer/Lexmark-Z43.xml: Updated the comments. + +2001-12-07 Till Kamppeter <till.kamppeter@gmx.net> + + * directomatic: New filter for spooler-less printing. See in the + comments in the beginning how to use it. + + * Makefile: Added definitions for PPR, added directomatic + and ppromatic to be installed + + * makeDefaults: Added definitions for PPR, moved lpdomatic to + /usr/bin + + * lpdomatic.1.in: lpdomatic in /usr/bin => "man 1 lpdomatic" + + * foomatic-datafile: Added "direct" data file type for + Direct-O-Matic + + * lib/Foomatic/DB.pm: Modified comments of the LPD-O-Matic printer + description file (generated by the function "getlpddata()") + because these files are also used for Direct-O-Matic. + +2001-12-07 Manfred Wassmann <foomatic@NCC-1701.B.Shuttle.de> + + * Makefile: Split the install target into install-bin and + install-db. Added PHONY target to mark targets not related to + real files. + * Manpages: Added a script to generate manpages with correct + pathnames from files named <manpage>.<section>.in. + Created more or less useable manpages for all binaries. + * debian: Bootstrapped a debian directory for building Debian + packages. + +2001-12-06 Till Kamppeter <till.kamppeter@gmx.net> + + * cupsomatic: Corrected link to documentation web page in the + comments in the beginning of the script. + +2001-12-04 Till Kamppeter <till.kamppeter@gmx.net> + + * cupsomatic, lpdomatic, ppromatic: Cleaned up multi-processing, + now the parent processes wait for their children to finish and + the interprocess communication pipes are closed after use. The + main process waiting for their children to exit fixes especially + a problem of lpdomatic: LPRng resetted the printer port when the + lpdomatic was ready, but in reality lpdomatic sub-processes were + still working on the job, which lead to incomplete pages being + printed (Bug #486096 on SourceForge). Also updated the comments + in the beginning of the files + + * foomatic-datafile: Added PPR support. + + * foomatic-configure: Added the "-w 1" option to "nc" used in the + $postpipe for LPD, otherwise "nc" only exits a rather long time + after all data has be transmitted to the printer. This prevents + the new lpdomatic from exiting immediately after the job has + finished and so it takes a longer time until the next job + starts. + + * lib/Foomatic/DB.pm: Used "/PageSize[...]" instead of + "/PageRegion[...]" in the "*PageRegion" option of the + PPD-O-Matic PPD files becasue GhostScript does not understand + "/PageRegion[...]" (found this out during tests of PPR, which + uses the "*PageRegion" option and not the "*PageSize" option to + set the paper size. + +2001-12-02 Till Kamppeter <till.kamppeter@gmx.net> + + * ppromatic: Completed first version of ppromatic: Added error and + signal handling. Introduced back channel from child processes to + main process and let main process wait until all children finish, + to not loose any error message or exit status to report to PPR. + +2001-11-30 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added some comments about the similarity of the + Sharp and Xerox inkjets. + + * db/source/opt/207.xml: Made "Model" option of "pcl3" having only + the correct model entry as possible choice (as "Model" option of + "gimp-print"/"stp". + +2001-11-29 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-preferred-driver: Higher priority for "pcl3" against + "sharp.upp", the support of the "pcl3" driver for the Sharp and + Xerox inkjets is much better since version 3.3 of "pcl3". + + * db/source/*/*: Added Sharp/Xerox printers to list of printers + supported by "pcl3" because of better Sharp/Xerox support by + "pcl3" version 3.3, also changed the recommended driver of the + Sharp and Xerox inkjets to "pcl3" and the functionality to + "Mostly". + +2001-11-24 Till Kamppeter <till.kamppeter@gmx.net> + + * ppromatic: Interface for the spooler PPR (ppr.sourceforge.net) + introduced. To set up printer download PPD-O-Matic PPD file from + your driver's page of the linuxprinting.org database (or use + "foomatic-datafile -t ppd ...") and do + + cp ppromatic /usr/lib/ppr/interfaces/ + cp <downloaded ppd file> /usr/share/ppr/PPDFiles/ + ppad interface <queue> ppromatic <address> + ppad options <queue> backend=<interface> + ppad ppd <queue> <ppd file without path> + (Addiyional command to set up paper trays) + + <interface> means the PPR interface name for the desired printer + connection type (all in /usr/lib/ppr/interfaces/: parallel, + serial, tcpip, lpr, smb, atalk, ...). + <address> means the printer address as needed by the interface + (/dev/lp0 for parallel, printer.domain.com:9100 for tcpip, ...) + <ppd file without path> is the name under which you have saved + your downloaded PPD file. Do not specify the path + /usr/share/ppr/PPDFiles/ + +2001-11-23 Till Kamppeter <till.kamppeter@gmx.net> + + * cupsomatic: Let numerical option default settings in be used + when a printer is used with a PPD-O-Matic PPD file. + +2001-11-22 Till Kamppeter <till.kamppeter@gmx.net> + + * lib/Foomatic/DB.pm: Made HTML display of how to invoke a driver + working correctly with the new XML Foomatic and enhanced it, + especially for tricky command lines ("Execution Details" pages). + + * db/source/opt/*: Corrected the "Required" state for many + options, to get the "Execution Details" pages correct. + +2001-11-21 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/drv_z42: New web site for "drv_z42". + +2001-11-20 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Set "Recommended driver" field + (<driver>..</driver>) in all non-Paperweight printer entries. + +2001-11-19 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: The Epson Stylus C70/C80 do 2880x1440 dpi + under free OS. Added comment in the appropriate database + entries. + +2001-11-18 Till Kamppeter <till.kamppeter@gmx.net> + + * README, USAGE: Added info about the PPD-O-MATIC PPD files. + Especially USAGE contains info about printing with graphical + interfaces and out of applications now. + +2001-11-16 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-preferred-driver: Added the "sj48" driver in the list, + so that when one adds "omni" as the last entry, the "sj48" will + get priority. + +2001-11-15 Till Kamppeter <till.kamppeter@gmx.net> + + * cupsomatic: Added support for GPR as CUPS printing frontend. + + * db/source/*/*: Added Lexmark Z43 (supported by "drv_z42" + driver), corrections on Lexmark Z42. + +2001-11-14 Till Kamppeter <till.kamppeter@gmx.net> + + * lib/Foomatic/DB.pm: Added generation of a generic purpose PPD + file (PPD-O-Matic), made generated PDQ scripts using settings + added by an application using the PPD file, fixed bug of PDQ not + printing when driver command line is composed of various shell + commands. Removed some replacements of special characters in the + generation of PDQ config files, they caused some driver command + lines to get "overquoted" characters. + + * cupsomatic, lpdomatic: Added support for the new generic PPD + files, jobs are searched for settings done by applications using + these PPD files. + + * foomatic-datafile: Added "-t ppd" option to generate generic PPD + files. + + * foomatic-configure: Now for every queue a generic PPD file is + created and maintained as /etc/foomatic/<queuename>.ppd. + + * db/source/driver/oki4w.xml: Comments updated for oki4linux 2.1 + + * db/source/*/*: Resolution of Okidata OL 410e fixed (300 dpi only + with "ljet4", RedHat bug #43120). + +2001-11-13 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/driver/*: Added "-Mutf8" to the "perl" calls in the + command line of the PCL/PCL-XL laser printer drivers with tray + selection, otherwise Perl 5.6.0 and older cannot handle hex + representations of binary strings in the Perl commands. + +2001-11-08 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/opt/*: Fixed default resolutions for the "eps9mid" and + "eps9high" drivers. + +2001-11-07 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/opt/*: For the Epson laser printer drivers (EPL, + AcuLaser) fixed forgotten default values for MediaType and + default input tray for the colour models. + +2001-10-29 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Perfect support for the Epson Stylus + C70/C80 with Gimp-Print 4.1.99b4. + +2001-10-23 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Changed the comments/ratings of the Epson + AcuLaser colour printers according to results of tests at Epson + Paris. + + * foomatic-preferred-driver: Given priority to the "alcXXXX" + drivers on Epson color inkjets, they print in color. + +2001-10-22 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Added comment about up/download of data to + the photo cards in the card reader of the HP PhotoSmart + printers. + +2001-10-20 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/630066.xml, db/source/driver/*: Removed + duplicate entry for the HP DeskJet Plus. + +2001-10-16 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added the Epson Stylus Photo 820. + +2001-10-15 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added the HP OfficeJet R65 and R80 printers. + + * db/source/*/*: Added more Samsung SmartGDI/PassThru printers: + Samsung ML-1010, 1020, 200, 210. + +2001-10-13 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Some newer Epsons (Stylus Photo 785, 875, 895) + are USB only, corrected database entries. + +2001-10-11 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Re-rated Epson Stylus C60 and Epson Stylus Scan + 2500 as "Perfectly" supported. + + * USAGE: Fixed text, "postpipe", not "backpipe". + +2001-10-10 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Removed HP LaserJet 6L from "lj5gray"/"lj5mono" + drivers, this combo is reported not to work. + + * db/source/printer/*: Changes on the text of the HP LaserJet 5L, + 5P, and 6L printers. + +2001-10-09 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added Samsung SmartGDI/PassThru printers: Samsung + ML-1000, 1200, 1210, 1220, 5080, 6040. + + * db/source/*/*: Modified the Foomatic data for the "drv_z42" driver + to fit to version 0.3 of the driver. + + * db/source/*/*: Assigned drivers to the HP PhotoSmart P100 printer. + +2001-10-08 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/Epson-Stylus_C[78]0.xml: Changed rating from + "Paperweight" to "Partially", Gimp-Print 4.1.99b3 provides + preliminary support. + + * db/source/*/*: Added HP DeskJet 1120C to the printers supported + by the "hpijs" driver. + +2001-10-06 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added the printers HP LaserJet 1000, DeskJet + 845C, 940C, PhotoSmart P100, P1115, P1315. + + * db/source/*/*: Corrected URLs for the HP inkjet printers. + + * db/source/opt/hpijs-PageSize.xml: Added A6 and Photo paper sizes + for the "hpijs" driver, + +2001-10-04 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-combo-xml.c: Added an "#include <stdlib.h>" to make + the code working on IA64. + +2001-10-03 Till Kamppeter <till.kamppeter@gmx.net> + + * README, USAGE: Updates on the documentation. + + * db/source/*/*: Fixes on the "cljet5" driver. + + * db/source/*/*: Added options to the drivers "cdj500", "cdj550", + "pj", "pjxl", "pjxl300", "declj250", and "dj505j". + + * db/source/driver/*: Updated links to the GhostScript web pages. + + * foomatic-preferred-driver: Correction for the DEC LJ250. + +2001-10-02 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added paper tray selection to all the other PCL + laser printer drivers. Bugfixes on paper tray selection for the + "ljet4" driver. + + * db/source/*/*: Added "cljet5c" driver (Color LaserJet 5 in + Contone mode). + + * db/source/*/*: Added "ljet4d" driver ("ljet4" with PCL Duplex). + + * foomatic-preferred-driver: Updated for the new drivers. + +2001-10-01 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added paper tray selection option to the PCL-XL + drivers ("lj5gray"/"lj5mono", "pxlmono"/"pxlcolor") and to the + "ljet4" driver. + +2001-09-29 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added driver "drv_z42" for the Lexmark Z42, + re-rated the printer as "Partially" supported. + + * lib/Foomatic/DB.pm: Assured that the "PageSize" option is always + present in CUPS PPD files, evwn when it has only one choice, + CUPS does not work when there is a PPD file without "PageSize" + option. + + * foomatic-combo-xml.c: Replaced an "strcat" by an "strcpy" when + setting the default value for an option because otherwise there + appear two values in the string for the default value. + + * db/source/*/*: Added GhostScript pre-filtering facility to the + "Postscript" driver, this allows to use additionally installed + GS fonts or converting to a lower PostScript level. + +2001-09-28 Till Kamppeter <till.kamppeter@gmx.net> + + * lib/Foomatic/DB.pm: Made all file creation be done with "umask + 0002", so that the cache can be deleted by anyone in the group + of the cache creator. + + * db/source/*/*: Added Foomatic data for the Epson Stylus Color + 640 UPP files which come with GhostScript 6.50 and newer. + + * db/source/printer/HP-DesignJet_750.xml: Corrected bug in printer + ID, which prevented entry from showing up correctly on + www.linuxprinting.org. + +2001-09-27 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added the Lexmark Z82. + + * db/source/*/*: Made the "pbm2l7k" driver not needing 120 MB swap + with GS 6.x and newer. + + * db/source/*/*: Added Foomatic data for the UPP files + "s400a1.upp" and "s400b1.upp". + + * db/source/printer/123776.xml: Corrections in the text about the + BJC-8200. + + * db/source/printer/Canon-S600.xml: Added the Canon S600. + + * db/source/*/*: Added Foomatic data for the UPP files for the + Canon BJC-8200 which come with GhostScript 6.50 or newer. + + * db/source/driver/pcl3.xml: Fixed typo. + +2001-09-26 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-combo-xml.c: In the "loadfile()" function "close" was + used instead of "fclose". This kept all files open and lead to + problems with more than 1000 printer models. + + * db/source/*/*: Added the Xerox DocuPrint N4512, corrected comments + for the HP PSC 950 and the Epson Stylus C80. + +2001-09-25 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-preferred-driver: Given priority to the lxm3200 driver + against Gimp-Print/stp, the support of the Lexmark 3200 by + Gimp-Print is broken. + +2001-09-24 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-combo-xml.c: Fixed a bug of not setting the high scores + for the constraints. + +2001-09-22 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure: "checkpc -f" after any change on an LPRng + system. LPRng refuses to print when one file has wrong + permissions. + +2001-09-13 Till Kamppeter <till.kamppeter@gmx.net> + + * cupsomatic: Made the "sides" (Duplex) option of CUPS working + with printers using Foomatic. + + * foomatic-configure: SIGHUP to LPRng daemon when setting the + default printer or deleting one. + +2001-09-12 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Added the Lexmark Z23, Z33, and Z53 + + * db/source/printer/486066.xml: The Lexmark Z12 does not print + ain text + + * db/source/printer/328553.xml: With the current Gimp-Print the + Lexmark Z52 works "Perfectly". + + * db/source/printer/*: Updated and corrected text of the Lexmark + Z23, Z33, and Z52. + + * db/source/printer/62720.xml, db/source/driver/lj5*: The HP + LaserJet 5L does not work with the lj5gray/lj5mono drivers. + + * cupsomatic: All enumerated options with choices "On", "Off", + "Yes", "No", "True", or "False" did not work with CUPS. This is + fixed now. + +2001-09-03 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure: Possibility to set a system-wide default + printer for all spoolers, for CUPS and PDQ, non-root users can + also set a personal default printer. Due to the architecture of + LPD a queue named "lp" will be renamed when another queue is set + as the default queue. + + * Makefile, makeDefaults: Added the "lpoptions" utility of CUPS + which is needed to set a remote printer as default or to set + a personal default printer for non-root users. + + * USAGE: Added information about the new default printer setting + facility. + + * README: Adapted to all recent changes. + + * TODO: Removed the topic about speed and memory consumption, this + is solved by foomatic-combo-xml.c now. + +2001-09-02 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-combo-xml.c: Added functionality for generating the + overview XML file ("-O" option). Makes the overview XML + generation much faster, less than a second on most machines. + + * lib/Foomatic/DB.pm: Let the overview XML generation be done + preferrably by foomatic-combo-xml.c. + + * Makefile: Added the removal of the foomatic-combo-xml binary + to the "clean" section, let foomatic-preferred-driver be + installed in /usr/sbin. + + * foomatic-preferred-driver: Bugfix: Often default driver entries + were not inserted into the printer XML file. + + * db/source/driver/ppmtocpva.xml: Added the Alps MD-1500 printer. + +2001-08-29 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Several fixes on the comments of the HP + OfficeJets. + + * db/source/*/*: Added the Apple LaserWriter 4/600. + + * db/source/printer/605074.xml, db/source/printer/609714.xml: + Correction: The HP LaserJet 5Si and 3200se support PJL. + + * db/source/driver/lj5gray.xml: Removed duplicate entry for the + HP LaserJet 5Si. + +2001-08-28 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-combo-xml.c: C program to build XML files for + printer/driver combos, around 600 times faster than the perl + routines in lib/Foomatic/DB.pm (one Gimp-Print combo in 0.5-1.5 + sec. foomatic-compiledb in a few minutes), needs less than 10 MB + of memory. Pre-building of the database for distros not needed + any more. + + * lib/Foomatic/DB.pm: Make foomatic-combo-xml.c being preferrably + used for building printer/driver combo data. + + * Makefile, makeDefaults: Integration of foomatic-combo-xml.c. + +2001-08-26 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/driver/*: Removed printer entry 207945 from the printer + list of the "laserjet" and "stp" drivers, the printer was deleted. + +2001-08-25 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/HP-DesignJet_750.xml: added HP DesignJet 750, + it is supported by Gimp-Print now. + +2001-08-24 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added a whole bunch of japanese printers and + drivers, thanks to Crutcher Dunnavant from Red Hat. + + * db/source/driver/md2k.xml: Added the Alps MD-1500. + + * foomatic-preferred-driver: Priorities for the japanese drivers. + + * db/source/*/*: Corrected driver names for Epson's colour lasers. + +2001-08-23 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Added the recent Epson laser printers: Epson + EPL-5800, EPL-N1600, EPL-N2050, EPL-N2050+, EPL-N2750, AcuLaser + C2000, C8500. + + * db/source/printer/Brother*: Small adjustments of the entries. + + * db/source/printer/*: Added the new Epson lasers to the drivers + "Postscript", "pxlmono", "lj5gray", "lj5mono", "cljet5". + + * db/source/*/*: Added the Epson laser printer drivers provided + by Epson: "epl5800", "epl2050", "epl2050p", "acl2000", "acl8500". + + * foomatic-preferred-driver: Epson laser printer drivers. + + * db/source/printer/641170.xml: Removed duplicate entry for the + Canon LBP-800. + +2001-08-21 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/*/*: Added new Brother printers: HL-1440, H:-1450, + HL-1470N, HL-2460, HL-2460N, HL-2400CeN, HL-3400CN, MFC-P2500. + + * db/source/*/*: Added some more Brothers to the hl1250 driver. + + * db/source/opt/207.xml, db/source/opt/208.xml: Corrected default + settings for the Apollo P-1200 with the pcl3 driver. It needs + the the model setting "Unspecified old model" and a CMY colour + mode. + + * db/source/driver/hpijs.xml, db/source/opt/hpijs-Model.xml, + db/source/opt/hpijs-Quality.xml, db/source/printer/413737.xml: + The Apollo P-2200 works with drivers for the HP DeskJet 612C, + taken this into account. + + * db/source/printer/Okidata-ML_32?.xml, db/source/driver/okiibm.xml: + Added the printers Okidata ML 320/321. + + * db/source/printer/63200.xml: Added comment to the IBM 4019. + + * db/source/printer/317321.xml, db/source/printer/607474.xml: + Added instructions how to change the cartridges without needing + special software. + + * db/source/printer/24832.xml: Added useful info about the NEC P6 + plus. + + * db/source/driver/epsonc.xml: This driver is needed to print on + the NEC PinWriter P6/P6 plus in colour. + + * foomatic-preferred-driver: Given priority to the "necp6" driver + against the "epsonc" because in most cases the NEC PinWriter P6 + is used without colour add-on. + + * db/source/*/*: Fixed bug in hpijs driver data: The docs talk about + "DJ6xxP" for the "DeviceName" setting for photo-capable DeskJet + 6xx models, in reality "DJ6xxPhoto" has to be used. + + * db/source/driver/sharp.upp.xml: Explained how to install + "sharp.upp". + +2001-08-20 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/337577.xml: Duplicate entry for the HP OfficeJet + G55, deleted. + + * db/source/printer/Sharp*: Added the printers Sharp AJ-1805, + AJ-2005, and AJ-2100. + + * db/source/printer/*: Updated the entries for the Xerox DocuPrint + M750 and M760, they print with "sharp.upp" and are both partially + working. + + * db/source/driver/sharp.upp.xml: Added the new Sharp printers + (AJ-1805/2005) and the Xerox DucuPrint M750/M760. + + * db/source/driver/hl1250.xml: Updated the URL of the driver's home + page. + + * db/source/driver/hl1250.xml, db/source/opt/53.xml: Removed the + "Model" option from the "hl1250" driver, the GhostScript option + "-sDEVICE=hl1240" or "-sDEVICE=hl1250" only determines the + default resolution which is anyway overridden by Foomatic. + + * db/source/opt/161.xml: The media source selection for the + "Postscript" driver only works for HP printers, restricted to HP. + +2001-08-19 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/printer/*: Added HP and Apollo printers: Apollo P-2100, + P-2150, HP DeskJet 816C, 980C, e-printer e20, PhotoSmart P1215, + P1218, OfficeJet K60, K80, V40, PSC 300, 750. + + * db/source/*/hpijs*: Updated the data for the inkjet driver of HP + ("hpijs"). + + * db/source/*/DJ*: Deleted the old data of the HP driver (drivers + "DJxxx"). + + * db/source/*/*: Updated all information about the multifunction + devices of HP, they are all capable for scanning with free + software. + + * db/source/printer/641138.xml: Duplicate entry for the Canon + LBP-800, deleted. + + * db/source/printer/207945.xml: Duplicate entry for the HP LaserJet + 2, deleted. + + * foomatic-preferred-driver: Added new "hpijs" driver. + +2001-08-17 Till Kamppeter <till.kamppeter@gmx.net> + + * Makefile: Moved foomatic-configure from /usr/sbin to /usr/bin. + + * db/source/printer/Epson-Stylus_C[24]0*: Split up the entries for + the Epson Stylus C20/C40 into the SX and UX models. This is needed + for the Gimp-Print GhostScript driver. + +2001-08-16 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure: Support for printers on NetWare (with LPD + and LPRng), output of the printer list both as root and normal + user, LPRng SIGHUP after adding a new queue, spooler detection + bug fix. + +2001-08-11 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure: Fixed bug of options not being conserved + when changing parameters of a CUPS or PDQ printer. $olddatablob + was defined at the wrong place. Added paths for rlpr, nc, and + smbclient to Defaults.pm, so these commands can also be called + when foomatic-configure is running in an environment without + $PATH, for example during the installation of a distro. + + * Makefile, makeDefaults: Paths for rlpr, nc, and smbclient added. + +2001-08-05 Till Kamppeter <till.kamppeter@gmx.net> + + * db/source/opt/ppmtocpva-solidblack.xml: Added option "-solidblack" + to "ppmtocpva" driver, it is new in the version 1.0 of the driver. + + * db/source/printer/168201.xml: Corrected the resolution of the + Citizen Printiva 600C. + + * db/source/driver/ppmtocpva.xml: Added the old Alps MD models to + the printers supported by the "ppmtocpva" driver. + +2001-08-01 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-cleanupdrivers: Removes all driver entries without + command line (<prototype>..</prototype>) from a local Foomatic + database. So frontends do not display "unusable" printer/driver + combos. + + * foomatic-preferred-drivers: Simple program which adds a + <driver>..</driver> entry to every printer. The best driver is + determined by a ranking. When one deletes all XML files for + drivers which are not available on the system (and adds XML files + for additional drivers) all printers will have the best driver + of the current system as preferred driver. + + * lib/Foomatic/DB.pm: Exported "get_overview" for + foomatic-preferred-drivers. + + * db/source/*/*: Added the newest inkjets of Epson and the newest + lasers of HP: Epson Stylus C20, C40, Epson Stylus Photo 785, + 875, 895, Epson Stylus Pro 10000, HP LaserJet 1200, 1220, 2200, + 3200m, 4100, 8150, 9000, HP Color LaserJet 4550. + + * db/source/*/*: Corrected driver list for the HP LaserJet 3200se, + it is the same as for the HP LaserJet 3200 now. + + * db/source/driver/bjc600.xml: Removed the Canon BJC-5000 from the + list of supported printers, it is a paperweight for sure. + + * db/source/printer/474354.xml: Removed this extra entry for the + Canon BJC-85. It was a relict of the time when the database was + publicly editable. + +2001-07-29 Till Kamppeter <till.kamppeter@gmx.net> + + * lib/Foomatic/DB.pm: Take preferred driver (<driver>..</driver> + tag) into thw overview listing (overview.xml, foomatic-configure + -O). + + * db/source/opt/69.xml: Made the "Normal" quality with the "cdj880" + driver available again for all printers. With GNU GhostScript + 6.51 it works without problems. + +2001-07-25 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure: When one uses the -P option with a printer + and a driver to obtain the datablob of this combo, one can also + supply a queue to apply the default options of that queue to the + datablob of the chosen combo. This can be used when one wants to + change the driver used for a queue with the help of a + frontend. The obtained datablob can be used to generate the + option dialog in this situation. + + * lib/Foomatic/DB.pm: The option and choice value arrays are + sorted now (by a standard option list, by the "normalizename" + function which is already used for printer names on the web + site, and alphabatically/case-insensitive), so in XPDQ, KUPS, + QtCUPS, XPP, the upcoming new printerdrake (Mandrake 8.1), and + other frontends the options and choices will appear sorted. + +2001-07-21 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure: Added the possibility to copy/clone queues, + now queues can be transferred to another spooler conserving all + settings, including the default option settings. Restructured + all queue query functions, now they can also generate complete + Perl datablobs with all option default settings (even settings + which XPDQ has written into /etc/pdq/printrc or which KUPS has + written into the PPD files) and all queue settings as the + connection URI, description, location, ... (in the new + 'queuedata' field). This facility can be used by graphical + frontends. Now foomatic-configure also supports to be called + unser different names and to load the default spooler choice + from a file. + +2001-07-20 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure: Restructured all queue setup functions, now + it is possible with all the spoolers to modify queues by only + supplying the items which are changed on the foomatic-configure + command line. One can even delete the description or location + entries or switch from a queue with driver to a raw + queue. Default settings for options do not get lost when one + changes the driver and the new driver has options with the same + name. Also option settings done with the "native" tools of CUPS + and PDQ do not get lost on any kind of manipulation done with + foomatic-configure. Extra Perl datablob files removed to avoid + problems with maintaining redundant data repositories. Datablobs + are now in the main config files (they were already there for + CUPS and LPD/LPRng, for PDQ they are addad now. Output of + datablobs for frontends will be done by a special command line + option. The query functions are cleaned up now. + + * lib/Foomatic/DB.pm: Added Perl datablob to the PDQ datafiles, + added a line break to the end of all "die" and "warn" messages + to clean the error message output. + +2001-07-19 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-printjob: Fixed command line option translation when + printing with PDQ (numerical options). + + * foomatic-configure: XML-Combo data in /etc/foomatic is gzipped + now (compression factor 10), Perl datablobs with the + user-supplied default option settings are stored in + /etc/foomatic, too (gzip factor 8). They serve for frontends to + get the available options and make it easier to transfer the + queues without loss of option settings. + Setup function for LPD/LPRng restructured, it allows modifying a + queue only supplying the information which changes on the + foomatic-configure command line. One can even change the driver + and all default settings of options with the same name in the + old and the new driver are conserved. + + * lib/Foomatic/DB.pm: Fixed help page of PDQ (numerical options). + +2001-07-18 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-printjob: Links named "lp", "lpr", "lpq", "lprm", and + "lpc" to the foomatic-printjob executable can be made and the + program does the action of the appropriate command when called + through one of the links, job list ("lpq") output of LPRng + filtered so that it comes out in the same form as the job + listings of the other spoolers, possibility to save a default + spooler. + +2001-07-17 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-printjob: Added all missing job listing and job removal + functions. Added functionality for advanced queue and job + control. Updated help message. + + * Makefile: Added CUPS commands for queue and job control. + + * makeDefaults: Added CUPS commands for queue and job control. + +2001-07-16 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-printjob: Added job listing (query) and job removal + functions for PDQ. Added job listing function for LPD. Added + line breaks at the end of all "die" calls so that the line + number is not shown when the program executes the appropriate + "die", + + * foomatic-configure: Added line breaks at the end of all "die" + calls. + +2001-07-15 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-printjob: Coomand line options which are not used by + foomatic-printjob are passed to spooler-specific printing + command, Support for printing multiple copies with PDQ, printer + queue can also be specified with the "-d" option. + +2001-07-14 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-printjob: Exit status of the spooler's printing command + is passed back to the user as the exit status of + foomatic-printjob, GNU-lpr (VA-Linux) is auto-detected and the + options are passed appropriately. Clean-up of the help message + (option -h). + + * foomatic-configure: Support for setting default options, help + message cleaned up. + +2001-07-13 Till Kamppeter <till.kamppeter@gmx.net> + + * lib/Foomatic/DB.pm: Removed backquote from the boolean option + example in the PDQ help page. It broke the shell script for + printing the page. Preliminary fix for foomatic-configure not + exiting when building combo data with the Gimp-Print Foomatic + data installed: Flushing memory cache during build after + treatment of every option. + + * foomatic-printjob: Fixed option handling, + + * foomatic-configure: Set automatically a search path to + /etc/foomatic/pdq into the /usr/lib/pdq/printrc file, so that + the Foomatic driver description files are found. + +2001-07-11 Till Kamppeter <till.kamppeter@gmx.net> + + * Makefile: The INSTALLPREFIX facility was broken. Fixed. + + * USAGE: Added user instructions. + + * README: Pointed to new USAGE file + +2001-07-05 Till Kamppeter <till.kamppeter@gmx.net> + + * sharp.upp: New driver for the Sharp AJ-1800/2000 inkjet printers + +2001-07-02 Till Kamppeter <till.kamppeter@gmx.net> + + * Makefile: Added foomatic-printjob to the user programs to be + installed + +2001-07-01 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure: Now the combo XML data and not only the + printer data is stored in /etc/foomatic for every queue, the + "-X" option allows also getting combo data by supplying both a + printer and a driver, the logfile for the LPD/LPRng queues, + /var/log/lp-errs is touched now when a queue is added, so that + it is made sure that it exists. + + * foomatic-printjob, Makefile, makeDefaults: First sketch of + foomatic-printjob: Now one has basic printing functionality with + options on all spoolers. + +2001-06-30 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure, Makefile, makeDefaults: PDQ support added: + Now we have a command-line-based administration interface for + PDQ and the basic functionality of foomatic-configure is + completed. Fixed bug in help message of foomatic-configure. In + LPD "rlpr" is only used for remote LPD queues with filter, for + raw queues the "rm" and "rp" tags in the /etc/printcap file are + used. + +2001-06-29 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure: Added LPRng support (without + magicfilter). The support is done by adding the differences + between LPD and LPRng in the functions for handling LPD. Fixed + autodetection of LPRng (typo). +2001-06-29 Till Kamppeter <till.kamppeter@gmx.net> + + * lpdomatic: Fixed: The documentation page did not show the + correct lpr command line example for LPRng and when lpdomatic + does not find the printer driver description file (*.lom) it did + not put the file name into the error message. + + * Makefile: Removed comment that LPRng is not supported yet. + +2001-06-28 Till Kamppeter <till.kamppeter@gmx.net> + + * lib/Foomatic/DB.pm: Fixed several bugs in the function + getpdqdata(): PostScript/PJL options were not prepended to the + job data/the GhostScript output, let the choice names be + <option>_<choice> and not only <choice>, because in PDQ one + provides only the choice name and not the option name and the + choice name on the command line. So options with the same choice + names (as "Duplex" and "Manualfeed" on the LaserJet 4050 with + "ljet4" driver, which have both "On" and "Off" as choices) are + ambiguous, added "docs" option to print documentation page with + PDQ, fixed boolean options, they were broken. Text file printout + done with "mpage" now. + + * cupsomatic, lpdomatic: Fixed bug of "This option corresponds to + a PJL command" not appearing on documentation page (option + "docs"). + +2001-06-27 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure: Query function for CUPS, corrected bug in + function dump_config where the <queue ...> tag was closed by + </foomatic>, fixed query function for LPD, so that it supports + all backend types, remote LPD printing under LPD done with + "rlpr". + + * Makefile, makeDefaults: Added /etc/cups/printers.conf. + +2001-06-26 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure: Support for adding/modifying and removing + CUPS queues (for all backends supported by CUPS). + + * cupsomatic: Parsing of options embedded in the document + fixed. For accessing the value of an enumerated option $avalue + instead of $value was used, so the values read into $value were + not inserted into the option list. Search the first 1000 lines + for options because after polling the PJL options from a printer + or with a PostScript printer with many features in its PPD file + the 100 lines can easily be exceeded. + + * lpdomatic/cupsomatic (common part): The support of PJL option is + marked by the existence of the "pjl" key in the Perl data set of + the printer/driver combo. So "if (defined($dat->{'pjl'}))" and + not "if ($dat->{'pjl'})" has to be asked to check PJL support. + +2001-06-25 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure: Support for adding CUPS queues (all queue + types supported by "lpadmin"). Bugfixes in queue setup for LPD: + Make directories before the backend script for raw queues is + written to there, Rename old $etcfile and $etcxfile also when + one sets up a raw queue. + + * Makefile, makeDefaults: Set default paths and file names for CUPS, + let cupsomatic be installed in the CUPS filter directory. + +2001-06-24 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-configure: Now one can configure all types of + LPD queues automatically: local USB/parallel, remote + LPD/SMB/Socket. In addition one can define a queue which pipes the + output into an arbitrary command or a raw queue. Bugfix: Removed + colon after "q" (="quiet") in "getopts()" line. Introduced "-f" + (="force") flag of foomatic-datafile. + + * lpdomatic (bugfix): In lpdomatic the + prepending of PJL options is suppressed for non-PJL printers. + + * Makefile (bugfix): Added foomatic-*pjloptions, moved + foomatic-configure to admin programs. Fixed links of the pcache + and compiled directories in /var/cache/foomatic to + /usr/local/share/foomatic/db, before the printer combo was always + recompiled. + +2001-06-21 Till Kamppeter <till.kamppeter@gmx.net> + + * Makefiles: Allowed the possibility to install the Perl libs with + another prefix than the rest of the files. So installation is also + possible when Perl does not search for libraries in /usr/local. + +2001-06-20 Till Kamppeter <till.kamppeter@gmx.net> + + * Bugfixes: foomatic-configure could not delete queues, makeDefaults + set a wrong path for lpdomatic, Makefile missed a "make" in + the process of installing the Perl libraries. + +2001-06-16 Till Kamppeter <till.kamppeter@gmx.net> + + * PJL options can be added to the Foomatic data now: + foomatic-getpjloptions retrives them from the printer, + foomatic-addpjloptions generates XML datasets from them. + +2001-04-01 Grant Taylor <gtaylor@linuxprinting.org> + + * Various renaming has happened. Instead of 'PHTDBPUB', it's + Foomatic::DB. Foomatic::Defaults exports the libdir et al into + you, and the flock of companion modules represent other mostly + internal code. + + * Rearranged all the code; now there's a proper Perl module, in + theory at least, in Foomatic/, and the toplevel Makefile + supports this. There's also 'make testing', for a run-in-place + setup. + +2001-03-14 Grant Taylor <gtaylor@linuxprinting.org> + + * Minor updates to reflect website postgres->xml conversion. + +2001-03-10 Grant Taylor <gtaylor@linuxprinting.org> + + * Added section="??" attribuge to arg_postscript. Now it's clear + where the Postscript snippets should be placed in the document. + OTOH, the filters haven't even absorbed Crutcher's DocumentSetup + patch, nevermind support for other locations. And JCL still + isn't handled. Or ppd constraints. Or queries. Etc. + + * Fixed Till's bug wrt empty options being left out. Also fixed a + few other subtle bugs in ppd parser and foo option generator. + + * Small updates to Makefile; it might work again. Note that it + modifies the scripts in place before installing, which will + cause confusion if you attempt further work in place. + + * Added foomatic-kitload, which imports source data subsets into + the local data library. + +2001-03-07 Grant Taylor <gtaylor@linuxprinting.org> + + * Various additional checks and things when doing combo ops in + hopes of avoiding horribly mysterious error messages. + + * Implemented foomatic-ppdload. It might even work(tm). + +2001-03-06 Grant Taylor <gtaylor@linuxprinting.org> + + * Made dump_db strip out illegal constraints, and implemented + comments filtering. Only <p> and <a> are allowed now. <br> is + mapped into <p>. + + * New snap of Postgres database + + * Make install should(tm) now do something sensible. It still + ought to autodetect "flavor" for foomatic-configure. + + * Rename make-datafile to foomatic-datafile. + + * Wrap f-c -Q output in <queues> to make it have one toplevel + entity. + +2001-03-04 Grant Taylor <gtaylor@linuxprinting.org> + + * Removed constraints entirely from combo data. So arg_defval now + appears at /option/arg_defval instead of at + /option/constraints/constraint/arg_defval. + + * Switch verified tag to an unverified tag. Eventually, the xml + dataset will be defined as containing only verified information, + so this way there's one less tag for maintainers to fiddle with. + + * Prepare for CVS integration. + + * Various minor twiddles around the website programs. + + * args_byname twiddle for Till. + + * Include all the backends in the package. + +2001-02-28 Grant Taylor <gtaylor@linuxprinting.org> + + * Require Storable + + * Added printer autodetect sections to overview. Use xpath or + similar to see the values in /printer/autodetect/parallel + + * -Q in foomatic-configure; prints XML summary of system printer + configuration. -X and -O allow examination of the whole + database. f-c API should now be sufficient to build GUIs atop. + + * compile_db changes to limit pain of Perl memory leaks. + + * Added the pcache, a persistent pre-parsed cache of everything. + + * Various buglets from Till. Invalid constraints just warn, don't + hose the whole option. Etc. + + * Add foomatic-configure; initial LPD support. + + * Various typos and minor fixes; the overview compile/save was + broken, and the overview Perl was missing the driver list. + + * Begin beta3. + +2001-02-25 Grant Taylor <gtaylor@linuxprinting.org> + + * Added methods get_makes, get_javascript2, get_models_by_make, + get_printer_from_make_model. + + * Added overview support. Various methods now return or use the + overview infromation; the overview is just a summary listing of + various database-wide info. By using it, many operations are + less horribly slow. The overview is db/compiled/overview.xml + + * Don't actually need XML::Grove::PerlSAX. + + * Added -f clag to compile_db, and extra work avoidance code. + + * Fixed variable naming bug in pdq generator, and fixed boolean + option conversion in getdat. + +2001-02-25 Grant Taylor <gtaylor@habanero.picante.com> + + * Included an experimental dataset from the new data generation + code I've written for gimp-print. The driver "stp-4.1.5" might + even work(tm). + +2001-02-20 Grant Taylor <gtaylor@habanero.picante.com> + + * Subtle adjustments to <constraint> contents. The <sense> + element is gone; replaced with the sense="true" or sense="false" + attribute on the <constraint> tag itself. Also, you can now + specify a <printer>printer-id</printer> element instead of + make/model; this is useful for automatically generated data. diff --git a/Makefile.in b/Makefile.in new file mode 100755 index 0000000..251b4a2 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,195 @@ + +# Makefile to install foomatic-filters +# $Revision: 3.4.2.5 $ + +# PREFIX defaults to /usr/local for manually installed progs, so that they +# are not messed up on a system upgrade. +# +# `architecture independent', static data files i.e. perl libs go into +# $(PREFIX)/share/foomatic +# (user) executables into $(PREFIX)/bin/ +# system binaries go into $(PREFIX)/sbin +# configuration files into /etc/foomatic/*. +# + +# Variables + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +bindir=@bindir@ +sbindir=@sbindir@ +mandir=@mandir@ +sysconfdir=@sysconfdir@ + +PREFIX=$(prefix) +SRC=@srcdir@ + +BINDIR=$(bindir) +SBINDIR=$(sbindir) +MANDIR=$(mandir) +ETCDIR=$(sysconfdir)/foomatic +INSTALL=@INSTALL@ + +# Paths for CUPS +CUPS=@CUPS@ +CUPS_FILTERS=@CUPS_FILTERS@ + +# Paths for PPR +PPR=@PPR@ +PPR_INTERFACES=@PPR_INTERFACES@ +PPR_LIB=@PPR_LIB@ + +# This is mainly useful for building a binary foomatic package +DESTDIR= + +### Probably nothing to fiddle past here + +# Files generated by the AC_OUTPUT call of "./configure" +AC_OUTPUT_FILES:=Makefile makeMan foomatic-gswrapper \ + foomatic-rip + +# User programs and helper programs +BINFILES:=foomatic-gswrapper foomatic-rip + +# Filters, only useful for admins +SBINFILES:= + +# Masks for trash files which have to be removed before packaging Foomatic +TRASHFILES:="*~" "*\#*" ".??*" "*.rej" + +all: build + +# The install rule should check for kitloads and avoid stomping. It doesn't +install: install-main install-cups install-ppr + +install-main: install-bin install-man install-etc + +check-config: + @if [ -f .testing-stamp ] ; then \ + echo 'Cowardly refusing to install inplace-built filters.' ;\ + echo 'Use "make inplace_clean; make" to get proper ones.' ;\ + exit 1 ;\ + fi + +install-cups: check-config + ${SRC}/mkinstalldirs $(DESTDIR)$(CUPS_FILTERS) + ln -sf $(BINDIR)/foomatic-rip $(DESTDIR)$(CUPS_FILTERS) + +install-ppr: check-config + ${SRC}/mkinstalldirs $(DESTDIR)$(PPR_INTERFACES) + ${SRC}/mkinstalldirs $(DESTDIR)$(PPR_LIB) + ln -sf $(BINDIR)/foomatic-rip $(DESTDIR)$(PPR_INTERFACES) + ln -sf $(BINDIR)/foomatic-rip $(DESTDIR)$(PPR_LIB) + +install-bin: check-config + ${SRC}/mkinstalldirs $(DESTDIR)$(BINDIR) + ${INSTALL} -m 755 $(BINFILES) $(DESTDIR)$(BINDIR) +# ${INSTALL} -m 755 $(SBINFILES) $(DESTDIR)$(SBINDIR) + +install-etc: check-config + ${SRC}/mkinstalldirs $(DESTDIR)$(ETCDIR)/direct + ${INSTALL} -m 644 ${SRC}/filter.conf $(DESTDIR)$(ETCDIR)/filter.conf.sample + if [ ! -f $(DESTDIR)$(ETCDIR)/filter.conf ] ; then ${INSTALL} -m 644 ${SRC}/filter.conf $(DESTDIR)$(ETCDIR); fi; + +install-man: check-config + ${SRC}/mkinstalldirs $(DESTDIR)$(MANDIR) + ${SRC}/mkinstalldirs $(DESTDIR)$(MANDIR)/man1 +# ${SRC}/mkinstalldirs $(DESTDIR)$(MANDIR)/man8 + ${INSTALL} -m 644 *.1 $(DESTDIR)$(MANDIR)/man1 +# cp -f *.8 $(DESTDIR)$(MANDIR)/man8 + +build: man + chmod a+rx foomatic-rip foomatic-gswrapper + +man: + chmod a+rx ./makeMan + if [ "$(INPLACE)" = "--inplace" ]; then \ + FOOMATIC_RIP=`pwd`/foomatic-rip; \ + FOO_ETC=`pwd`/etc/foomatic; \ + PRINTCAP=@PRINTCAP@; \ + else \ + FOOMATIC_RIP=$(BINDIR)/foomatic-rip; \ + FOO_ETC=$(ETCDIR); \ + PRINTCAP=@PRINTCAP@; \ + fi; \ + export FOOMATIC_RIP FOO_ETC PRINTCAP; \ + ./makeMan ${SRC}/*[0-9].in + +# Clean up the source directory +clean: remove-trash + rm -f .testing-stamp + rm -f $(BINFILES:=.1) $(SBINFILES:=.8) test/*.out + +distclean: clean + rm -f $(AC_OUTPUT_FILES) config.log config.status config.cache configure.lineno + rm -rf autom*.cache confdefs.h + +maintainer-clean: distclean + rm -f configure aclocal.m4 + +# Remove editor backup and temporary files +remove-trash: + for m in $(TRASHFILES); do \ + find . -name "$$m" -exec rm "{}" \; ; \ + done + +# Uninstall an installed Foomatic + +uninstall: uninstall-cups uninstall-ppr uninstall-main + +uninstall-main: uninstall-bin uninstall-man + +uninstall-bin: check-config + ( cd $(DESTDIR)$(BINDIR) && \ + rm -f $(BINFILES) \ + ) +# ( cd $(DESTDIR)$(SBINDIR) && \ +# rm -f $(SBINFILES) \ +# ) + +uninstall-etc: check-config + rm -f $(DESTDIR)$(ETCDIR)/filter.conf + rm -f $(DESTDIR)$(ETCDIR)/filter.conf.sample + rmdir $(DESTDIR)$(ETCDIR)/direct || : + rmdir $(DESTDIR)$(ETCDIR) || : + +uninstall-cups: check-config + rm -f $(DESTDIR)$(CUPS_FILTERS)/foomatic-rip + rmdir $(DESTDIR)$(CUPS_FILTERS) || : + rmdir $(DESTDIR)$(CUPS) || : + +uninstall-ppr: check-config + rm -f $(DESTDIR)$(PPR_INTERFACES)/foomatic-rip + rmdir $(DESTDIR)$(PPR_INTERFACES) || : + rm -f $(DESTDIR)$(PPR_LIB)/foomatic-rip + rmdir $(DESTDIR)$(PPR_LIB) || : + rmdir $(DESTDIR)$(PPR) || : + +uninstall-man: check-config + for m in $(BINFILES); do \ + rm -f $(DESTDIR)$(MANDIR)/man1/$$m.*; \ + done +# for m in $(SBINFILES); do \ +# rm -f $(DESTDIR)$(MANDIR)/man8/$$m.*; \ +# done + +# Various testing/debugging/etc targets +inplace: testing +testing: INPLACE = --inplace +testing: build + touch .testing-stamp + +inplace-clean: testing_clean +testing-clean: clean + +# We need to export all Variables for makeDefaults and the scripts target to +# work. +.EXPORT_ALL_VARIABLES: + +# Use INPLACE=--inplace to get the special run-in-place Defaults. + +.PHONY: all check-config build install install-bin \ + man inplace testing clean inplace-clean testing-clean distclean \ + maintainer-clean + @@ -0,0 +1,382 @@ + +Foomatic 3.0.2 +============== + + +foomatic-filters +---------------- + +Filter scripts used by the printer spoolers to convert the incoming +PostScript data into the printer's native format using a +printer/driver specific, but spooler-independent PPD file. + + +Grant Taylor <gtaylor@picante.com> +Till Kamppeter <till.kamppeter@gmx.net> + +http://www.linuxprinting.org/ + +This README contains mainly info for developers. See the file USAGE if +you want to know how to use Foomatic. + + +Copying +------- + +This package and also the other Foomatic packages are under the +GPL. See http://www.gnu.org/. + +If you spot a data error or any other bug, send mail describing the bug to +foomatic-devel@linuxprinting.org + +General discussion happens in the foomatic-devel forum/list thing at +www.linuxprinting.org. + + +Intro +----- + +This is the stable version of Foomatic. See + +http://www.linuxprinting.org/contribute.html#programming +http://www.linuxprinting.org/pipermail/foomatic-devel/2002q3/thread.html +http://www.linuxprinting.org/pipermail/foomatic-devel/2002q4/thread.html +http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/IV.Foomatic-Developer/IV.tutorial-handout-foomatic-development.html + +to know more about its development. + +Your suggestions, bug reports, patches, ... are welcome on + +http://www.linuxprinting.org/newsportal/thread.php3?name=linuxprinting.foomatic.devel + +For getting Foomatic PPD files for this version, go to + +http://www.linuxprinting.org/ + +See the README file of "foomatic-db-engine" for a (more or less) +complete overview of Foomatic. + + +Supported spoolers +------------------ + +CUPS - Common Unix Printing System (http://www.cups.org/) +LPD - Line Printer Daemon (Does this have a home page anywhere?) +LPRng - LPR - New Generation (http://www.lprng.org/) +GNUlpr - An enhanced LPD (http://sf.net/projects/lpr, development stopped) +PPR - Page PRinter spooler (http://ppr.sourceforge.net/) +PDQ - Print, Don't Queue (http://pdq.sf.net/, development stopped) +CPS - Coherent Printing System (http://www.tww.cx/cps.php) +--- - Direct, spooler-less printing (http://www.linuxprinting.org/) + + +Programs and important files from this package +---------------------------------------------- + +This package contains only two scripts and its man pages: foomatic-rip +and foomatic-gswrapper. foomatic-rip is the main +PostScript-to-printer's-native-language filter and foomatic-gswrapper +is an m auxiliary filter ironing out some GhostScript quirks. + +foomatic-rip works with all spoolers and always uses PPD files for +printer/driver capabilities info. Manufacturer-supplied PPDs of +PostScript printers can be used, too. + +Note: The scripts appear as ".in" files in the source tree and CVS, +because the path for the Perl interpreter is inserted by the +"configure" script. The "configure" script makes the final files from +them with the inserted path of the Perl interpreter. + +configure.in + + The source from which GNU autoconf generates the "configure" script + +acinclude.m4 + + Additional macros for the "configure" script + +make_configure + + Calls aclocal and autoconf to generate "configure" from "configure.ac" + and "acinclude.m4" + +Makefile.in + + The template from which "configure" generates the Makefile + +install-sh + + Helper script for "configure" + +foomatic-rip + + Universal print filter (PostScript -> printer's native language) to be + used with all known printer spoolers (CUPS, LPRng, LPD, GNUlpr, PPR, + PDQ, CPS, spooler-less printing). It Gets printer/driver capability + information from PPD files. The PPD files can either be generated from + the Foomatic database or they can be manufacturer-supplied PPD files + for PostScript printers. + +foomatic-gswrapper + + This is not really a file conversion or print filter, but it is used + by foomatic-rip when it is present. This is a wrapper around + Ghostscript. It regularizes options if they differ between gs + flavors. It also assures that the GhostScript output is not mixed up + with messages produced by some PostScript files (esp. files from + Windows). foomatic-rip auto-detects the presence of + foomatic-gswrapper. + +foomatic-rip.1 +foomatic-gswrapper,1 + + man pages for the filter scripts. + + +Dependencies +------------ + +To build and run this package only a Perl interpreter (5.6.0 and +newer) is needed. + +To connect to remote printers, you need additional connectivity +software (as "rlpr", "nc", "smbspool', ...). + + +How does it work? +----------------- + +foomatic-rip is a filter which takes PostScript (and also certain +non-PostScript formats) from standard input and translates it to the +printer's native language. The resulting data is usually directed to +standard output, but depending on the spooler abnd its configuration +it can also be directed to elsewhere. The information how to do this +translation it gets from a PPD file, from command line options, +environment variables, and spooler configuration files. + +foomatic-rip is designed in a way that it does neither use any +temporary files nor reads the whole print job into memory. So even +huge jobs can be printed without needing big resources. Data is only +buffered in memory as long as it is not clear how to treat the +data. This happens for example when we don't know yet whether the +input file is PostScript, or when we are searching for embedded option +settings. This is done by forking into up to 6 subprocesses which do +all the tasks of the filter chain in parallel, see the overview of +these subprocesses below. + +See also the numerous comments in the foomatic-rip Perl script. + + +foomatic-rip does the following steps to do its work: + + +Spooler auto-detection + +At first, foomatic-rip reads its command line and a certain assortment +of environment variables. With this information it determines from +which spooler it was called, since every spooler calls its filter(s) +with different command lines and different information supplied via +environment variables. + + +Gathering all information to execute the print job + +Next step after figuring out what the spooler is, is collecting the +information about the print job which was not found in the first +step. Now the knowledge of which spooler is used is taken into account +for interpreting the information. + + +Reading the PPD file + +In one of the previous steps we have found the name of the PPD file +assigned to the print queue currently in use. Now the PPD file is read +to get all information needed to build the renderer's (Usually, the +renderer is GhostScript, when no renderer is needed, as for a +PostScript printer, "cat" is used) command line, the available +options, their default values, and how to apply them. After having +parsed the PPD file we have a renderer command line and a list of +options with the range of possible settings and a default setting. For +LPRng, LPD, GNUlpr, and spooler-less printing we get also the +so-called postpipe here, defining a shell command line into which +foomatic-rip should firect its output. If no postpipe is found, the +output data goes to standard output. The postpipe allows to print to +destinations which are not directly supported by the spooler. + + +Applying user-supplied settings + +All option settings which the user has supplied on the command line +are checked whether they are valid (option exists, choice in range) +and then applied to the list of default settigs, replacing the +defaults by the values given by the user. The options not mentioned on +the command line keep their default values from the PPD file. + + +Check for the "docs" option + +foomatic-rip accepts a special option which is not defined in the PPD +file, the "docs" option. When the user supplies it, he wants to print +a listing of all options available for the printer/driver combo in +use. So the incoming data on standard input is discarded and a +sub-process for generating the option listing in plain text form is +launched. Standard input of the main process is connected to the +output of the sub-process. Now the main process behaves as the option +listing would be the job which the user has sent. + + +Print files + +With some spoolers the job(s) to be printed is supplied in (a) +file(s), in this case we close standard input and open the file on the +stabdard input handler. This way the following steps read from the +file instead of from standard input. The rest of the foomatic-rip +process is repeated for every input file, to print them one after the +other. + + +Raw queue + +When we have a raw queue, all the rest of the incoming data is +directly passed to standard output or to the postpipe now. The +following steps will be omitted then. + + +Print the job + +After all the preparation, the PostScript job is examined for traces +of option settings supposed to be applied to the renderer's command +line or to the JCL (Job Coomand Language, for example PJL) header +which is sent to the printer before the renderer's output is sent. +PPD-aware applications and spoolers stuff option settings directly +into the file, they do not necessarily send PPD options by the command +line. There is also stuffed in PostScript code to apply option +settings given by the command line of the printing command ("lpr", +"lp", ...) and to set the defaults given in the PPD file. + +Examination strategy: We read lines from standard input until the +first %%Page: comment appears and save them as @psheader. This is the +page-independent header part of the PostScript file. The PostScript +interpreter (renderer) must execute this part once before rendering +any assortment of pages. Then pages can be printed in any arbitrary +selection or order. All option settings we find here will be collected +in the default option set for the RIP (Raster Image Processor, +renderer) command line. + +Now the pages will be read and sent to the renderer, one after the +other. Every page is read into memory until the %%EndPageSetup comment +appears (or a certain amount of lines was read in the case that there +is no %%EndPageSetup). So we can get option settings only valid for +this page. If we have such settings we set them in the modified +command set for this page. + +If the renderer is not running yet (first page) we start it with the +command line built from the current modified command set and send the +first page to it, in the end we leave the renderer running and keep +input and output pipes open, so that it can accept further pages. If +the renderer is still running from the previous page and the current +modified command set is the same as the one for the previous page, we +send the page. If the command set is different, we close the renderer, +re-start it with the command line built from the new modified command +set, send the header again, and then the page. + +After the last page the trailer (%%Trailer) is sent. + +The output pipe of this program stays open all the time so that the +spooler does not assume that the job has finished when the renderer is +re-started. + +Non DSC-conforming documents will be read until a certain line number +is reached. Options for the renderer's command line or the JCL header +appearing later will be ignored. This means that option settings in +the page headers will not be taken into account. + +If options are implemented by PostScript code supposed to be stuffed +into the job's PostScript data we stuff the code for all these options +into our job data, So all default settings made in the PPD file (the +user can have edited the PPD file to change them) are taken care of +and command line options get also applied. To give priority to +settings made by applications we insert the options's code in the +beginnings of their respective sections, so that sommething, which is +already inserted, gets executed after our code. Missing sections are +automatically created. In non-DSC-conforming files we insert the +option code in the beginning of the file. This is the same policy as +used by the "pstops" filter of CUPS. + +If CUPS is the spooler, the option settings were already inserted by +the "pstops" filter (both PPD defaults and user-supplied options), so +we don't insert them again. The only thing we do is correcting +settings of numerical options when they were set to a value not +available as choice in the PPD file, As "pstops" does not support +"real" numerical options, it sees these settings as an invalid choice +and stays with the default setting. In this case we correct the +setting in the first occurence of the option's code, as this one is +the one added by CUPS, later occurences come from applications and +should not be touched. + +If the input is not PostScript (if there is no "%!" after +$maxlinestopsstart lines) a file conversion filter will automatically +be applied to the incoming data, so that we will process the resulting +PostScript here. This way we have always PostScript data here and so +we can apply the printer/driver features described in the PPD +file. For the file conversion filter two subprocesses are started, the +task of the first one is to pass the already buffered lines into the +filter and then to continue reading standard input (without parsing +the data) to pass the rest of the job to the filter. The second +subprocess is the filter itself, getting its standard input from the +first subprocess and the giving its standard output to the main +process. This way the main process has again PostScript as its +standard input. + +Supported file conversion filters are "a2ps", "enscript", "mpage", and +spooler-specific filters. All filters convert plain text to +PostScript, "a2ps" also other formats. The conversion filter is always +used when one prints the documentation pages, as they are created as +plain text, when CUPS is the spooler "pstops" is executed after the +filter so that the default option settings from the PPD file and +CUPS-specific options as N-up get applied. On regular printouts one +gets always PostScript when CUPS or PPR is the spooler, so the filter +is only used for regular printouts under LPD, LPRng, GNUlpr, PDQ, or +without spooler. + +The main process keeps always parsing the PostScript onput, it +launches the renderer in one subprocess and launches and additional +subprocess for bracketing the renderer's output with the JCL commands +and putting the resulting data to standard output or to the postpipe. + + +Overview of the subprocesses +---------------------------- + +To do the filtering without loading the whole file into memory we work +on a data stream, we read the data line by line analyse it to decide what +filters to use and start the filters if we have found out which we need. +We buffer the data only as long as we didn't determine which filters to +use for this piece of data and with which options. There are no temporary +files used. + +foomatic-rip splits into up to 6 parallel processes to do the whole +filtering (listed in the order of the data flow): + + KID0: Generate documentation pages (only jobs with "docs" option) + KID2: Put together already read data and current input stream for + feeding into the file conversion filter (only non-PostScript + and "docs" jobs) + KID1: Run the file conversion filter to convert non-PostScript + input into PostScript (only non-PostScript and "docs" jobs) + MAIN: Prepare the job auto-detecting the spooler, reading the PPD, + extracting the options from the command line, and parsing + the job data itself. It analyses the job data to check + whether it is PostScript and starts KID1/KID2 if not, it + also stuffs PostScript code from option settings into the + PostScript data stream. It starts the renderer (KID3/KID4) + as soon as it knows its command line and restarts it when + page-specific option settings need another command line + or different JCL commands. + KID3: The rendering process. In most cases GhostScript, "cat" + for native PostScript printers with their manufacturer's + PPD files. + KID4: Put together the JCL commands and the renderer's output + and send all that either to STDOUT or pipe it into the + command line defined with $postpipe. + diff --git a/STANDARD_installation b/STANDARD_installation new file mode 100644 index 0000000..e957c6c --- /dev/null +++ b/STANDARD_installation @@ -0,0 +1,13 @@ +#!/bin/sh +set -x +set -e +if [ ! -f configure ] ; then sh make_configure; fi +./configure --prefix=/usr --sysconfdir=/etc +make +make -n install +set +x +if [ "`id -u`" != 0 ] ; then + echo "run make install as root" + echo "su root -c 'make install'" + exit 1 +fi @@ -0,0 +1,26 @@ +See also the bugtracker at foomatic.sourceforge.net. + + - Possibility for users to have their personal default options + (.lpoptions file as in CUPS, due to the Foomatic options having the same + names as the CUPS-O-MATIC options one can even use an .lpoptions file + with exactly the same format as the CUPS file and it will be used by + both Foomatic and CUPS) + + - Write a few key lint-like and transforming tools for the xml data. + + - Fold foomatic-gswrapper into the foomatic-rip + + - Improve ascii support to lpdomatic and pdq files. ASCII should + simply be a matter of observing the ascii bit in the printer $dat + and sending either crlf-ed text or postscriptifying and running + through the ps driver. Right now text is always translated to + PostScript (with the advantage of more nicely-looking text + output (with head line, page numbers, ...). When one implements + the possibility to pass text directly to the printer, one should + consider the optional use or the "pr" filter. + + - PDQ file versioning is still unsatisfactory. I changed from a + checksum to the current timestamp. So now it's sequential, but + changes all every time. Other spoolers' code needs a version story + in the first place. + @@ -0,0 +1,245 @@ + +Foomatic 3.0.2 +============== + +foomatic-filters +---------------- + +Filter scripts used by the printer spoolers to convert the incoming +PostScript data into the printer's native format using a +printer/driver specific, but spooler-independent PPD file. + + +Grant Taylor <gtaylor@picante.com> +Till Kamppeter <till.kamppeter@gmx.net> +http://www.linuxprinting.org/ + +This usage documentation file is written by Till Kamppeter + + +Intro +----- + +Foomatic is a database providing information about the usage of +printers with free operating systems and free printer drivers, where +"free" is meant as free software in the sense of the Free Software +Foundation (http://www.gnu.org). Therefore the database only contains +information about printer drivers which are free software. The +technology of this database can also be used for non-free drivers, but +the database entries have to be published in separate packages +then. The database can also be run under non-free operating systems +(as commercial Unixes) as they often use GhostScript and free printer +drivers. + +Since most free operating systems (GNU/Linux, *BSD, ...) are +compatible to Unix, their applications send PostScript to the printer +queues. Therefore one usually hands over the PostScript directly to a +PostScript printer (sometimes with some prepended PostScript commands +for options) or uses GhostScript for generating the data format the +printer needs. This is done by the printer spooler which also stores +the data in a spool directory when the printer is still occupied by +another job, transmits the data to a print server in the network, and +so on. + +The printer drivers for non-PostScript printers are either compiled +into GhostScript, a plug-in for GhostScript (e. g. IJS drivers), or +they are an extra filter which converts a generic bitmap generated by +GhostScript into the printer's data format. For this the spooler has +to call complicated command lines of GhostScript and the extra filter +(if needed). The user of a free operating system normally does not see +these command lines because an installation program takes appropriate +filter scripts and/or description files from a database and assigns +them to the printer queue. + +Widely used databases were the RHS-Printfilters and the APS +filters. Their disadvantages were that they only supported one spooler +(LPD/LPRng) and only a small part of the driver's options (mostly page +size and resolution). Foomatic supports all options of the drivers and +all known spoolers (LPD, LPRng, GNUlpr, CUPS, PPR, PDQ, CPS, direct +spooler-less printing). In addition, all known free software printer +drivers are supported. Foomatic also supports printing of various +non-PostScript file types for spoolers which do not support this by +themselves (LPD, LPRng, GNUlpr, spooler-less printing). To enable this +feature you need to have "a2ps", "enscript", or "mpage" installed. + +Another problem is that the way how to install queues, to print files, +and to handle jobs is very different with different spoolers. LPD for +example requires editing of configuration files for adding a queue, +whereas CUPS and PPR have specialized command line utilities. Foomatic +puts a layer between the applications and the spoolers so that one has +a common, spooler-independent command line interface for all spoolers, +so that switching of spoolers or administration of a network with +different spoolers gets much easier, because for the same operations +there are the same commands, independent of the spooler. + +This command line interface can also be used as a base for +spooler-independent graphical frontends. + + +Installation +------------ + +Foomatic runs on all systems where one can run the Perl +interpreter. + +foomatic-filters needs nothing else than the Perl interpreter to build +and run. + +To connect to remote printers, you need additional connectivity +software (as "rlpr", "nc", "smbspool', ...). To print non-PostScript +files with LPD, LPRng, GNUlpr, or without spooler, you will need a2ps, +enscript, mpage, or similar filters which convert non-PostScript files +to PostScript. a2ps, enscript, and mpage will be automatically used by +the scripts when they are installed. + +Download sources: +rlpr: http://freshmeat.net/projects/rlpr/ or + http://www.linuxprinting.org/download/printing/ +netcat: http://freshmeat.net/projects/netcat/ + +This package does not require any other Foomatic package. it can be +used with PPD files downloaded from linuxprinting.org, with +manufacturer-supplied PPDs for PostScript printers, and probably with +other PPD files. + +Note: PPD files for native CUPS drivers, as the ones shipping with +CUPS or Gimp-Print cannot be used with other spoolers than CUPS. + +For non-PostScript printers one also needs GhostScript (5.50 or newer, +ESP GhostScript 7.05.4 or newer highly recommended) and the +appropriate printer driver. + +For drivers which have to be compiled into GhostScript ("Execution +style: GhostScript" on the driver pages on linuxprinting.org) check +with "gs -h" whether the driver is in your GhostScript. If not you +need to compile the driver into your GhostScript or use a GhostScript +version which already contains it. + +If the driver page says "Execution style: Uniprint", it is much +easier, check whether the appropriate ".upp" file is in one of the +directories listed under "Search path:" in the end of the "gs -h" +output. Copy the ".upp" file to one of these directories when it was +not there already. + +The third type of driver is marked with "Execution style: Filter", +this means, that you have to install a filter executable in addition +to GhostScript. Check with "which <name of the filter>" whether the +filter is already there, otherwise download and install the +appropriate package. + + + +foomatic-filters can be installed using these commands (if you have +downloaded this package from CVS, run "./make_configure" at first, for +that you will also need the "autoconf" and "aclocal" utilities, +"aclocal" is in the "automake" package in some distributions): + + ./configure + make + make install + +"make install" must be run as "root", the other commands can be run as +a normal user. + +The "configure" script will auto-detect where the scripts have to be +installed and where the Perl interpreter is located. If "configure" +fails because of something not being installed, do + + rm -rf config.cache autom*.cache + +before you run "configure" again (after installing the missing parts). + +By default, foomatic-filters is installed into subdirectories of /usr/local +(e. g. /usr/local/bin/foomatic-gswrapper), to get it into subdirectories +of /usr (/usr/bin/foomatic-gswrapper), enter: + + ./configure --prefix=/usr + make + make install + +There are other things which can be adjusted by options on the +"configure" command line, enter "./configure --help" for more +info. You can also modify variables in the beginning of the "Makefile" +after running "configure", but note that every run of "configure" +re-creates the "Makefile". + +You can also run Foomatic out of its source directory (for example +when you want to try it out, or when you don't have root +access). Therefore enter (can be done as a normal user): + + ./configure + make inplace + +and enter the commands with "./" in the beginning +(e. g. "./foomatic-rip ...", "man ./foomatic-rip.1"). This also works +on a machine where a system-wide Foomatic is already installed. + +In addition, you should install a utility to make PostScript out of +non-PostScript files, so that you can print those non-PostScript files +and also a list of available options using the "docs" option. The +supported utilities are "a2ps" +(http://www-inf.enst.fr/~demaille/a2ps/), "enscript" +(http://people.ssh.fi/mtr/genscript/), and "mpage" +(http://www.mesa.nl/pub/mpage). Recommended is "a2ps" because it +detects many file types (text, PDF, most image formats) and together +with ImageMagick (for images) and GNU/ESP/AFPL GhostScript 6.51 or +newer (for PDF) it converts them to PostScript. The other tools +convert only text files. The tool you have installed is auto-detected +by foomatic-rip and used automatically if +necessary. PPR needs this tool only for printing the option +list, and CUPS does not need it at all. PPR and CUPS use internal filters for printing non-PostScript files. + +If you have a multi-function device from HP, install HPOJ from + + http://hpoj.sourceforge.net/ + +before starting to set up printer queues with foomatic-filters. This +is needed for printing on USB devices and for scanning and photo +memory card access on all devices. If you use CUPS 1.1.12 or newer +together with the old HPOJ 0.8, you need also the latest "ptal" +backend script from + + http://www.hornclan.com/~mark/cups/ + +License information and installation instructions for this script you +find in the beginning of the script itself. See also the end of the +"Adding a queue" section in this file to see how to use this script. + +The "ptal" backend script is already included in HPOJ 0.9. + + +Setting up printers +------------------- + +If you have "foomatic-db-engine" installed, see the USAGE file there. + +If not, see, depending on your spooler: + +CUPS: + + http://www.linuxprinting.org/cups-doc.html + +LPD, LPRng, GNUlpr: + + http://www.linuxprinting.org/lpd-doc.html + +PPR: + + http://www.linuxprinting.org/ppr-doc.html + +PDQ: + + http://www.linuxprinting.org/pdq-doc.html + +CPS: + + http://www.tww.cx/cps.php + +Direct, spooler-less printing: + + http://www.linuxprinting.org/direct-doc.html + +Usage of PPD files (for all spoolers): + + http://www.linuxprinting.org/ppd-doc.html + diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100755 index 0000000..92bc6b3 --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,53 @@ +dnl AC_PATH_DIR(VARIABLE, DIR-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN(AC_PATH_DIR, +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word/]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$4], , $PATH, [$4])" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -d $ac_dir/$ac_word; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" +dnl If no 3rd arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$3], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$3" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test -n "[$]$1"; then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + +dnl AC_PATH_DIRS(VARIABLE, DIRSS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND +dnl [, PATH]]) +AC_DEFUN(AC_PATH_DIRS, +[for ac_dir in $2 +do +AC_PATH_DIR($1, [$]ac_dir, , $4) +test -n "[$]$1" && break +done +ifelse([$3], , , [test -n "[$]$1" || $1="$3" +])]) + diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..8673fc2 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,66 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4-p4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl AC_PATH_DIR(VARIABLE, DIR-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN(AC_PATH_DIR, +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word/]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$4], , $PATH, [$4])" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -d $ac_dir/$ac_word; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" +dnl If no 3rd arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$3], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$3" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test -n "[$]$1"; then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + +dnl AC_PATH_DIRS(VARIABLE, DIRSS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND +dnl [, PATH]]) +AC_DEFUN(AC_PATH_DIRS, +[for ac_dir in $2 +do +AC_PATH_DIR($1, [$]ac_dir, , $4) +test -n "[$]$1" && break +done +ifelse([$3], , , [test -n "[$]$1" || $1="$3" +])]) + + diff --git a/configure b/configure new file mode 100755 index 0000000..2a79370 --- /dev/null +++ b/configure @@ -0,0 +1,1367 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-file-converter-check check whether a file converter is installed [default=yes]" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=foomatic-rip.in + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:560: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 +echo "configure:613: checking whether ln -s works" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftestdata +if ln -s X conftestdata 2>/dev/null +then + rm -f conftestdata + ac_cv_prog_LN_S="ln -s" +else + ac_cv_prog_LN_S=ln +fi +fi +LN_S="$ac_cv_prog_LN_S" +if test "$ac_cv_prog_LN_S" = "ln -s"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:634: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +ETCSEARCHPATH=${prefix}/etc:/usr/etc:/usr/local/etc +LIBSEARCHPATH=${prefix}/lib:/usr/lib:/usr/local/lib:${prefix}/libexec:/usr/libexec:/usr/local/libexec + +uname=`uname` +uversion=`uname -r | sed -e '1,$s/[^0-9]//g'` +if test x$uname = xIRIX64; then + uname="IRIX" +fi + +if test x$uname = xIRIX; then + ETCSEARCHPATH="/usr/freeware/etc:$ETCSEARCHPATH" + LIBSEARCHPATH="/usr/freeware/lib32:/usr/freeware/lib:$LIBSEARCHPATH" +fi + +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:678: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$PERL" in + /*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_PERL="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +PERL="$ac_cv_path_PERL" +if test -n "$PERL"; then + echo "$ac_t""$PERL" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$PERL"; then + { echo "configure: error: Perl 5 is required to build and run" 1>&2; exit 1; }; +fi + +# Extract the first word of "printcap", so it can be a program name with args. +set dummy printcap; ac_word=$2 +echo $ac_n "checking for $ac_word/""... $ac_c" 1>&6 +echo "configure:718: checking for $ac_word/" >&5 +if eval "test \"`echo '$''{'ac_cv_path_PRINTCAP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$PRINTCAP" in + /*) + ac_cv_path_PRINTCAP="$PRINTCAP" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_PRINTCAP="$PRINTCAP" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$ETCSEARCHPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -d $ac_dir/$ac_word; then + ac_cv_path_PRINTCAP="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_PRINTCAP" && ac_cv_path_PRINTCAP="/etc/printcap" + ;; +esac +fi +PRINTCAP="$ac_cv_path_PRINTCAP" +if test -n "$PRINTCAP"; then + echo "$ac_t""$PRINTCAP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +# Extract the first word of "cups", so it can be a program name with args. +set dummy cups; ac_word=$2 +echo $ac_n "checking for $ac_word/""... $ac_c" 1>&6 +echo "configure:755: checking for $ac_word/" >&5 +if eval "test \"`echo '$''{'ac_cv_path_CUPS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$CUPS" in + /*) + ac_cv_path_CUPS="$CUPS" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_CUPS="$CUPS" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$LIBSEARCHPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -d $ac_dir/$ac_word; then + ac_cv_path_CUPS="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_CUPS" && ac_cv_path_CUPS="/usr/lib/cups" + ;; +esac +fi +CUPS="$ac_cv_path_CUPS" +if test -n "$CUPS"; then + echo "$ac_t""$CUPS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +# Extract the first word of "cups/filter", so it can be a program name with args. +set dummy cups/filter; ac_word=$2 +echo $ac_n "checking for $ac_word/""... $ac_c" 1>&6 +echo "configure:792: checking for $ac_word/" >&5 +if eval "test \"`echo '$''{'ac_cv_path_CUPS_FILTERS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$CUPS_FILTERS" in + /*) + ac_cv_path_CUPS_FILTERS="$CUPS_FILTERS" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_CUPS_FILTERS="$CUPS_FILTERS" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$LIBSEARCHPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -d $ac_dir/$ac_word; then + ac_cv_path_CUPS_FILTERS="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_CUPS_FILTERS" && ac_cv_path_CUPS_FILTERS="/usr/lib/cups/filter" + ;; +esac +fi +CUPS_FILTERS="$ac_cv_path_CUPS_FILTERS" +if test -n "$CUPS_FILTERS"; then + echo "$ac_t""$CUPS_FILTERS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +# Extract the first word of "ppr", so it can be a program name with args. +set dummy ppr; ac_word=$2 +echo $ac_n "checking for $ac_word/""... $ac_c" 1>&6 +echo "configure:829: checking for $ac_word/" >&5 +if eval "test \"`echo '$''{'ac_cv_path_PPR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$PPR" in + /*) + ac_cv_path_PPR="$PPR" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_PPR="$PPR" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$LIBSEARCHPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -d $ac_dir/$ac_word; then + ac_cv_path_PPR="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_PPR" && ac_cv_path_PPR="/usr/lib/ppr" + ;; +esac +fi +PPR="$ac_cv_path_PPR" +if test -n "$PPR"; then + echo "$ac_t""$PPR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +# Extract the first word of "ppr/interfaces", so it can be a program name with args. +set dummy ppr/interfaces; ac_word=$2 +echo $ac_n "checking for $ac_word/""... $ac_c" 1>&6 +echo "configure:866: checking for $ac_word/" >&5 +if eval "test \"`echo '$''{'ac_cv_path_PPR_INTERFACES'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$PPR_INTERFACES" in + /*) + ac_cv_path_PPR_INTERFACES="$PPR_INTERFACES" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_PPR_INTERFACES="$PPR_INTERFACES" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$LIBSEARCHPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -d $ac_dir/$ac_word; then + ac_cv_path_PPR_INTERFACES="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_PPR_INTERFACES" && ac_cv_path_PPR_INTERFACES="/usr/lib/ppr/interfaces" + ;; +esac +fi +PPR_INTERFACES="$ac_cv_path_PPR_INTERFACES" +if test -n "$PPR_INTERFACES"; then + echo "$ac_t""$PPR_INTERFACES" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +# Extract the first word of "ppr/lib", so it can be a program name with args. +set dummy ppr/lib; ac_word=$2 +echo $ac_n "checking for $ac_word/""... $ac_c" 1>&6 +echo "configure:903: checking for $ac_word/" >&5 +if eval "test \"`echo '$''{'ac_cv_path_PPR_LIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$PPR_LIB" in + /*) + ac_cv_path_PPR_LIB="$PPR_LIB" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_PPR_LIB="$PPR_LIB" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$LIBSEARCHPATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -d $ac_dir/$ac_word; then + ac_cv_path_PPR_LIB="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_PPR_LIB" && ac_cv_path_PPR_LIB="/usr/lib/ppr/lib" + ;; +esac +fi +PPR_LIB="$ac_cv_path_PPR_LIB" +if test -n "$PPR_LIB"; then + echo "$ac_t""$PPR_LIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +# Check whether --enable-file-converter-check or --disable-file-converter-check was given. +if test "${enable_file_converter_check+set}" = set; then + enableval="$enable_file_converter_check" + if eval "test x${enableval} = xno"; then + NOCONVERTERCHECK=1 + echo "configure: warning: Absence of a file converter is ignored, package will be built anyway" 1>&2 +fi +fi + + +# Extract the first word of "a2ps", so it can be a program name with args. +set dummy a2ps; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:950: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_A2PS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$A2PS" in + /*) + ac_cv_path_A2PS="$A2PS" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_A2PS="$A2PS" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_A2PS="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +A2PS="$ac_cv_path_A2PS" +if test -n "$A2PS"; then + echo "$ac_t""$A2PS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +# Extract the first word of "enscript", so it can be a program name with args. +set dummy enscript; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:985: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_ENSCRIPT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$ENSCRIPT" in + /*) + ac_cv_path_ENSCRIPT="$ENSCRIPT" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_ENSCRIPT="$ENSCRIPT" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_ENSCRIPT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +ENSCRIPT="$ac_cv_path_ENSCRIPT" +if test -n "$ENSCRIPT"; then + echo "$ac_t""$ENSCRIPT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +# Extract the first word of "mpage", so it can be a program name with args. +set dummy mpage; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1020: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_MPAGE'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$MPAGE" in + /*) + ac_cv_path_MPAGE="$MPAGE" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_MPAGE="$MPAGE" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_MPAGE="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +MPAGE="$ac_cv_path_MPAGE" +if test -n "$MPAGE"; then + echo "$ac_t""$MPAGE" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +# Extract the first word of "texttops", so it can be a program name with args. +set dummy texttops; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1055: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_TEXTTOPS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$TEXTTOPS" in + /*) + ac_cv_path_TEXTTOPS="$TEXTTOPS" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_TEXTTOPS="$TEXTTOPS" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$CUPS_FILTERS" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_TEXTTOPS="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +TEXTTOPS="$ac_cv_path_TEXTTOPS" +if test -n "$TEXTTOPS"; then + echo "$ac_t""$TEXTTOPS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test "${NOCONVERTERCHECK}" = "" -a "${A2PS}" = "" -a "${ENSCRIPT}" = "" -a "${MPAGE}" = "" -a "${TEXTTOPS}" = "" ; then + { echo "configure: error: cannot find a2ps, enscript, mpage, or CUPS' texttops. You need to have at least one installed" 1>&2; exit 1; }; +fi + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS <<EOF +#! /bin/sh +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# This directory was configured as follows, +# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile makeMan foomatic-gswrapper foomatic-rip" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS <<EOF + +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@LN_S@%$LN_S%g +s%@SET_MAKE@%$SET_MAKE%g +s%@PERL@%$PERL%g +s%@PRINTCAP@%$PRINTCAP%g +s%@CUPS@%$CUPS%g +s%@CUPS_FILTERS@%$CUPS_FILTERS%g +s%@PPR@%$PPR%g +s%@PPR_INTERFACES@%$PPR_INTERFACES%g +s%@PPR_LIB@%$PPR_LIB%g +s%@A2PS@%$A2PS%g +s%@ENSCRIPT@%$ENSCRIPT%g +s%@MPAGE@%$MPAGE%g +s%@TEXTTOPS@%$TEXTTOPS%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <<EOF + +CONFIG_FILES=\${CONFIG_FILES-"Makefile makeMan foomatic-gswrapper foomatic-rip"} +EOF +cat >> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <<EOF + +EOF +cat >> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + + +echo "Finished configuring." +echo "Type 'make' to build the package" +echo "then 'make install' to install it." diff --git a/configure.in b/configure.in new file mode 100755 index 0000000..40aceb3 --- /dev/null +++ b/configure.in @@ -0,0 +1,77 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(foomatic-rip.in) + +dnl If the user didn't specify the $sysconfdir on the command line, let it +dnl be /etc, not /usr/local/etc or /usr/etc +dnl if [[ x$sysconfdir = 'x${prefix}/etc' ]]; then +dnl sysconfdir=/etc +dnl fi + +dnl Checks for programs. +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET + +ETCSEARCHPATH=${prefix}/etc:/usr/etc:/usr/local/etc +LIBSEARCHPATH=${prefix}/lib:/usr/lib:/usr/local/lib:${prefix}/libexec:/usr/libexec:/usr/local/libexec + +dnl Get the operating system and version number... +uname=`uname` +uversion=`uname -r | sed -e '1,$s/[[^0-9]]//g'` +if test x$uname = xIRIX64; then + uname="IRIX" +fi + +if test x$uname = xIRIX; then + ETCSEARCHPATH="/usr/freeware/etc:$ETCSEARCHPATH" + LIBSEARCHPATH="/usr/freeware/lib32:/usr/freeware/lib:$LIBSEARCHPATH" +fi + +dnl Check for Perl +AC_PATH_PROG(PERL,perl) + +if test -z "$PERL"; then + AC_MSG_ERROR([Perl 5 is required to build and run]); +fi + +dnl Check for /etc/printcap +AC_PATH_DIR(PRINTCAP,printcap,/etc/printcap,$ETCSEARCHPATH) + +dnl Check for /usr/lib/cups +AC_PATH_DIR(CUPS,cups,/usr/lib/cups,$LIBSEARCHPATH) + +dnl Check for /usr/lib/cups/filter +AC_PATH_DIR(CUPS_FILTERS,cups/filter,/usr/lib/cups/filter,$LIBSEARCHPATH) + +dnl Check for /usr/lib/ppr +AC_PATH_DIR(PPR,ppr,/usr/lib/ppr,$LIBSEARCHPATH) + +dnl Check for /usr/lib/ppr/interfaces +AC_PATH_DIR(PPR_INTERFACES,ppr/interfaces,/usr/lib/ppr/interfaces,$LIBSEARCHPATH) + +dnl Check for /usr/lib/ppr/lib +AC_PATH_DIR(PPR_LIB,ppr/lib,/usr/lib/ppr/lib,$LIBSEARCHPATH) + +AC_ARG_ENABLE(file-converter-check, [ --enable-file-converter-check check whether a file converter is installed [default=yes]], +[if eval "test x${enableval} = xno"; then + NOCONVERTERCHECK=1 + AC_MSG_WARN([Absence of a file converter is ignored, package will be built anyway]) +fi]) + +dnl Check for a2ps, enscript, mpage +AC_PATH_PROG(A2PS,a2ps) +AC_PATH_PROG(ENSCRIPT,enscript) +AC_PATH_PROG(MPAGE,mpage) +AC_PATH_PROG(TEXTTOPS,texttops,,$CUPS_FILTERS) + +if test "${NOCONVERTERCHECK}" = "" -a "${A2PS}" = "" -a "${ENSCRIPT}" = "" -a "${MPAGE}" = "" -a "${TEXTTOPS}" = "" ; then + AC_MSG_ERROR([cannot find a2ps, enscript, mpage, or CUPS' texttops. You need to have at least one installed]); +fi + +dnl AC_OUTPUT(Makefile src/Makefile) +AC_OUTPUT(Makefile makeMan foomatic-gswrapper foomatic-rip) + +dnl Finished +echo "Finished configuring." +echo "Type 'make' to build the package" +echo "then 'make install' to install it." diff --git a/debian/CVS/Entries b/debian/CVS/Entries new file mode 100644 index 0000000..ec170b5 --- /dev/null +++ b/debian/CVS/Entries @@ -0,0 +1,14 @@ +/README.Debian/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +/changelog/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +/compat/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +/control/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +/copyright/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +/dirs/1.1.2.2/Thu Jan 13 03:51:05 2005//Tfoomatic-3_0-branch +/docs/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +/foomatic-filters.config/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +/foomatic-filters.postinst/1.1.2.2/Thu Jan 13 03:51:05 2005//Tfoomatic-3_0-branch +/foomatic-filters.postrm/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +/foomatic-filters.templates/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +/parseconfig.pl/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +/rules/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +D/po//// diff --git a/debian/CVS/Repository b/debian/CVS/Repository new file mode 100644 index 0000000..2029fae --- /dev/null +++ b/debian/CVS/Repository @@ -0,0 +1 @@ +foomatic-filters/debian diff --git a/debian/CVS/Root b/debian/CVS/Root new file mode 100644 index 0000000..a363882 --- /dev/null +++ b/debian/CVS/Root @@ -0,0 +1 @@ +/var/lib/cvs diff --git a/debian/CVS/Tag b/debian/CVS/Tag new file mode 100644 index 0000000..2740c72 --- /dev/null +++ b/debian/CVS/Tag @@ -0,0 +1 @@ +Tfoomatic-3_0-branch diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..24d66e0 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,23 @@ +foomatic-filters for Debian +--------------------------- + +Note that the structure of the LinuxPrinting.org (foomatic) printer +configuration system in Debian (and upstream) has changed from the 2.0 +series. There are now 3 core packages: + +* foomatic-db: Contains the foomatic printer database. + +* foomatic-db-engine: Contains the foomatic-configure script. + +* foomatic-filters (this package): Contains the filter scripts for + various backend printing systems. + +In addition, the new foomatic-db-hpijs package includes the database +entries for printers supported by the HPIJS print filter developed by +Hewlett-Packard for its consumer inkjet line of printers. + +The foomatic-bin package is provided for upgrade purposes from +Foomatic 2.0, and can be purged after its dependencies have been +installed. + + -- Chris Lawrence <lawrencc@debian.org>, Sun, 13 Apr 2003 20:44:09 -0500 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..75ca6d0 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,304 @@ +foomatic-filters (3.0.2-20041204-1) unstable; urgency=low + + * New upstream release. + + -- Chris Lawrence <lawrencc@debian.org> Sat, 4 Dec 2004 11:38:53 -0600 + +foomatic-filters (3.0.2-3) unstable; urgency=low + + * Apply patch to French and Brazilian Portuguese translations to fix + encoding issues. (Closes: #277570) + + -- Chris Lawrence <lawrencc@debian.org> Fri, 22 Oct 2004 06:15:29 -0500 + +foomatic-filters (3.0.2-2) unstable; urgency=low + + * Apply file descriptor handing patch from Alexander Achenbach. + This will fix some incompatibilities with Ghostscript prefiltering, + etc. (Closes: #271519) + + -- Chris Lawrence <lawrencc@debian.org> Tue, 19 Oct 2004 01:07:45 -0500 + +foomatic-filters (3.0.2-1) unstable; urgency=high + + * New upstream release. (Released ahead of embargo date due to public + notice of vulnerability being posted at LinuxPrinting.org. Fix has + been in CVS since August 26th.) + * Fixes foomatic-rip vulnerability CAN-2004-0801, which allows arbitrary + commands to be run as the spooler's UID (possibly root). + + -- Chris Lawrence <lawrencc@debian.org> Tue, 14 Sep 2004 20:38:08 -0500 + +foomatic-filters (3.0.1-20040621-4) unstable; urgency=low + + * Update Brazilian Portuguese translation. (Closes: #264193) + + -- Chris Lawrence <lawrencc@debian.org> Sat, 7 Aug 2004 19:25:42 -0500 + +foomatic-filters (3.0.1-20040621-3) unstable; urgency=medium + + * Downgrade foomatic-filters/spooler to low priority; the autodetection + should be sufficiently good for most purposes. + * Update French translation. (Closes: #257550) + + -- Chris Lawrence <lawrencc@debian.org> Sun, 4 Jul 2004 07:49:15 -0500 + +foomatic-filters (3.0.1-20040621-2) unstable; urgency=low + + * Update German translation. (Closes: #256619) + * Update Japanese translation. (Closes: #256097) + + -- Chris Lawrence <lawrencc@debian.org> Mon, 28 Jun 2004 02:50:26 -0500 + +foomatic-filters (3.0.1-20040621-1) unstable; urgency=low + + * New upstream release. + + -- Chris Lawrence <lawrencc@debian.org> Mon, 21 Jun 2004 02:24:42 -0500 + +foomatic-filters (3.0.1-20040506-6) unstable; urgency=low + + * Fix handling of config file. (Closes: #254462, #254516, #254652) + * Updated Dutch translation. (Closes: #254582) + + -- Chris Lawrence <lawrencc@debian.org> Mon, 21 Jun 2004 02:19:54 -0500 + +foomatic-filters (3.0.1-20040506-5) unstable; urgency=low + + * Move parseconfig Perl fragment into its own file, so the syntax + highlighting is correct. + * Try to autodetect the spooler, and record this setting in + /etc/foomatic/defaultspooler to make foomatic-configure more friendly. + * Modify foomatic-filters.config to skip the filter question with CUPS, + and skip the PS accounting question unless CUPS is being used. + + -- Chris Lawrence <lawrencc@debian.org> Mon, 14 Jun 2004 03:05:54 -0500 + +foomatic-filters (3.0.1-20040506-4) unstable; urgency=low + + * Fix case of Foomatic in one spot in the debconf template. + * Eliminated all fuzziness from translations. + * Add German debconf translation. (Closes: #252823) + + -- Chris Lawrence <lawrencc@debian.org> Sun, 6 Jun 2004 21:06:10 -0500 + +foomatic-filters (3.0.1-20040506-3) unstable; urgency=low + + * Add Turkish and Dutch debconf translations. + (Closes: #246077, #251400) + + -- Chris Lawrence <lawrencc@debian.org> Fri, 28 May 2004 23:36:23 -0500 + +foomatic-filters (3.0.1-20040506-2) unstable; urgency=low + + * Updated French debconf translation. (Closes: #248662) + * Manually fixed Portuguese and Japanese translations. + + -- Chris Lawrence <lawrencc@debian.org> Fri, 14 May 2004 18:27:43 -0500 + +foomatic-filters (3.0.1-20040506-1) unstable; urgency=low + + * New upstream release. + * Changed gs-aladdin to gs-afpl in Debconf template. + + -- Chris Lawrence <lawrencc@debian.org> Thu, 6 May 2004 23:00:07 -0500 + +foomatic-filters (3.0.1-6) unstable; urgency=low + + * Updated French translation. (Closes: #238121) + * Ran debconf-updatepo manually, for good measure, even though it's + claimed in the form letter I received as part of #238121 that + dh_installdebconf automatically does this. + + -- Chris Lawrence <lawrencc@debian.org> Mon, 15 Mar 2004 19:03:27 -0600 + +foomatic-filters (3.0.1-5) unstable; urgency=low + + * Add Portguese translation of debconf templates. (Closes: #235469) + + -- Chris Lawrence <lawrencc@debian.org> Mon, 1 Mar 2004 16:10:07 -0600 + +foomatic-filters (3.0.1-4) unstable; urgency=low + + * Update Japanese translation. (Closes: #235094) + + -- Chris Lawrence <lawrencc@debian.org> Sat, 28 Feb 2004 03:16:15 -0600 + +foomatic-filters (3.0.1-3) unstable; urgency=low + + * Update French translation. (Closes: #228999) + + -- Chris Lawrence <lawrencc@debian.org> Thu, 26 Feb 2004 04:28:26 -0600 + +foomatic-filters (3.0.1-2) unstable; urgency=low + + * Add debconf configuration for the gspath variable. + * Remove all the ucf hackery, since ucf now supports debconf. We now + depend on the latest ucf. + * Remove the temporary file generated from the debconf data. + + -- Chris Lawrence <lawrencc@debian.org> Sun, 22 Feb 2004 19:43:05 -0600 + +foomatic-filters (3.0.1-1) unstable; urgency=low + + * New upstream release. No upstream changes since last CVS snapshot. + * Use DEBIAN_FRONTEND instead of DEBCONF_FRONTEND for the interactivity + test, and check the debconf database for the frontend setting too; + this should solve the buildd problems with packages that depend on + foomatic-filters. + + -- Chris Lawrence <lawrencc@debian.org> Fri, 20 Feb 2004 21:52:42 -0600 + +foomatic-filters (3.0.0-20040203-1) unstable; urgency=low + + * New upstream release. + * If DEBCONF_FRONTEND is "noninteractive", bypass ucf handling of + /etc/foomatic/filter.conf. (Closes: #231018) + + -- Chris Lawrence <lawrencc@debian.org> Tue, 3 Feb 2004 19:41:34 -0600 + +foomatic-filters (3.0.0-20040114-1) unstable; urgency=low + + * New upstream release. + * Update debconf translations. (Closes: #224193, #227127) + * Acknowledge NMU. (Closes: #223681) + + -- Chris Lawrence <lawrencc@debian.org> Wed, 14 Jan 2004 23:01:10 -0600 + +foomatic-filters (3.0.0-20031207-1) unstable; urgency=low + + * New upstream release. + * Handle filter.conf with ucf. + * Bypass the file converter check when calling configure. + (Closes: #223152) + + -- Chris Lawrence <lawrencc@debian.org> Sun, 7 Dec 2003 21:34:52 -0600 + +foomatic-filters (3.0.0-20031118-1) unstable; urgency=low + + * New upstream release. + * Note that texttops is used with CUPS by default in the template file. + (This will require minor po file updates.) + + -- Chris Lawrence <lawrencc@debian.org> Tue, 18 Nov 2003 15:32:03 -0600 + +foomatic-filters (3.0.0-20030919-3) unstable; urgency=low + + * New debconf translations. (Closes: #212496, #212723) + + -- Chris Lawrence <lawrencc@debian.org> Mon, 29 Sep 2003 09:12:16 -0500 + +foomatic-filters (3.0.0-20030919-2) unstable; urgency=low + + * Don't use the *dj variants of paper sizes, since a2ps seems to have + recently lost support for them. (Closes: #212259) + + -- Chris Lawrence <lawrencc@debian.org> Mon, 22 Sep 2003 19:54:47 -0500 + +foomatic-filters (3.0.0-20030919-1) unstable; urgency=low + + * New upstream release. + + -- Chris Lawrence <lawrencc@debian.org> Fri, 19 Sep 2003 20:35:00 -0500 + +foomatic-filters (3.0.0-20030907-2) unstable; urgency=low + + * Add French translation of debconf templates. (Closes: #211222) + * foomatic-rip now dies with a reasonable error message if unable to + open the log file. (Closes: #211345) + * Drop the debconf question on retaining the config file; the new + behavior is equivalent to "parse", which was the default behavior + anyway. (Closes: #200713) + * Change the default setting for the PostScript filter to "Automagic" + and lower the question priority to "low". + + -- Chris Lawrence <lawrencc@debian.org> Fri, 19 Sep 2003 20:30:37 -0500 + +foomatic-filters (3.0.0-20030907-1) unstable; urgency=low + + * New upstream release. + * Include Japanese translation of debconf templates. (Closes: #207513) + + -- Chris Lawrence <lawrencc@debian.org> Sun, 7 Sep 2003 12:07:18 -0500 + +foomatic-filters (3.0.0-20030628-2) unstable; urgency=low + + * Test whether /etc/foomatic/filter.conf.debconf-old exists before doing + file operations on it in the postinst. (Closes: #199777) + + -- Chris Lawrence <lawrencc@debian.org> Wed, 2 Jul 2003 22:53:05 -0500 + +foomatic-filters (3.0.0-20030628-1) unstable; urgency=low + + * New upstream release. + + -- Chris Lawrence <lawrencc@debian.org> Sat, 28 Jun 2003 17:08:02 -0500 + +foomatic-filters (3.0.0-5) unstable; urgency=low + + * Change conflicts line to not conflict with the forthcoming + cupsomatic-ppd transition package. + + -- Chris Lawrence <lawrencc@debian.org> Sat, 14 Jun 2003 19:06:39 -0500 + +foomatic-filters (3.0.0-4) unstable; urgency=low + + * Conflict/Replace with the massively obsolete cupsomatic-ppd. + (Closes: #195550) + + -- Chris Lawrence <lawrencc@debian.org> Tue, 10 Jun 2003 17:41:27 -0500 + +foomatic-filters (3.0.0-3) unstable; urgency=medium + + * Fiddle with dependencies to break the cycle keeping foomatic 3.x out + of testing. + + -- Chris Lawrence <lawrencc@debian.org> Tue, 27 May 2003 15:47:43 -0500 + +foomatic-filters (3.0.0-2) unstable; urgency=low + + * Include symbolic links for lpdomatic and directomatic for + backwards-compatibility with Foomatic 2.0. + + -- Chris Lawrence <lawrencc@debian.org> Sat, 3 May 2003 23:39:02 -0500 + +foomatic-filters (3.0.0-1) unstable; urgency=low + + * New upstream release. + + -- Chris Lawrence <lawrencc@debian.org> Sat, 3 May 2003 23:15:09 -0500 + +foomatic-filters (2.9-20030423-3) unstable; urgency=low + + * Straightened out foomatic-filters.config on first install, I think. + At least, it works here when the database entries are deleted and + /etc/foomatic/filter.conf is removed. (Closes: #190642) + + -- Chris Lawrence <lawrencc@debian.org> Tue, 29 Apr 2003 16:58:05 -0500 + +foomatic-filters (2.9-20030423-2) unstable; urgency=low + + * Upgraded foomatic-db-engine to a dependency. + + -- Chris Lawrence <lawrencc@debian.org> Thu, 24 Apr 2003 14:43:39 -0500 + +foomatic-filters (2.9-20030423-1) unstable; urgency=low + + * New upstream release. (Same as 3.0.0rc2) + + -- Chris Lawrence <lawrencc@debian.org> Wed, 23 Apr 2003 19:23:23 -0500 + +foomatic-filters (2.9-3.0.0rc1-2) unstable; urgency=low + + * Add a symbolic link in /usr/lib/cups/filter from cupsomatic to + foomatic-rip, for backwards-compatibility with Foomatic 2.x. + (Closes: #190106) + * Tried to clean up the description somewhat. + + -- Chris Lawrence <lawrencc@debian.org> Wed, 23 Apr 2003 19:15:20 -0500 + +foomatic-filters (2.9-3.0.0rc1-1) unstable; urgency=low + + * Initial Release. + + -- Chris Lawrence <lawrencc@debian.org> Sun, 13 Apr 2003 20:44:09 -0500 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +4 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..4a5deea --- /dev/null +++ b/debian/control @@ -0,0 +1,31 @@ +Source: foomatic-filters +Section: text +Priority: optional +Maintainer: Chris Lawrence <lawrencc@debian.org> +Build-Depends-Indep: debhelper (>> 4), po-debconf +Standards-Version: 3.6.1 + +Package: foomatic-filters +Architecture: all +Pre-Depends: bash (>= 2.05) +Depends: ${perl:Depends}, ${misc:Depends}, ucf (>= 0.30) +Recommends: cupsys-client | lpr | lprng | pdq | rlpr, gs-esp | gs, cupsys | enscript | a2ps | mpage, foomatic-db-engine +Conflicts: foomatic-bin (<< 2.9), cupsomatic-ppd (<< 20030507) +Replaces: foomatic-bin (<< 2.9), cupsomatic-ppd +Description: linuxprinting.org printer support - filters + Foomatic is a printer database designed to make it easier to set up + common printers for use with Debian (and other operating systems). + It provides the "glue" between a print spooler (like CUPS or lpr) and + your actual printer, by telling your computer how to process files + sent to the printer. + . + This package consists of filter scripts used by the printer spoolers + to convert the incoming PostScript data into the printer's native + format using a printer-specific, but spooler-independent PPD file. + You will need to install the foomatic-db-engine package and its + dependencies for this package to be useful. + . + For use with CUPS, you will need both the cupsys and cupsys-client + packages installed on your system. + . + Home Page: http://www.linuxprinting.org/ diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..ac6bcec --- /dev/null +++ b/debian/copyright @@ -0,0 +1,28 @@ +This package was debianized by Chris Lawrence <lawrencc@debian.org> on +Sun, 13 Apr 2003 20:44:09 -0500. + +It was downloaded from http://www.linuxprinting.org/download/foomatic/ + +Upstream Authors: + Grant Taylor <gtaylor@picante.com> + Till Kamppeter <till.kamppeter@gmx.net> + +Copyright: + + 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 + along with this package; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..84a4858 --- /dev/null +++ b/debian/dirs @@ -0,0 +1,6 @@ +etc/foomatic +usr/bin +usr/sbin +usr/share/foomatic +usr/share/man/man1 +usr/share/man/man8 diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..f0e1368 --- /dev/null +++ b/debian/docs @@ -0,0 +1,3 @@ +README +TODO +USAGE diff --git a/debian/foomatic-filters.config b/debian/foomatic-filters.config new file mode 100644 index 0000000..9c53f24 --- /dev/null +++ b/debian/foomatic-filters.config @@ -0,0 +1,120 @@ +#!/bin/bash -e +# +# Debconf configuration script for the foomatic-filters package +# + +. /usr/share/debconf/confmodule + +db_version 2.0 +db_capb backup +db_title Foomatic Printer Filter Configuration + +declare -i state=1 backup=0 + +function parseconfig +{ + if [ -e /usr/share/foomatic/parseconfig.pl ]; then + db_clear + eval $(/usr/bin/perl /usr/share/foomatic/parseconfig.pl) + db_set foomatic-filters/config_parsed true + else + db_set foomatic-filters/config_parsed false + fi +} + +################# +### Main loop ### +################# + +parseconfig + +if [ -f /etc/foomatic/defaultspooler ]; then + db_set foomatic-filters/spooler `cat /etc/foomatic/defaultspooler`; +else + # Try to detect from installed packages; use the one found first in + # the list + spooler=`dpkg-query --showformat='${Package} ${Status}' -W cupsys lpr lprng rlpr lpr-ppd pdq ppr 2>/dev/null | grep ' installed$' | cut -d' ' -f1 | head -1` + if [ "$spooler" = cupsys ]; then + spooler=cups + elif [ "$spooler" = lpr-ppd -o "$spooler" = lpr -o "$spooler" = rlpr ]; then + spooler=lpd + fi + if [ "$spooler" ]; then + db_set foomatic-filters/spooler $spooler + else + # This script may be run before dpkg gets around to installing + # a spooler if it is done in the same apt run, so see if anything + # is in the "install" state. + spooler=`dpkg-query --showformat='${Package} ${Status}' -W cupsys lpr lprng rlpr lpr-ppd pdq ppr 2>/dev/null | grep ' install ' | cut -d' ' -f1 | head -1` + if [ "$spooler" = "cupsys" ]; then + spooler=cups + elif [ "$spooler" = lpr-ppd -o "$spooler" = lpr -o "$spooler" = rlpr ]; then + spooler=lpd + fi + if [ "$spooler" ]; then + db_set foomatic-filters/spooler $spooler + fi + fi +fi + +while ((state)); do + case $state in + 1) + db_input low foomatic-filters/spooler || true + ;; + 2) + db_input low foomatic-filters/filter_debug || true + ;; + 3) + db_get foomatic-filters/spooler; + if [ "$RET" = cups ]; then + ((backup ? state-- : state++ )) || true + continue + else + db_input low foomatic-filters/textfilter || true + fi + ;; + 4) + db_get foomatic-filters/textfilter; + if [ "$RET" = Custom ]; then + db_input low foomatic-filters/custom_textfilter || true + else + ((backup ? state-- : state++)) || true + continue + fi + ;; + 5) + db_input low foomatic-filters/gspath || true + ;; + 6) + db_get foomatic-filters/gspath; + if [ "$RET" = Custom ]; then + db_input low foomatic-filters/custom_gspath || true + else + ((backup ? state-- : state++)) || true + continue + fi + ;; + 7) + db_get foomatic-filters/spooler; + if [ "$RET" = cups ]; then + db_input low foomatic-filters/ps_accounting || true + else + ((backup ? state-- : state++)) || true + continue + fi + ;; + *) + break; + ;; + esac + backup=0 + db_go || backup=1 + ((backup ? state-- : state++)) +done + +db_stop + +### Local Variables: +### tab-width: 4 +### End: diff --git a/debian/foomatic-filters.postinst b/debian/foomatic-filters.postinst new file mode 100644 index 0000000..a039cc4 --- /dev/null +++ b/debian/foomatic-filters.postinst @@ -0,0 +1,115 @@ +#!/bin/bash -e + +# Source debconf library. +. /usr/share/debconf/confmodule + +readonly FILTERCONF=/etc/foomatic/filter.conf +readonly FILTERBACK=$FILTERCONF.debconf-old +readonly tempfile=`tempfile -pfoomatic-filters-` + +function parseconfig +{ + db_clear + eval $(/usr/bin/perl /usr/share/foomatic/parseconfig.pl) +} + +db_get foomatic-filters/config_parsed +if [ $RET = false ]; then + parseconfig + db_set foomatic-filters/config_parsed true +fi + +db_get foomatic-filters/filter_debug +debug="debug: 0" +if [ $RET = true ]; then + debug="debug: 1" +fi + +db_get foomatic-filters/textfilter +if [ "$RET" = Automagic ]; then + textfilter="# textfilter:" +else + if [ "$RET" = Custom ]; then + db_get foomatic-filters/custom_textfilter + fi + textfilter="textfilter: $RET" +fi + +db_get foomatic-filters/gspath +if [ "$RET" = "gs" ]; then + gspath="# gspath: gs" +else + if [ "$RET" = "Custom" ]; then + db_get foomatic-filters/custom_gspath + fi + gspath="gspath: $RET" +fi + +db_get foomatic-filters/ps_accounting +if [ $RET = true ]; then + ps_accounting="ps_accounting: 1" +else + ps_accounting="ps_accounting: 0" +fi + +db_get foomatic-filters/spooler +echo "$RET" >| /etc/foomatic/defaultspooler + +cat <<EOF >| $tempfile +# This file allows you to configure the "foomatic-rip" filter. + +# You can force reconfiguration managed via debconf by running the +# following command: +# dpkg-reconfigure foomatic-filters +# You may need to change the lowest priority of questions to be presented +# using the switch "-p" to access some or any of these options. + +# Command for converting text files to PostScript. +# +# Priority low +$textfilter + +# Enable debug output into a logfile in /tmp/foomatic-rip.log. +# It will contain status from this filter, plus Ghostscript stderr output. +# +# WARNING: This logfile is a potential security hole; do not use in production. +# +# Priority low +$debug + +# Enable insertion of PostScript code for accounting into each printjob. +# Currently only supported with CUPS. (EXPERIMENTAL) +# +# NOTE: Enabling this option may cause extra pages to be printed after each +# job as well as after banner pages, especially with generic +# PostScript printers. +# +# Priority low +$ps_accounting + +# Path to the Ghostscript interpreter; will search the path for 'gs' if +# not specified. +# +# Priority low +$gspath + +EOF + +if [ -e $FILTERCONF ]; then + chmod --reference=$FILTERCONF $tempfile +else + chmod 0644 $tempfile +fi + +ucf --three-way --debconf-ok $tempfile $FILTERCONF + +db_stop + +# Remove the temporary file +rm -f $tempfile + +#DEBHELPER# + +### Local Variables: +### tab-width: 4 +### End: diff --git a/debian/foomatic-filters.postrm b/debian/foomatic-filters.postrm new file mode 100644 index 0000000..368de54 --- /dev/null +++ b/debian/foomatic-filters.postrm @@ -0,0 +1,12 @@ +#!/bin/sh -e + +case "$1" in + purge) + rm -f /etc/foomatic/filter.conf + ucf --purge /etc/foomatic/filter.conf + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/foomatic-filters.templates b/debian/foomatic-filters.templates new file mode 100644 index 0000000..dbd3b3a --- /dev/null +++ b/debian/foomatic-filters.templates @@ -0,0 +1,95 @@ +Template: foomatic-filters/filter_debug +Type: boolean +Default: false +_Description: Enable logging debug output into a logfile (INSECURE). + The logfile will be named /tmp/foomatic-rip.log. + . + WARNING: This logfile is a security hole; do not use in production. + However, if you are having trouble printing, you should enable this option + and include this logfile in any bug reports. + +Template: foomatic-filters/textfilter +Type: select +_Choices: Automagic, a2ps, mpage, enscript, Custom +Default: Automagic +_Description: Command for converting text files to PostScript + If you select ``Automagic'', Foomatic will search for one of a2ps, + mpage, and enscript (in that order) each time the filter script is executed. + . + Please make sure that the selected command is actually available; otherwise + print jobs may get lost. + . + This setting is ignored when foomatic-filters is used with CUPS; + instead, the texttops program included in the cupsys package is + always used to convert jobs submitted as plain text to PostScript for + printing to raster devices. + +Template: foomatic-filters/custom_textfilter +Type: string +_Default: +_Description: Command to convert standard input to PostScript. + This should be the full command line of a command that converts text from + standard input to PostScript on standard output. + . + Please note that entering an invalid command line here may result in lost + print jobs. + . + There are some special tags available usable on the filter command line. + See the filter.conf manpage for details. + +Template: foomatic-filters/ps_accounting +Type: boolean +Default: false +_Description: Enable PostScript accounting for CUPS + Insert PostScript code for accounting into each print job. This currently + only works with CUPS. + . + Note: When used with generic PostScript printers (and under certain + conditions with other printers also) this causes an extra page to be + printed after each job, so this is off by default. + +Template: foomatic-filters/gspath +Type: select +_Choices: gs, gs-gnu, gs-esp, gs-afpl, Custom +Default: gs +_Description: Which Ghostscript interpreter should be used by Foomatic? + For non-PostScript printers, print jobs are usually translated from + PostScript to your printer's command language using the free + Ghostscript interpreter. + . + There are a number of different versions of the Ghostscript + interpreter available on Debian systems. Normally, Foomatic will + use the default version (configured by the `gs' alternative, which + can be changed with `update-alternatives --config gs'). However, + you may want to use a different Ghostscript for screen display than + for printing. (You should use the Custom option if you have a + locally-installed Ghostscript interpreter.) + . + If in doubt, you should simply accept the default option (gs). + +Template: foomatic-filters/custom_gspath +Type: string +_Default: +_Description: Custom Ghostscript interpreter path. + You should enter the full path to your preferred Ghostscript + interpreter; e.g. `/opt/artifex.com-ghostscript/bin/gs'. + +Template: foomatic-filters/spooler +Type: select +Choices: cups, lpd, lprng, pdq, ppr, direct +Default: direct +_Description: Printer spooler backend for Foomatic + Foomatic normally requires a printer spooler (like CUPS or LPRng) to + handle communication with the printer and manage print jobs. If you + don't have a spooler installed, you can use the "direct" backend, but + this is only recommended for single-user systems. + . + The installation process may have already detected the correct + spooler; however, if this is the first time you are installing + Debian, or you somehow have more than one spooler installed on your + system, the detected spooler may be incorrect. + +Template: foomatic-filters/config_parsed +Type: boolean +Default: false +Description: (for internal use only) diff --git a/debian/parseconfig.pl b/debian/parseconfig.pl new file mode 100644 index 0000000..8a695e9 --- /dev/null +++ b/debian/parseconfig.pl @@ -0,0 +1,53 @@ +#!/usr/bin/perl + +my $configpath = "/etc/foomatic"; + +sub readConfFile +{ + my ($file) = @_; + + my %conf; + # Read config file if present + if (open CONF, "< $file") + { + while (<CONF>) + { + $conf{$1}="$2" if (m/^\s*([^\#\s]\S*)\s*:\s*(.*)\s*$/); + } + close CONF; + } + + return %conf; +} + +%conf = readConfFile("$configpath/filter.conf"); +print( 'db_set foomatic-filters/filter_debug ', + $conf{debug} > 0 ? 'true' : 'false', ";\n") if exists $conf{debug}; +if (exists $conf{gspath}) +{ + if ($conf{gspath} =~ m/^(gs|gs-esp|gs-aladdin|gs-gnu)$/) { + print "db_set foomatic-filters/gspath $1;\n"; + } else { + print "db_set foomatic-filters/gspath Custom;\n"; + print "db_set foomatic-filters/custom_gspath $conf{gspath};\n"; + } +} +if (exists $conf{textfilter}) +{ + if ($conf{textfilter} =~ m/^(a2ps|enscript|mpage)$/) + { + print "db_set foomatic-filters/textfilter $1;\n"; + } + elsif ($conf{textfilter} =~ m/^\s*$/) + { + print "db_set foomatic-filters/textfilter Automagic;\n"; + } + else + { + print "db_set foomatic-filters/textfilter Custom;\n"; + print "db_set foomatic-filters/custom_textfilter $conf{textfilter};\n"; + } +} +print( 'db_set foomatic-filters/ps_accounting ', + $conf{ps_accounting} ? 'true' : 'false', + "\n") if exists $conf{ps_accounting}; diff --git a/debian/po/CVS/Entries b/debian/po/CVS/Entries new file mode 100644 index 0000000..1ea4eb3 --- /dev/null +++ b/debian/po/CVS/Entries @@ -0,0 +1,9 @@ +/POTFILES.in/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +/de.po/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +/fr.po/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +/ja.po/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +/nl.po/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +/pt_BR.po/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +/templates.pot/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +/tr.po/1.1.2.1/Sat Dec 4 17:29:15 2004//Tfoomatic-3_0-branch +D diff --git a/debian/po/CVS/Repository b/debian/po/CVS/Repository new file mode 100644 index 0000000..6435b4c --- /dev/null +++ b/debian/po/CVS/Repository @@ -0,0 +1 @@ +foomatic-filters/debian/po diff --git a/debian/po/CVS/Root b/debian/po/CVS/Root new file mode 100644 index 0000000..a363882 --- /dev/null +++ b/debian/po/CVS/Root @@ -0,0 +1 @@ +/var/lib/cvs diff --git a/debian/po/CVS/Tag b/debian/po/CVS/Tag new file mode 100644 index 0000000..2740c72 --- /dev/null +++ b/debian/po/CVS/Tag @@ -0,0 +1 @@ +Tfoomatic-3_0-branch diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in new file mode 100644 index 0000000..7e902a6 --- /dev/null +++ b/debian/po/POTFILES.in @@ -0,0 +1 @@ +[type: gettext/rfc822deb] foomatic-filters.templates diff --git a/debian/po/de.po b/debian/po/de.po new file mode 100644 index 0000000..223c582 --- /dev/null +++ b/debian/po/de.po @@ -0,0 +1,261 @@ +# translation of foomatic-filters_3.0.1-20040506-2_templates.po to German +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans# +# Developers do not need to manually edit POT or PO files. +# Erik Schanze <mail@erikschanze.de>, 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: foomatic-filters_3.0.1-20040621-1_de\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2004-06-14 03:08-0500\n" +"PO-Revision-Date: 2004-06-28 08:43+0200\n" +"Last-Translator: Erik Schanze <mail@erikschanze.de>\n" +"Language-Team: German <debian-l10n-german@lists.debian.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.3.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "Enable logging debug output into a logfile (INSECURE)." +msgstr "Debug-Ausgaben in die Protokolldatei schreiben (unsicher)?" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "The logfile will be named /tmp/foomatic-rip.log." +msgstr "Die Protokolldatei wird /tmp/foomatic-rip.log genannt." + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "" +"WARNING: This logfile is a security hole; do not use in production. However, " +"if you are having trouble printing, you should enable this option and " +"include this logfile in any bug reports." +msgstr "" +"ACHTUNG: Diese Protokolldatei ist eine Sicherheitslücke; benutzen Sie das " +"nicht in Produktivumgebungen. Wenn Sie Probleme beim Drucken haben, sollten " +"Sie diese Option trotzdem einschalten und die Protokolldatei Ihrem " +"Fehlerbericht beifügen." + +#. Type: select +#. Choices +#: ../foomatic-filters.templates:13 +msgid "Automagic, a2ps, mpage, enscript, Custom" +msgstr "Automatisch, a2ps, mpage, enscript, Benutzereinstellung" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "Command for converting text files to PostScript" +msgstr "Kommando für Umwandlung von Textdateien in PostScript" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"If you select ``Automagic'', Foomatic will search for one of a2ps, mpage, " +"and enscript (in that order) each time the filter script is executed." +msgstr "" +"Wenn Sie \"Automatisch\" auswählen, sucht Foomatic bei jedem Aufruf des " +"Filterskripts eins der Programme a2ps, mpage, und enscript (in dieser " +"Reihenfolge)." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"Please make sure that the selected command is actually available; otherwise " +"print jobs may get lost." +msgstr "" +"Stellen Sie sicher, dass das ausgewählte Kommando verfügbar ist, sonst " +"können Druckaufträge verloren gehen." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"This setting is ignored when foomatic-filters is used with CUPS; instead, " +"the texttops program included in the cupsys package is always used to " +"convert jobs submitted as plain text to PostScript for printing to raster " +"devices." +msgstr "" +"Diese Einstellung hat keine Wirkung, wenn foomatic-filters mit CUPS " +"eingesetzt wird; statt dessen wandelt das in CUPS enthaltene Programm " +"texttops Druckaufträge von Klartext in PostScript um, damit Sie mit Raster-" +"Geräten ausgedruckt werden können." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "Command to convert standard input to PostScript." +msgstr "Kommando für Umwandlung von der Standardeingabe in PostScript." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"This should be the full command line of a command that converts text from " +"standard input to PostScript on standard output." +msgstr "" +"Geben Sie den vollständigen Aufruf eines Kommandos ein, das Text von der " +"Standardeingabe einliest und als PostScript auf der Standardausgabe ausgibt." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"Please note that entering an invalid command line here may result in lost " +"print jobs." +msgstr "" +"Bitte beachten Sie , dass ein ungültiges Kommando zum Verlust der " +"Druckaufträge führen kann." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"There are some special tags available usable on the filter command line. " +"See the filter.conf manpage for details." +msgstr "" +"In der Kommandozeile des Filters können einige spezielle Kürzel angegeben " +"werden. Mehr Informationen finden Sie in der Manpage von filter.conf." + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "Enable PostScript accounting for CUPS" +msgstr "PostScript-Abrechnung (accounting) für CUPS einschalten?" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "" +"Insert PostScript code for accounting into each print job. This currently " +"only works with CUPS." +msgstr "" +"PostScript-Kommandos für die Abrechnung in jeden Druckauftrag einbauen. Das " +"funktioniert derzeit nur mit CUPS." + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "" +"Note: When used with generic PostScript printers (and under certain " +"conditions with other printers also) this causes an extra page to be printed " +"after each job, so this is off by default." +msgstr "" +"Beachten Sie: Wenn Sie generische PostScript-Drucker (und manchmal auch bei " +"anderen Druckern) einsetzen, wird nach jedem Druckauftrag eine zusätzliche " +"Seite ausgedruckt, deshalb ist diese Option normalerweise ausgeschaltet." + +#. Type: select +#. Choices +#: ../foomatic-filters.templates:53 +msgid "gs, gs-gnu, gs-esp, gs-afpl, Custom" +msgstr "gs, gs-gnu, gs-esp, gs-afpl, Benutzereinstellung" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "Which Ghostscript interpreter should be used by Foomatic?" +msgstr "Welchen Ghostscript-Interpreter soll foomatic nutzen?" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "" +"For non-PostScript printers, print jobs are usually translated from " +"PostScript to your printer's command language using the free Ghostscript " +"interpreter." +msgstr "" +"Für Drucker, die kein PostScript verstehen, werden Druckaufträge " +"normalerweise mit einem freien Ghostscript-Interpreter von PostScript in die " +"Kommando-Sprache des Druckers übersetzt." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "" +"There are a number of different versions of the Ghostscript interpreter " +"available on Debian systems. Normally, Foomatic will use the default " +"version (configured by the `gs' alternative, which can be changed with " +"`update-alternatives --config gs'). However, you may want to use a " +"different Ghostscript for screen display than for printing. (You should use " +"the Custom option if you have a locally-installed Ghostscript interpreter.)" +msgstr "" +"Auf einem Debian-System gibt es viele verschiedene Ghostscript-Interpreter. " +"Normalerweise nutzt foomatic den Standard-Interpreter, der als 'gs'-" +"Alternative eingestellt ist. Das können Sie durch das Kommando 'update-" +"alternatives --config gs' ändern. Wenn Sie für das Drucken einen anderen " +"Ghostscript-Interpreter als für die Anzeige am Bildschirm verwenden wollen, " +"sollten Sie die Option \"Benutzereinstellung\" für einen anderen Ghostscript-" +"Interpreter wählen." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "If in doubt, you should simply accept the default option (gs)." +msgstr "Wenn Sie sich nicht sicher sind, wählen Sie den Standard (gs) aus." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:73 +msgid "Custom Ghostscript interpreter path." +msgstr "Pfad zum Ghostscript-Interpreter für Benutzereinstellung" + +#. Type: string +#. Description +#: ../foomatic-filters.templates:73 +msgid "" +"You should enter the full path to your preferred Ghostscript interpreter; e." +"g. `/opt/artifex.com-ghostscript/bin/gs'." +msgstr "" +"Geben Sie den vollständigen Pfad zu Ihrem bevorzugten Ghostscript-" +"Interpreter ein, z. B. '/opt/artifex.com-ghostscript/bin/gs'." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "Printer spooler backend for Foomatic" +msgstr "Druckerwarteschlange für Foomatic" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "" +"Foomatic normally requires a printer spooler (like CUPS or LPRng) to handle " +"communication with the printer and manage print jobs. If you don't have a " +"spooler installed, you can use the \"direct\" backend, but this is only " +"recommended for single-user systems." +msgstr "" +"Foomatic benötigt normalerweise eine Druckerwarteschlange (wie CUPS oder " +"LPRng) für die Ãœbertragung zum Drucker und die Verwaltung der " +"Druckaufträge. Wenn Sie keinen Druckdienst installiert haben, können Sie " +"die \"direct\"-Anbindung nutzen, aber es wird nur für Einzelbenutzer-System " +"empfohlen." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "" +"The installation process may have already detected the correct spooler; " +"however, if this is the first time you are installing Debian, or you somehow " +"have more than one spooler installed on your system, the detected spooler " +"may be incorrect." +msgstr "" +"Während der Installation sollte schon der richtige Druckdienst erkannt " +"worden sein. Das könnte aber fehlerhaft sein, falls Sie Debian zum ersten " +"Mal installieren oder Sie mehr als einen Druckdienst haben." diff --git a/debian/po/fr.po b/debian/po/fr.po new file mode 100644 index 0000000..e768965 --- /dev/null +++ b/debian/po/fr.po @@ -0,0 +1,269 @@ +# translation of fr.po to French +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# Christian Perrier <bubulle@debian.org>, 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: foomatic-filters 3.0.0.20030907-1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2004-06-14 03:08-0500\n" +"PO-Revision-Date: 2004-06-22 18:41+0200\n" +"Last-Translator: Christian Perrier <bubulle@debian.org>\n" +"Language-Team: French <debian-l10n-french@lists.debian.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.3.1\n" +"Plural-Forms: Plural-Forms: nplurals=2; plural=n>1;\n" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "Enable logging debug output into a logfile (INSECURE)." +msgstr "" +"Faut-il enregistrer les informations de débogage dans un fichier " +"(DANGEREUX) ?" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "The logfile will be named /tmp/foomatic-rip.log." +msgstr "" +"Les informations de débogage peuvent être enregistrées dans le fichier /tmp/" +"foomatic-rip.log." + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "" +"WARNING: This logfile is a security hole; do not use in production. However, " +"if you are having trouble printing, you should enable this option and " +"include this logfile in any bug reports." +msgstr "" +"ATTENTION : ce fichier-journal pose un problème de sécurité : ne l'utilisez " +"pas sur un serveur de production. Cependant, si vous avez des difficultés " +"pour imprimer, vous devriez activer cette option et inclure ce fichier dans " +"vos rapports de bogue." + +#. Type: select +#. Choices +#: ../foomatic-filters.templates:13 +msgid "Automagic, a2ps, mpage, enscript, Custom" +msgstr "automagique, a2ps, mpage, enscript, personnalisée" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "Command for converting text files to PostScript" +msgstr "Commande de conversion des fichiers texte en PostScript :" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"If you select ``Automagic'', Foomatic will search for one of a2ps, mpage, " +"and enscript (in that order) each time the filter script is executed." +msgstr "" +"Si vous choisissez « automagique », l'un des programmes a2ps, mpage ou " +"enscript sera recherché, dans cet ordre, à chaque exécution du filtre." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"Please make sure that the selected command is actually available; otherwise " +"print jobs may get lost." +msgstr "" +"Veuillez vérifier que la commande choisie est réellement disponible, sinon " +"des demandes d'impression peuvent être perdues." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"This setting is ignored when foomatic-filters is used with CUPS; instead, " +"the texttops program included in the cupsys package is always used to " +"convert jobs submitted as plain text to PostScript for printing to raster " +"devices." +msgstr "" +"Avec CUPS, ce réglage sera ignoré. Le programme texttops, inclus dans le " +"paquet cupsys, sera utilisé à la place : il convertit les travaux soumis en " +"format texte brut au format PostScript, pour utilisation avec les " +"périphériques « raster »." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "Command to convert standard input to PostScript." +msgstr "Commande de conversion de l'entrée standard en PostScript :" + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"This should be the full command line of a command that converts text from " +"standard input to PostScript on standard output." +msgstr "" +"Veuillez indiquer la commande complète qui convertira des données texte sur " +"l'entrée standard en données PostScript sur la sortie standard." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"Please note that entering an invalid command line here may result in lost " +"print jobs." +msgstr "" +"Veuillez noter qu'une commande invalide peut entraîner la perte des demandes " +"d'impression." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"There are some special tags available usable on the filter command line. " +"See the filter.conf manpage for details." +msgstr "" +"Certains marqueurs spéciaux peuvent être utilisés sur la ligne de commande " +"du filtre. Veuillez consulter la page de manuel de filter.conf pour obtenir " +"plus de détails." + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "Enable PostScript accounting for CUPS" +msgstr "Faut-il activer la comptabilité PostScript pour CUPS ?" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "" +"Insert PostScript code for accounting into each print job. This currently " +"only works with CUPS." +msgstr "" +"Il est proposé ici d'insérer du code PostScript dans chaque demande " +"d'impression..... Actuellement, cela fonctionne uniquement avec CUPS." + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "" +"Note: When used with generic PostScript printers (and under certain " +"conditions with other printers also) this causes an extra page to be printed " +"after each job, so this is off by default." +msgstr "" +"Note : lorsque cette option est utilisée avec des imprimantes PostScript " +"génériques (et, dans certaines conditions, avec d'autres imprimantes), elle " +"provoque l'impression d'une page supplémentaire après chaque impression. " +"Elle est donc désactivée par défaut." + +#. Type: select +#. Choices +#: ../foomatic-filters.templates:53 +msgid "gs, gs-gnu, gs-esp, gs-afpl, Custom" +msgstr "gs, gs-gnu, gs-esp, gs-afpl, personnalisé" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "Which Ghostscript interpreter should be used by Foomatic?" +msgstr "Interpréteur Ghostscript utilisé par Foomatic :" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "" +"For non-PostScript printers, print jobs are usually translated from " +"PostScript to your printer's command language using the free Ghostscript " +"interpreter." +msgstr "" +"Lors de l'utilisation d'imprimantes non-PostScript, les travaux d'impression " +"sont généralement convertis de PostScript vers le langage de commande de " +"l'imprimante avec l'interpréteur libre Ghostscript." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "" +"There are a number of different versions of the Ghostscript interpreter " +"available on Debian systems. Normally, Foomatic will use the default " +"version (configured by the `gs' alternative, which can be changed with " +"`update-alternatives --config gs'). However, you may want to use a " +"different Ghostscript for screen display than for printing. (You should use " +"the Custom option if you have a locally-installed Ghostscript interpreter.)" +msgstr "" +"Il existe plusieurs versions différentes de l'interpréteur Ghostscript sur " +"les systèmes Debian. Normalement, Foomatic utilisera la version par défaut " +"(l'alternative « gs » configurée avec la commande « update-alternatives --" +"config gs »). Cependant, vous pouvez souhaiter utiliser un interpréteur " +"Ghostscript différent pour l'affichage à l'écran et pour l'impression. Si " +"vous souhaitez utiliser un interpréteur installé localement, vous devriez " +"choisir l'option « personnalisé ». " + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "If in doubt, you should simply accept the default option (gs)." +msgstr "Dans le doute, choisissez l'option par défaut (« gs »)." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:73 +msgid "Custom Ghostscript interpreter path." +msgstr "Chemin d'accès de l'interpréteur Ghostscript personnalisé :" + +#. Type: string +#. Description +#: ../foomatic-filters.templates:73 +msgid "" +"You should enter the full path to your preferred Ghostscript interpreter; e." +"g. `/opt/artifex.com-ghostscript/bin/gs'." +msgstr "" +"Veuillez indiquer le chemin d'accès complet de votre interpréteur " +"Ghostscript. Exemple : « /opt/artifex.com-ghostscript/bin/gs »." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "Printer spooler backend for Foomatic" +msgstr "Gestionnaire d'impression interfacé avec Foomatic :" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "" +"Foomatic normally requires a printer spooler (like CUPS or LPRng) to handle " +"communication with the printer and manage print jobs. If you don't have a " +"spooler installed, you can use the \"direct\" backend, but this is only " +"recommended for single-user systems." +msgstr "" +"Il est usuellement nécessaire d'utiliser un gestionnaire d'impression tel " +"que CUPS ou LPRng pour gérer la communication avec l'imprimante et les " +"travaux d'impression. Si aucun gestionnaire n'est installé, vous pouvez " +"utiliser le choix « direct » ce qui n'est recommandé que pour des systèmes " +"mono-utilisateur." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "" +"The installation process may have already detected the correct spooler; " +"however, if this is the first time you are installing Debian, or you somehow " +"have more than one spooler installed on your system, the detected spooler " +"may be incorrect." +msgstr "" +"La procédure d'installation a probablement détecté le gestionnaire " +"approprié. Cependant, s'il s'agit de votre première installation de Debian " +"ou si plus d'un gestionnaire est installé, celui qui est détecté n'est peut-" +"être pas le bon." diff --git a/debian/po/ja.po b/debian/po/ja.po new file mode 100644 index 0000000..54456fb --- /dev/null +++ b/debian/po/ja.po @@ -0,0 +1,215 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2004-06-14 03:08-0500\n" +"PO-Revision-Date: 2004-06-25 09:06+0900\n" +"Last-Translator: Kenshi Muto <kmuto@debian.org>\n" +"Language-Team: Japanese <debian-japanese@lists.debian.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=EUC-JP\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "Enable logging debug output into a logfile (INSECURE)." +msgstr "¥í¥°¥Õ¥¡¥¤¥ë¤Ø¤Î¥Ç¥Ð¥Ã¥°½ÐÎϤò͸ú¤Ë¤·¤Þ¤¹¤« (´í¸±)¡£" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "The logfile will be named /tmp/foomatic-rip.log." +msgstr "¥í¥°¥Õ¥¡¥¤¥ë¤Ï /tmp/foomatic-rip.log ¤È̾ÉÕ¤±¤é¤ì¤Þ¤¹¡£" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "" +"WARNING: This logfile is a security hole; do not use in production. However, " +"if you are having trouble printing, you should enable this option and " +"include this logfile in any bug reports." +msgstr "*·Ù¹ð*: ¥í¥°¥Õ¥¡¥¤¥ë¤Ï¥»¥¥å¥ê¥Æ¥£¥Û¡¼¥ë¤È¤Ê¤ê¤Þ¤¹¡£À½Éʱ¿ÍѤǤÏÍøÍѤ·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£¤·¤«¤·¡¢°õºþ»þ¤ËÌäÂ꤬¤¢¤Ã¤¿¤È¤¤Ë¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò͸ú¤Ë¤·¤Æ¡¢¥Ð¥°¥ê¥Ý¡¼¥È¤Ë¤³¤Î¥í¥°¥Õ¥¡¥¤¥ë¤ò´Þ¤á¤ë¤È¤è¤¤¤Ç¤·¤ç¤¦¡£" + +#. Type: select +#. Choices +#: ../foomatic-filters.templates:13 +msgid "Automagic, a2ps, mpage, enscript, Custom" +msgstr "Automagic, a2ps, mpage, enscript, ¥«¥¹¥¿¥à" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "Command for converting text files to PostScript" +msgstr "¥Æ¥¥¹¥È¥Õ¥¡¥¤¥ë¤«¤é PostScript ¤Ø¤ÎÊÑ´¹¤ò¹Ô¤¦¥³¥Þ¥ó¥É¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"If you select ``Automagic'', Foomatic will search for one of a2ps, mpage, " +"and enscript (in that order) each time the filter script is executed." +msgstr "`Automagic' ¤òÁª¤Ö¤È¡¢foomatic ¤Ï¥Õ¥£¥ë¥¿¥¹¥¯¥ê¥×¥È¤¬¼Â¹Ô¤µ¤ì¤ë¤¿¤Ó¤Ë¡¢a2ps¡¢mpage¡¢enscript ¤Î½ç¤Ë¸¡º÷¤·¤Þ¤¹¡£" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"Please make sure that the selected command is actually available; otherwise " +"print jobs may get lost." +msgstr "ÁªÂò¤µ¤ì¤¿¥³¥Þ¥ó¥É¤¬¼ÂºÝ¤ËÍøÍѲÄǽ¤Ç¤¢¤ë¤³¤È¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£¤µ¤â¤Ê¤¤¤È¡¢°õºþ¥¸¥ç¥Ö¤ò¼º¤¦¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"This setting is ignored when foomatic-filters is used with CUPS; instead, " +"the texttops program included in the cupsys package is always used to " +"convert jobs submitted as plain text to PostScript for printing to raster " +"devices." +msgstr "foomatic-filters ¤Ï CUPS ¤È¶¦¤Ë»È¤¦¤È¤¤Ë¤Ï¡¢¤³¤ÎÀßÄê¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£Âå¤ï¤ê¤Ë cupsys ¥Ñ¥Ã¥±¡¼¥¸¤ËÆþ¤Ã¤Æ¤¤¤ë texttops ¥×¥í¥°¥é¥à¤¬¾ï¤Ë¡¢¥×¥ì¥¤¥ó¥Æ¥¥¹¥È¤È¤·¤ÆÍ¿¤¨¤é¤ì¤¿¥¸¥ç¥Ö¤ò¥é¥¹¥¿¡¼¥Ç¥Ð¥¤¥¹¤Ë°õºþ¤¹¤ë¤¿¤á¤Î PostScript ¤Ø¤ÎÊÑ´¹¤Ë»È¤ï¤ì¤Þ¤¹¡£" + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "Command to convert standard input to PostScript." +msgstr "ɸ½àÆþÎϤò PostScript ¤ËÊÑ´¹¤¹¤ë¥³¥Þ¥ó¥É¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£" + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"This should be the full command line of a command that converts text from " +"standard input to PostScript on standard output." +msgstr "¤³¤³¤Ë¤Ï¡¢É¸½àÆþÎϤ«¤é¤Î¥Ç¡¼¥¿¤ò PostScript ¤Îɸ½à½ÐÎϤȤ·¤ÆÊÑ´¹¤¹¤ë¥³¥Þ¥ó¥É¤Î´°Á´¤Ê¥³¥Þ¥ó¥É¥é¥¤¥ó¤ò»ØÄꤷ¤Þ¤¹¡£" + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"Please note that entering an invalid command line here may result in lost " +"print jobs." +msgstr "¤³¤³¤Ë¸í¤Ã¤¿¥³¥Þ¥ó¥É¥é¥¤¥ó¤òÆþÎϤ·¤Æ¤·¤Þ¤¦¤È¡¢°õºþ¥¸¥ç¥Ö¤ò¼º¤¦¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£" + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"There are some special tags available usable on the filter command line. " +"See the filter.conf manpage for details." +msgstr "¥Õ¥£¥ë¥¿¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë¤¤¤¯¤Ä¤«¤ÎÊØÍø¤ÇÆÃÊ̤ʥ¿¥°¤òÍøÍѤǤ¤Þ¤¹¡£¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï filter.conf ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "Enable PostScript accounting for CUPS" +msgstr "CUPS ¤Î PostScript ¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¤ò͸ú¤Ë¤·¤Þ¤¹¤«¡£" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "" +"Insert PostScript code for accounting into each print job. This currently " +"only works with CUPS." +msgstr "³Æ°õºþ¥¸¥ç¥Ö¤Ë¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¤ò¹Ô¤¦ PostScript ¥³¡¼¥É¤òÁÞÆþ¤·¤Þ¤¹¡£¤³¤ì¤Ï¸½ºß¤Î¤È¤³¤í¡¢CUPS ¾å¤Ç¤Î¤ßÆ°ºî¤·¤Þ¤¹¡£" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "" +"Note: When used with generic PostScript printers (and under certain " +"conditions with other printers also) this causes an extra page to be printed " +"after each job, so this is off by default." +msgstr "Ãí°Õ: °ìÈ̤ΠPostScript ¥×¥ê¥ó¥¿ (¤ª¤è¤Ó¤Û¤«¤Î¥×¥ê¥ó¥¿¤Ç¤âÀµ¤·¤¤¾õÂ֤Ǥ¢¤ì¤Ð) ¤ò»È¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢³Æ¥¸¥ç¥Ö¤Î¤¢¤È¤Ë;ʬ¤Ê¥Ú¡¼¥¸¤¬°õºþ¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£¤³¤Î¤¿¤á¡¢¤³¤Îµ¡Ç½¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï̵¸ú¤Ë¤·¤Æ¤¢¤ê¤Þ¤¹¡£" + +#. Type: select +#. Choices +#: ../foomatic-filters.templates:53 +msgid "gs, gs-gnu, gs-esp, gs-afpl, Custom" +msgstr "gs, gs-gnu, gs-esp, gs-afpl, ¥«¥¹¥¿¥à" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "Which Ghostscript interpreter should be used by Foomatic?" +msgstr "Foomatic ¤Ç»È¤¤¤¿¤¤ Ghostscript ¥¤¥ó¥¿¥×¥ê¥¿¤Ï¤É¤ì¤Ç¤¹¤«?" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "" +"For non-PostScript printers, print jobs are usually translated from " +"PostScript to your printer's command language using the free Ghostscript " +"interpreter." +msgstr "Èó PostScript ¥×¥ê¥ó¥¿¤Ç¤Ï¡¢°õºþ¥¸¥ç¥Ö¤ÏÄ̾ï PostScript ¤«¤é¤¢¤Ê¤¿¤Î¥×¥ê¥ó¥¿¤Î¥³¥Þ¥ó¥É¸À¸ì¤Ë¥Õ¥ê¡¼¤Î Ghostscript ¥¤¥ó¥¿¥×¥ê¥¿¤ò»È¤Ã¤ÆÊÑ´¹¤µ¤ì¤Þ¤¹¡£" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "" +"There are a number of different versions of the Ghostscript interpreter " +"available on Debian systems. Normally, Foomatic will use the default " +"version (configured by the `gs' alternative, which can be changed with " +"`update-alternatives --config gs'). However, you may want to use a " +"different Ghostscript for screen display than for printing. (You should use " +"the Custom option if you have a locally-installed Ghostscript interpreter.)" +msgstr "Debian ¥·¥¹¥Æ¥à¤Ë¤Ï°Û¤Ê¤ë¥Ð¡¼¥¸¥ç¥ó¤Î Ghostscript ¥¤¥ó¥¿¥×¥ê¥¿¤¬¤¤¤¯¤Ä¤«¤¢¤ê¤Þ¤¹¡£Ä̾Foomatic ¤Ï¥Ç¥Õ¥©¥ë¥È¥Ð¡¼¥¸¥ç¥ó (`update-alternatives --config gs' ¤ÇÊѹ¹²Äǽ¤Ê¡¢`gs' ¥ª¥ë¥¿¥Ê¥Æ¥£¥Ö¤È¤·¤ÆÀßÄꤵ¤ì¤ë¤â¤Î) ¤ò»È¤¤¤Þ¤¹¡£¤·¤«¤·¡¢°õºþ»þ¤È²èÌÌɽ¼¨¤Ç°Û¤Ê¤ë Ghostscript ¤ò»È¤¤¤¿¤¤¤³¤È¤â¤¢¤ë¤Ç¤·¤ç¤¦ (¥í¡¼¥«¥ë¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿ Ghostscript ¥¤¥ó¥¿¥×¥ê¥¿¤ò»ý¤Ã¤Æ¤¤¤ë¤Î¤Ç¤¢¤ì¤Ð¡¢¡Ö¥«¥¹¥¿¥à¡×¤òÁª¤Ó¤Þ¤¹)¡£" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "If in doubt, you should simply accept the default option (gs)." +msgstr "¤è¤¯¤ï¤«¤é¤Ê¤±¤ì¤Ð¡¢¥Ç¥Õ¥©¥ë¥È¤ÎÁªÂò»è (gs) ¤òñ¤Ë¼õ¤±Æþ¤ì¤Æ¤¯¤À¤µ¤¤¡£" + +#. Type: string +#. Description +#: ../foomatic-filters.templates:73 +msgid "Custom Ghostscript interpreter path." +msgstr "Ghostscript ¥¤¥ó¥¿¥×¥ê¥¿¤Î¥Ñ¥¹¤ò¥«¥¹¥¿¥Þ¥¤¥º¤·¤Æ¤¯¤À¤µ¤¤¡£" + +#. Type: string +#. Description +#: ../foomatic-filters.templates:73 +msgid "" +"You should enter the full path to your preferred Ghostscript interpreter; e." +"g. `/opt/artifex.com-ghostscript/bin/gs'." +msgstr "ÍøÍѤ·¤¿¤¤ Ghostscript ¥¤¥ó¥¿¥×¥ê¥¿¤Î¥Õ¥ë¥Ñ¥¹ (¤¿¤È¤¨¤Ð '/opt/artifex.com-ghostscript/bin/gs') ¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "Printer spooler backend for Foomatic" +msgstr "Foomatic ¤Î¥×¥ê¥ó¥¿¥¹¥×¡¼¥é¥Ð¥Ã¥¯¥¨¥ó¥É" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "" +"Foomatic normally requires a printer spooler (like CUPS or LPRng) to handle " +"communication with the printer and manage print jobs. If you don't have a " +"spooler installed, you can use the \"direct\" backend, but this is only " +"recommended for single-user systems." +msgstr "Foomatic ¤ÏÄ̾¥×¥ê¥ó¥¿¤È¤ÎÁê¸ßÄÌ¿®¤ä°õºþ¥¸¥ç¥Ö¤Î´ÉÍý¤ÎÌÌÅݤò¸«¤ë¥×¥ê¥ó¥¿¥¹¥×¡¼¥é (CUPS ¤Þ¤¿¤Ï LPRng ¤Ê¤É) ¤òɬÍפȤ·¤Þ¤¹¡£¥¹¥×¡¼¥é¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢\"direct\" ¥Ð¥Ã¥¯¥¨¥ó¥É¤ò»È¤¦¤³¤È¤â¤Ç¤¤Þ¤¹¤¬¡¢¤³¤ì¤Ïñ°ì¥æ¡¼¥¶¤Î¥·¥¹¥Æ¥à°Ê³°¤Ë¤Ï¤ª´«¤á¤·¤Þ¤»¤ó¡£" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "" +"The installation process may have already detected the correct spooler; " +"however, if this is the first time you are installing Debian, or you somehow " +"have more than one spooler installed on your system, the detected spooler " +"may be incorrect." +msgstr "¥¤¥ó¥¹¥È¡¼¥ë¥×¥í¥»¥¹¤Ï¤¹¤Ç¤ËÀµ¤·¤¤¥¹¥×¡¼¥é¤ò¸¡½Ð¤·¤Æ¤¤¤ë¤Ï¤º¤Ç¤¹¡£¤·¤«¤·¡¢¤³¤ì¤¬ Debian ¤Î½é´ü¥¤¥ó¥¹¥È¡¼¥ëÃʳ¬¤Ç¤¢¤ë¤«¡¢²¿¤é¤«¤ÎÍýͳ¤Ç¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¤Ë 1 ¤Ä°Ê¾å¤Î¥¹¥×¡¼¥é¤¬¤¢¤ë¤È¡¢¸¡½Ð¤µ¤ì¤¿¥¹¥×¡¼¥é¤Ï¸í¤Ã¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£" diff --git a/debian/po/nl.po b/debian/po/nl.po new file mode 100644 index 0000000..ced0032 --- /dev/null +++ b/debian/po/nl.po @@ -0,0 +1,260 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +msgid "" +msgstr "" +"Project-Id-Version: foomatic-filters 3.0.1-6\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2004-06-14 03:08-0500\n" +"PO-Revision-Date: 2004-06-15 17:52+0100\n" +"Last-Translator: Luk Claes <luk.claes@ugent.be>\n" +"Language-Team: Debian l10n Dutch <debian-l10n-dutch@lists.debian.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "Enable logging debug output into a logfile (INSECURE)." +msgstr "" +"Logging van debuguitvoer aanschakelen in een logboekbestand (ONVEILIG)." + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "The logfile will be named /tmp/foomatic-rip.log." +msgstr "Het logboekbestand zal /tmp/foomatic-rip.log genoemd worden." + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "" +"WARNING: This logfile is a security hole; do not use in production. However, " +"if you are having trouble printing, you should enable this option and " +"include this logfile in any bug reports." +msgstr "" +"WAARSCHUWING: Dit logboekbestand is een veiligheidslek; gebruik het niet in " +"een productie-omgeving. Hoewel, als u printproblemen hebt, moet u deze optie " +"aanschakelen en dit logboekbestand invoegen in het bugrapport." + +#. Type: select +#. Choices +#: ../foomatic-filters.templates:13 +msgid "Automagic, a2ps, mpage, enscript, Custom" +msgstr "Magisch, a2ps, mpage, enscript, ander programma" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "Command for converting text files to PostScript" +msgstr "Commando om tekstbestanden te converteren naar PostScript" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"If you select ``Automagic'', Foomatic will search for one of a2ps, mpage, " +"and enscript (in that order) each time the filter script is executed." +msgstr "" +"Als u ``Magisch'' selecteert, dan zal Foomatic zoeken achter één van a2ps, " +"mpage of enscript (in die volgorde) elke keer dat het filterscript wordt " +"uigevoerd." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"Please make sure that the selected command is actually available; otherwise " +"print jobs may get lost." +msgstr "" +"Zorg ervoor dat het geselecteerde commando aanwezig is; anders kunnen er " +"printjobs verloren gaan." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"This setting is ignored when foomatic-filters is used with CUPS; instead, " +"the texttops program included in the cupsys package is always used to " +"convert jobs submitted as plain text to PostScript for printing to raster " +"devices." +msgstr "" +"Deze instelling wordt genegeerd wanneer foomatic-filters wordt gebruikt met " +"CUPS; dan wordt altijd het texttops-programma uit het cupsys-pakket gebruikt " +"om jobs die doorgegeven zijn als platte tekst te converteren naar PostScript " +"om te printen naar raster-apparaten." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "Command to convert standard input to PostScript." +msgstr "Commando om standaardinvoer te converteren naar PostScript." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"This should be the full command line of a command that converts text from " +"standard input to PostScript on standard output." +msgstr "" +"Dit moet de volledige commandolijn zijn van een commando dat tekst van " +"standaardinvoer converteert naar PostScript op standaarduitvoer." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"Please note that entering an invalid command line here may result in lost " +"print jobs." +msgstr "" +"Merk op dat het ingeven van een ongeldige commandolijn kan resulteren in " +"verloren printjobs." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"There are some special tags available usable on the filter command line. " +"See the filter.conf manpage for details." +msgstr "" +"Er zijn enkele speciale tags aanwezig om te gebruiken op de filter-" +"commandolijn. Zie de filter.conf-manpage voor details." + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "Enable PostScript accounting for CUPS" +msgstr "PostScript-boekhouding aanschakelen voor CUPS" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "" +"Insert PostScript code for accounting into each print job. This currently " +"only works with CUPS." +msgstr "" +"PostScript-code invoegen voor boekhouding in elke printjob. Dit werkt " +"momenteel enkel met CUPS." + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "" +"Note: When used with generic PostScript printers (and under certain " +"conditions with other printers also) this causes an extra page to be printed " +"after each job, so this is off by default." +msgstr "" +"Let op: wanneer dit gebruikt wordt met algemene PostScript-printers (en " +"onder bepaalde omstandigheden ook met andere printers), veroorzaakt dit een " +"extra te printen pagina na elke job, dus standaard staat dit af." + +#. Type: select +#. Choices +#: ../foomatic-filters.templates:53 +msgid "gs, gs-gnu, gs-esp, gs-afpl, Custom" +msgstr "gs, gs-gnu, gs-esp, gs-afpl, ander programma" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "Which Ghostscript interpreter should be used by Foomatic?" +msgstr "Welke Ghostscript-vertolker moet worden gebruikt door Foomatic?" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "" +"For non-PostScript printers, print jobs are usually translated from " +"PostScript to your printer's command language using the free Ghostscript " +"interpreter." +msgstr "" +"Voor niet-PostScript-printers, worden printjobs normaalgesproken vertaald " +"van PostScript naar de commandotaal van uw printer gebruikmakend van de " +"vrije Ghostscript-vertolker." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "" +"There are a number of different versions of the Ghostscript interpreter " +"available on Debian systems. Normally, Foomatic will use the default " +"version (configured by the `gs' alternative, which can be changed with " +"`update-alternatives --config gs'). However, you may want to use a " +"different Ghostscript for screen display than for printing. (You should use " +"the Custom option if you have a locally-installed Ghostscript interpreter.)" +msgstr "" +"Er zijn een aantal verschillende versies van de Ghostscript-vertolker " +"aanwezig op Debian-systemen. Normaal zal Foomatic de standaardversie " +"gebruiken (geconfigureerd door het `gs'-alternatief, dat kan gewijzigd " +"worden door `update-alternatives --config gs'). Hoewel het kan dat u een " +"andere Ghostscript wilt gebruiken voor schermweergave dan voor het printen. " +"(U moet de 'ander programma'-optie gebruiken als u een lokaal-geïnstalleerde " +"Ghostscript-vertolker heeft.)" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "If in doubt, you should simply accept the default option (gs)." +msgstr "" +"In geval van twijfel, moet u gewoon de standaardoptie (gs) aanvaarden)." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:73 +msgid "Custom Ghostscript interpreter path." +msgstr "Pad van de andere Ghostscript-vertolker." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:73 +msgid "" +"You should enter the full path to your preferred Ghostscript interpreter; e." +"g. `/opt/artifex.com-ghostscript/bin/gs'." +msgstr "" +"U moet het volledige pad naar uw geprefereerde Ghostscript-vertolker " +"ingeven; v.b. `/opt/artifex.com-ghostscript/bin/gs'." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "Printer spooler backend for Foomatic" +msgstr "Achtergronddienst voor printspooling voor Foomatic" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "" +"Foomatic normally requires a printer spooler (like CUPS or LPRng) to handle " +"communication with the printer and manage print jobs. If you don't have a " +"spooler installed, you can use the \"direct\" backend, but this is only " +"recommended for single-user systems." +msgstr "" +"Foomatic vereist normaal een printspooler (zoals CUPS of LPRng) om " +"communicatie met de printer te doen en om printjobs te beheren. Als u geen " +"printspooler heeft geïnstalleerd, dan kunt u de \"direct\"-achtergronddienst " +"gebruiken, maar dat is enkel aangeraden voor één-gebruiker-systemen." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "" +"The installation process may have already detected the correct spooler; " +"however, if this is the first time you are installing Debian, or you somehow " +"have more than one spooler installed on your system, the detected spooler " +"may be incorrect." +msgstr "" +"Het installatieproces heeft misschien reeds de correcte spooler " +"gedetecteerd; echer, als dit de eerste keer is dat u Debian installeert, of " +"u hebt meer dan één spooler geïnstalleerd op uw systeem, dan is de " +"gedetecteerde spooler misschien niet correct." diff --git a/debian/po/pt_BR.po b/debian/po/pt_BR.po new file mode 100644 index 0000000..21eb25e --- /dev/null +++ b/debian/po/pt_BR.po @@ -0,0 +1,261 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: foomatic-filters\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2004-06-14 03:08-0500\n" +"PO-Revision-Date: 2004-06-05 19:59-0500\n" +"Last-Translator: André Luís Lopes <andrelop@debian.org>\n" +"Language-Team: Debian-BR Project <debian-l10n-portuguese@lists.debian.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "Enable logging debug output into a logfile (INSECURE)." +msgstr "Habilitar o logging de depuração para um arquivo (INSEGURO)." + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "The logfile will be named /tmp/foomatic-rip.log." +msgstr "O arquivo de log será nomeado como /tmp/foomatic-rip.log." + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "" +"WARNING: This logfile is a security hole; do not use in production. However, " +"if you are having trouble printing, you should enable this option and " +"include this logfile in any bug reports." +msgstr "" +"AVISO : Esse arquivo de log é uma falha de seurança; não o utilize em " +"produção. Porém, caso você esteja tendo problemas com impressão, você deverá " +"habilitá-lo e incluí-lo em seus relatórios de bugs." + +#. Type: select +#. Choices +#: ../foomatic-filters.templates:13 +msgid "Automagic, a2ps, mpage, enscript, Custom" +msgstr "Automagic, a2ps, mpage, enscript, Personalizado" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "Command for converting text files to PostScript" +msgstr "Comando para converter arquivos texto para Postscript" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"If you select ``Automagic'', Foomatic will search for one of a2ps, mpage, " +"and enscript (in that order) each time the filter script is executed." +msgstr "" +"Caso você selecione ``Automagic'', o Foomatic irá procurar por um dos " +"comandos a2ps, mpage e enscript (nesta ordem) a cada vez que o script de " +"filtro for executado." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"Please make sure that the selected command is actually available; otherwise " +"print jobs may get lost." +msgstr "" +"Por favor, certifique-se de que o comando selecionado realmente esteja " +"disponível ou seus jobs de impressão podem ser perdidos." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"This setting is ignored when foomatic-filters is used with CUPS; instead, " +"the texttops program included in the cupsys package is always used to " +"convert jobs submitted as plain text to PostScript for printing to raster " +"devices." +msgstr "" +"Esta configuração é ignorada quando o foomatic-filters é usado com o CUPS. " +"Ao invés dessa configuração, o programa texttops incluído no pacote cupsys " +"será sempre usado para converter jobs submetidos como texto puro para " +"Postscript, para impressão em dispositivos raster." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "Command to convert standard input to PostScript." +msgstr "Comando para converter a entrada padrão para Postscript." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"This should be the full command line of a command that converts text from " +"standard input to PostScript on standard output." +msgstr "" +"A linha de comando completa de um comando que converta texto recebido na " +"entrada padrão para Postscript na saída padrão deve ser informada." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"Please note that entering an invalid command line here may result in lost " +"print jobs." +msgstr "" +"Por favor, note que informar uma linha de comando inválida poderá resultar " +"em jobs de impressão perdidos." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"There are some special tags available usable on the filter command line. " +"See the filter.conf manpage for details." +msgstr "" +"Existem algums tags especiais disponíveis que podem ser usadas na linha de " +"comando do filtro. Consulte a página de manual filter.conf para maiores " +"detalhes." + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "Enable PostScript accounting for CUPS" +msgstr "Habilitar a contabilidade Postscript para o CUPS" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "" +"Insert PostScript code for accounting into each print job. This currently " +"only works with CUPS." +msgstr "" +"Insira o código Postscript para contabilidade em cada job de impressão. " +"Isso, no momento, funciona somente com o CUPS." + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "" +"Note: When used with generic PostScript printers (and under certain " +"conditions with other printers also) this causes an extra page to be printed " +"after each job, so this is off by default." +msgstr "" +"Nota : Quando usado com impressoras Postscript genéricas (e sob certas " +"condições, também com outras impressoras) isso faz com que uma página extra " +"seja impressa a cada job, por isso está desabilitado por padrão." + +#. Type: select +#. Choices +#: ../foomatic-filters.templates:53 +msgid "gs, gs-gnu, gs-esp, gs-afpl, Custom" +msgstr "gs, gs-gnu, gs-esp, gs-afpl, Personalizado" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "Which Ghostscript interpreter should be used by Foomatic?" +msgstr "Qual interpretador Ghostscript deverá ser usado pelo Foomatic ?" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "" +"For non-PostScript printers, print jobs are usually translated from " +"PostScript to your printer's command language using the free Ghostscript " +"interpreter." +msgstr "" +"Para impressoras não-Postscript, os jobs de impressão são normalmente " +"traduzidos de Postscript para a linguagem de comandos de sua impressora " +"usando um interpretador Ghostscript livre." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "" +"There are a number of different versions of the Ghostscript interpreter " +"available on Debian systems. Normally, Foomatic will use the default " +"version (configured by the `gs' alternative, which can be changed with " +"`update-alternatives --config gs'). However, you may want to use a " +"different Ghostscript for screen display than for printing. (You should use " +"the Custom option if you have a locally-installed Ghostscript interpreter.)" +msgstr "" +"Existem diversas versões diferentes do interpretador Ghostscript disponíveis " +"em sistemas Debian. Normalmente, o Foomatic irá utilizar a versão padrão " +"(configurada pela alternativa `gs', a qual pode ser modificada com o comando " +"`update-alternatives --config gs'). Porém, para exibição em vídeo, você pode " +"desejar usar um Ghostscript diferente do Ghostcript usado para impressão. " +"(Você deverá usar a opção Personalizado caso você possua um interpretador " +"Ghostscript instalado localmente.)" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "If in doubt, you should simply accept the default option (gs)." +msgstr "" +"Em caso de dúvidas, você deverá simplesmente aceitar a opção padrão (gs)." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:73 +msgid "Custom Ghostscript interpreter path." +msgstr "Caminho do interpretador Ghostscript personalizado." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:73 +msgid "" +"You should enter the full path to your preferred Ghostscript interpreter; e." +"g. `/opt/artifex.com-ghostscript/bin/gs'." +msgstr "" +"Informe o caminho completo para o intepretador Ghostscript preferido; por " +"exemplo, `/opt/artifex.com-ghostscript/bin/gs'." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "Printer spooler backend for Foomatic" +msgstr "Backend do spooler de impressão para o Foomatic" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "" +"Foomatic normally requires a printer spooler (like CUPS or LPRng) to handle " +"communication with the printer and manage print jobs. If you don't have a " +"spooler installed, you can use the \"direct\" backend, but this is only " +"recommended for single-user systems." +msgstr "" +"O Foomatic normalmente requer um spooler de impressão (como o CUPS ou o " +"LPRng) para gerenciar a comunicação com a impressora e os jobs de impressão. " +"Caso você não possua um spooler instalado você pode usar o backend \"direct" +"\", mas isso é recomendado somente para sistemas com apenas um usuário." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "" +"The installation process may have already detected the correct spooler; " +"however, if this is the first time you are installing Debian, or you somehow " +"have more than one spooler installed on your system, the detected spooler " +"may be incorrect." +msgstr "" +"O processo de instalação pode já ter detectado o spooler correto. Porém, " +"caso esta seja a primeira vez que você esteja instalando o Debian ou caso " +"você possua mais de um spooler instalado em seu sistema, o spooler detectado " +"pode não ser o correto." diff --git a/debian/po/templates.pot b/debian/po/templates.pot new file mode 100644 index 0000000..5c71cdd --- /dev/null +++ b/debian/po/templates.pot @@ -0,0 +1,216 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2004-06-14 03:08-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "Enable logging debug output into a logfile (INSECURE)." +msgstr "" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "The logfile will be named /tmp/foomatic-rip.log." +msgstr "" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "" +"WARNING: This logfile is a security hole; do not use in production. However, " +"if you are having trouble printing, you should enable this option and " +"include this logfile in any bug reports." +msgstr "" + +#. Type: select +#. Choices +#: ../foomatic-filters.templates:13 +msgid "Automagic, a2ps, mpage, enscript, Custom" +msgstr "" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "Command for converting text files to PostScript" +msgstr "" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"If you select ``Automagic'', Foomatic will search for one of a2ps, mpage, " +"and enscript (in that order) each time the filter script is executed." +msgstr "" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"Please make sure that the selected command is actually available; otherwise " +"print jobs may get lost." +msgstr "" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"This setting is ignored when foomatic-filters is used with CUPS; instead, " +"the texttops program included in the cupsys package is always used to " +"convert jobs submitted as plain text to PostScript for printing to raster " +"devices." +msgstr "" + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "Command to convert standard input to PostScript." +msgstr "" + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"This should be the full command line of a command that converts text from " +"standard input to PostScript on standard output." +msgstr "" + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"Please note that entering an invalid command line here may result in lost " +"print jobs." +msgstr "" + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"There are some special tags available usable on the filter command line. " +"See the filter.conf manpage for details." +msgstr "" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "Enable PostScript accounting for CUPS" +msgstr "" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "" +"Insert PostScript code for accounting into each print job. This currently " +"only works with CUPS." +msgstr "" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "" +"Note: When used with generic PostScript printers (and under certain " +"conditions with other printers also) this causes an extra page to be printed " +"after each job, so this is off by default." +msgstr "" + +#. Type: select +#. Choices +#: ../foomatic-filters.templates:53 +msgid "gs, gs-gnu, gs-esp, gs-afpl, Custom" +msgstr "" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "Which Ghostscript interpreter should be used by Foomatic?" +msgstr "" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "" +"For non-PostScript printers, print jobs are usually translated from " +"PostScript to your printer's command language using the free Ghostscript " +"interpreter." +msgstr "" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "" +"There are a number of different versions of the Ghostscript interpreter " +"available on Debian systems. Normally, Foomatic will use the default " +"version (configured by the `gs' alternative, which can be changed with " +"`update-alternatives --config gs'). However, you may want to use a " +"different Ghostscript for screen display than for printing. (You should use " +"the Custom option if you have a locally-installed Ghostscript interpreter.)" +msgstr "" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "If in doubt, you should simply accept the default option (gs)." +msgstr "" + +#. Type: string +#. Description +#: ../foomatic-filters.templates:73 +msgid "Custom Ghostscript interpreter path." +msgstr "" + +#. Type: string +#. Description +#: ../foomatic-filters.templates:73 +msgid "" +"You should enter the full path to your preferred Ghostscript interpreter; e." +"g. `/opt/artifex.com-ghostscript/bin/gs'." +msgstr "" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "Printer spooler backend for Foomatic" +msgstr "" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "" +"Foomatic normally requires a printer spooler (like CUPS or LPRng) to handle " +"communication with the printer and manage print jobs. If you don't have a " +"spooler installed, you can use the \"direct\" backend, but this is only " +"recommended for single-user systems." +msgstr "" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "" +"The installation process may have already detected the correct spooler; " +"however, if this is the first time you are installing Debian, or you somehow " +"have more than one spooler installed on your system, the detected spooler " +"may be incorrect." +msgstr "" diff --git a/debian/po/tr.po b/debian/po/tr.po new file mode 100644 index 0000000..e55de86 --- /dev/null +++ b/debian/po/tr.po @@ -0,0 +1,244 @@ +# Turkish translation of foomatic-filters. +# This file is distributed under the same license as the foomatic-filters package. +# Gürkan Aslan <gurkan@iaslan.com>, 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: foomatic-filters\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2004-06-14 03:08-0500\n" +"PO-Revision-Date: 2004-06-05 20:00-0500\n" +"Last-Translator: Gürkan Aslan <gurkan@iaslan.com>\n" +"Language-Team: Turkish <debian-l10n-turkish@lists.debian.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "Enable logging debug output into a logfile (INSECURE)." +msgstr "" +"Bir günlük dosyası içine hata ayıklama çıktısı etkinleÅŸtirme (GÃœVENSÄ°Z)" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "The logfile will be named /tmp/foomatic-rip.log." +msgstr "Günlük dosyası /tmp/foomatik-rip.log olarak adlandırılacak." + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:4 +msgid "" +"WARNING: This logfile is a security hole; do not use in production. However, " +"if you are having trouble printing, you should enable this option and " +"include this logfile in any bug reports." +msgstr "" +"UYARI: Bu günlük dosyası bir güvenlik açığıdır; üretim ortamında " +"kullanmayın. Bununla birlikte, eÄŸer yazdırma sorununuz varsa, bu seçeneÄŸi " +"etkinleÅŸtirmeli ve bu günlük dosyasını bildirilecek her hata raporuna " +"eklemelisiniz." + +#. Type: select +#. Choices +#: ../foomatic-filters.templates:13 +msgid "Automagic, a2ps, mpage, enscript, Custom" +msgstr "Otomatik, a2ps, mpage, enscript, Özel" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "Command for converting text files to PostScript" +msgstr "Metin dosyalarını PostScript'e dönüştürecek komut" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"If you select ``Automagic'', Foomatic will search for one of a2ps, mpage, " +"and enscript (in that order) each time the filter script is executed." +msgstr "" +"EÄŸer ``Otomatik''i seçtiyseniz, süzgeç betiÄŸi her çalıştırıldığında a2ps, " +"mpage ve enscript (bu sırayla) Foomatic tarafından aranacaktır." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"Please make sure that the selected command is actually available; otherwise " +"print jobs may get lost." +msgstr "" +"Lütfen seçili komutun gerçekten uygun olduÄŸuna emin olun, aksi taktirde " +"yazdırma görevleri kaybolabilir." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:15 +msgid "" +"This setting is ignored when foomatic-filters is used with CUPS; instead, " +"the texttops program included in the cupsys package is always used to " +"convert jobs submitted as plain text to PostScript for printing to raster " +"devices." +msgstr "" +"Bu ayarlar, foomatic-filters CUPS tarafından kullanıldığında " +"önemsenmeyecektir. Bunun yerine, cupsys paketi içinde bulunan texttops " +"programı düz metin halinde gönderilen görevleri tarama aygıtlarında " +"yazdırmak amacıyla PostScript'e dönüştürecektir." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "Command to convert standard input to PostScript." +msgstr "Standart girdiyi PostScript'e dönüştürme komutu." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"This should be the full command line of a command that converts text from " +"standard input to PostScript on standard output." +msgstr "" +"Bu komut, standart girdiden gelen metni standart çıktıda Postscript'e " +"dönüştürmekte kullanılacak komutun tam hali olmalıdır." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"Please note that entering an invalid command line here may result in lost " +"print jobs." +msgstr "" +"Burada girilecek geçersiz bir komutun yazdırma görevlerinin kaybolmasına yol " +"açabileceÄŸini lütfen unutmayın." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:30 +msgid "" +"There are some special tags available usable on the filter command line. " +"See the filter.conf manpage for details." +msgstr "" +"Süzgeç komut satırında kullanılabilecek bazı özel imler var. Ayrıntılar " +"için filter.conf kılavuz sayfasına bakın." + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "Enable PostScript accounting for CUPS" +msgstr "CUPS için PostScript muhasebesini etkinleÅŸtir" + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "" +"Insert PostScript code for accounting into each print job. This currently " +"only works with CUPS." +msgstr "" +"Yazdırma muhasebesinde kullanılmak üzere her yazdırma görevine eklenecek " +"olan PostScript kodunu girin. Bu özellik ÅŸu an sadece CUPS ile çalışır." + +#. Type: boolean +#. Description +#: ../foomatic-filters.templates:43 +msgid "" +"Note: When used with generic PostScript printers (and under certain " +"conditions with other printers also) this causes an extra page to be printed " +"after each job, so this is off by default." +msgstr "" +"Not: Bu özellik genel amaçlı PostScript yazıcılarla (ve belirli durumlarda " +"diÄŸer bazı yazıcılarla) kullanıldığında her görevden sonra ek bir sayfanın " +"bastırılmasına neden olacaktır. Bu yüzden bu özellik öntanımlı olarak etkin " +"deÄŸildir." + +#. Type: select +#. Choices +#: ../foomatic-filters.templates:53 +msgid "gs, gs-gnu, gs-esp, gs-afpl, Custom" +msgstr "gs, gs-gnu, gs-esp, gs-afpl, Özel" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "Which Ghostscript interpreter should be used by Foomatic?" +msgstr "Foomatic ile beraber hangi Ghostscript yorumlayıcısı kullanılsın?" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "" +"For non-PostScript printers, print jobs are usually translated from " +"PostScript to your printer's command language using the free Ghostscript " +"interpreter." +msgstr "" +"PostScript olmayan yazıcılar için, genellikle yazdırma görevleri özgür " +"Ghostscript yorumlayıcısı kullanılarak PostScript'ten yazıcınızın komut " +"diline dönüştürülür." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "" +"There are a number of different versions of the Ghostscript interpreter " +"available on Debian systems. Normally, Foomatic will use the default " +"version (configured by the `gs' alternative, which can be changed with " +"`update-alternatives --config gs'). However, you may want to use a " +"different Ghostscript for screen display than for printing. (You should use " +"the Custom option if you have a locally-installed Ghostscript interpreter.)" +msgstr "" +"Debian sistemlerinde her biri farklı sürümlerde bir kaç farklı Ghostscript " +"yorumlayıcısı mevcuttur. Normalde, Foomatic (`update-alternatives --config " +"gs' komutuyla deÄŸiÅŸtirilebilecek 'gs' alternatifinin gösterdiÄŸi) öntanımlı " +"sürümü kullanacaktır. Bununla birlikte, ekran gösterimi için yazdırma " +"iÅŸleminde kullanılanın dışında bir Ghostscript kullanmak isteyebilirsiniz. " +"(EÄŸer yerel olarak kurulu bir Ghostscript yorumlayıcına sahipseniz, Özel " +"seçeneÄŸini kullanmalısınız.)" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:55 +msgid "If in doubt, you should simply accept the default option (gs)." +msgstr "Emin deÄŸilseniz, basitçe öntanımlı seçeneÄŸi kabul etmelisiniz (gs)." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:73 +msgid "Custom Ghostscript interpreter path." +msgstr "Özel Ghostscript yorumlayıcısına ait dosya yolu." + +#. Type: string +#. Description +#: ../foomatic-filters.templates:73 +msgid "" +"You should enter the full path to your preferred Ghostscript interpreter; e." +"g. `/opt/artifex.com-ghostscript/bin/gs'." +msgstr "" +"Tercih ettiÄŸiniz Ghostscript yorumlayıcısının tam yolunu girmelisiniz; ör. `/" +"opt/artifex.com-ghostscript/bin/gs'." + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "Printer spooler backend for Foomatic" +msgstr "" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "" +"Foomatic normally requires a printer spooler (like CUPS or LPRng) to handle " +"communication with the printer and manage print jobs. If you don't have a " +"spooler installed, you can use the \"direct\" backend, but this is only " +"recommended for single-user systems." +msgstr "" + +#. Type: select +#. Description +#: ../foomatic-filters.templates:81 +msgid "" +"The installation process may have already detected the correct spooler; " +"however, if this is the first time you are installing Debian, or you somehow " +"have more than one spooler installed on your system, the detected spooler " +"may be incorrect." +msgstr "" diff --git a/debian/rules b/debian/rules new file mode 100644 index 0000000..57c2611 --- /dev/null +++ b/debian/rules @@ -0,0 +1,113 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +config.status: configure + dh_testdir + # Add here commands to configure the package. +ifneq "$(wildcard /usr/share/misc/config.sub)" "" + cp -f /usr/share/misc/config.sub config.sub +endif +ifneq "$(wildcard /usr/share/misc/config.guess)" "" + cp -f /usr/share/misc/config.guess config.guess +endif + ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc --disable-file-converter-check + + +build: build-stamp + +build-stamp: config.status + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp config.sub config.guess tests/Makefile + + # Add here commands to clean up after the build process. + -$(MAKE) distclean + chmod -x filter.conf + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/foomatic-filters. + $(MAKE) install DESTDIR=$(CURDIR)/debian/foomatic-filters + rm -f $(CURDIR)/debian/foomatic-filters/etc/foomatic/filter.conf* + cp -p debian/parseconfig.pl $(CURDIR)/debian/foomatic-filters/usr/share/foomatic + chmod +x $(CURDIR)/debian/foomatic-filters/usr/share/foomatic/parseconfig.pl + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples filter.conf +# dh_install +# dh_installmenu + dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + (cd $(CURDIR)/debian/foomatic-filters/usr/lib/ppr/lib; ln -s foomatic-rip ppromatic) + (cd $(CURDIR)/debian/foomatic-filters/usr/lib/ppr/interfaces; ln -s foomatic-rip ppromatic) + (cd $(CURDIR)/debian/foomatic-filters/usr/lib/cups/filter; ln -s foomatic-rip cupsomatic) + (cd $(CURDIR)/debian/foomatic-filters/usr/sbin; ln -s ../bin/foomatic-rip lpdomatic) + (cd $(CURDIR)/debian/foomatic-filters/usr/bin; ln -s foomatic-rip directomatic) + (cd $(CURDIR)/debian/foomatic-filters/usr/share/man/man8; ln -s ../man1/foomatic-rip.1.gz lpdomatic.8.gz; cd ../man1; ln -s foomatic-rip.1.gz directomatic.1.gz) + dh_link + dh_strip + dh_compress + dh_fixperms + dh_perl +# dh_python +# dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install diff --git a/filter.conf b/filter.conf new file mode 100755 index 0000000..944d246 --- /dev/null +++ b/filter.conf @@ -0,0 +1,42 @@ +# This file allows you to configure the "foomatic-rip" filter. + +# Uncomment the lines where you want to do a change and enter the +# desired value. + +# Enter here your personal command for converting non-PostScript files +# (especially text) to PostScript. Supported commands are "a2ps", +# "enscript" or "mpage". Command line options will be automatically +# set by "foomatic-rip". + +# textfilter: a2ps + +# Set debug to 1 to enable the debug logfile for "foomatic-rip"; it +# will appear as /tmp/foomatic-rip.log It will contain status info of +# the filtering process and the renderer's (usually GhostScript's) +# stderr output. + +# WARNING: This logfile is a security hole; do not use in production. + +# debug: 0 + +### CUPS only: + +# Set to 0 to suppress inserting postscript code for accounting. + +# ps_accounting: 1 + +### General Configuration + +# Set echo to the path to an echo program that uses echo -n + +# echo: /bin/echo + +# set gspath to the GhostScript to be used by foomatic +# gspath: gs + +# Set the PATH value to be used by foomatic-rip: +# execpath: /usr/local/bin:/usr/bin:/bin + +# Set the directories in which foomatic-rip should search for CUPS filters: +# cupsfilterpath: /usr/local/lib/cups/filter:/usr/local/lib/cups/filter:/usr/local/libexec/cups/filter:/opt/cups/filter:/usr/lib/cups/filter + diff --git a/foomatic-gswrapper.1.in b/foomatic-gswrapper.1.in new file mode 100755 index 0000000..38e7640 --- /dev/null +++ b/foomatic-gswrapper.1.in @@ -0,0 +1,29 @@ +.\" This -*- nroff -*- source file is part of foomatic. +.\" +.TH FOOMATIC-GSWRAPPER 1 "2001-05-07" "Foomatic Project" +.SH NAME +foomatic-gswrapper \- foomatic wrapper for ghostscript +.SH SYNOPSIS +.B foomatic-gswrapper +[\fB gs option \fR] ... + + +This is a little Ghostscript regularization script. It massages +arguments to make Ghostscript execute properly as a filter, with +output on stdout and errors etc on stderr. + +.\".SH SEE ALSO +.\".IR foomatic-XXX (1), + +.SH EXIT STATUS +.B foomatic-gswrapper +returns 0 on success. + +.SH AUTHOR +Manfred Wassmann <\fImanolo@NCC-1701.B.Shuttle.de\fR> for the foomatic +project using output from the associated binary. + +.SH BUGS +None so far. + +Please send bug reports to foomatic-devel@linuxprinting.org. diff --git a/foomatic-gswrapper.in b/foomatic-gswrapper.in new file mode 100755 index 0000000..f02bb52 --- /dev/null +++ b/foomatic-gswrapper.in @@ -0,0 +1,73 @@ +#!@PERL@ +# -*- perl -*- +# $Revision: 3.4.2.3 $ + +# This is a little Ghostscript regularization script. It massages +# arguments to make Ghostscript execute properly as a filter, with +# output on stdout and errors etc on stderr. + +# Arbitrary other option processing could happen here, too. + +# IT WOULD BE WRONG to have this file do any processing of the input +# or output data. Such job transforms belong in actual filters, or +# inside Ghostscript itself. + +my $prefix = "@prefix@"; +my $configpath = "@sysconfdir@/foomatic"; +# Read config file if present +%conf = readConfFile("$configpath/filter.conf"); + +# Set GhostScript path +my $gspath = "gs"; +$gspath = $conf{gspath} if defined(%conf) and defined $conf{gspath}; +my $execpath = "@prefix@/bin:/usr/local/bin:/usr/bin:/bin"; +# Get execution path from config file +$execpath = $conf{execpath} if defined(%conf) and defined $conf{execpath}; +$ENV{'PATH'} = $execpath; + +grep (m!\-sOutputFile=\-! + && do { + # Send the job to fd 3; errors will be on 2(stderr) and job + # ps program interpreter output on 1(stdout). + $_ = '-sOutputFile=/dev/fd/3'; + # quoted properly below... + }, @ARGV); + +grep (((m!^\-$!) || (m!^\-_$!)) + && do { + # Get the input from fd 0. + $_ = "/dev/fd/0"; + }, @ARGV); + +# Turn *off* -q (quiet!); now that stderr is useful! :) +my @myargs = grep (! m!^\-q$!, @ARGV); + +# Escape any quotes, and then quote everything just to be sure... +grep (s!\'!\\\'!g, @myargs); +my $args = "'" . join("' '", @myargs) . "'"; + +# Execute Ghostscript, with both job and gs errors on stderr, and job +# output on stdout... + +print STDERR "foomatic-gswrapper: $gspath $args 3>&1 1>&2\n"; +exec "$gspath $args 3>&1 1>&2"; + +die "Failed to execute Ghostscript?!"; + +# Read the config file + +sub readConfFile { + my ($file) = @_; + + my %conf; + # Read config file if present + if (open CONF, "< $file") { + while (<CONF>) + { + $conf{$1}="$2" if (m/^\s*([^\#\s]\S*)\s*:\s*(.*)\s*$/); + } + close CONF; + } + + return %conf; +} diff --git a/foomatic-rip.1.in b/foomatic-rip.1.in new file mode 100755 index 0000000..6957cd8 --- /dev/null +++ b/foomatic-rip.1.in @@ -0,0 +1,358 @@ +.\" This -*- nroff -*- source file is part of foomatic. +.\" +. +.\" -------------------------------------------------------------------- +.\" Setup - Macros stolen fro "roff" man page +.\" -------------------------------------------------------------------- +. +.mso www.tmac +. +.if n \{\ +. mso tty-char.tmac +. ftr CR R +. ftr CI I +. ftr CB B +.\} +. +.if '\*[.T]'dvi' \{\ +. ftr CB CW +.\} +. +. +.\" -------------------------------------------------------------------- +.\" String definitions +. +.\" Final `\""' comments are used to make Emacs happy, sic \"" +. +.\" The `-' sign for options. +.ie t \{\ +. ds @- \-\" +. ds @-- \-\-\" +.\} +.el \{\ +. ds @- -\" +. ds @-- --\" +.\} +. +.ds Comment \.\[rs]\[dq]\" +.ds Ellipsis \.\|.\|.\&\" +. +. +.\" -------------------------------------------------------------------- +.\" Begin of macro definitions +. +.de c +.\" this is like a comment request when escape mechanism is off +.. +. +.eo +. +.c --------------------------------------------------------------------- +. +.de Text +. nop \)\$* +.. +. +.de CodeSkip +. ie t \ +. sp 0.2v +. el \ +. sp +.. +. +.de Esc +. ds @1 \$1\" +. shift +. Text \f[B]\[rs]\*[@1]\f[]\$* +. rm @1 +.. +. +.de QuotedChar +. ds @1 \$1 +. shift +. nop `\f[B]\*[@1]\f[]'\$* +. rm @1 +.. +. +.c -------------------------------------------------------------------- +. +.c a shell command line +.de ShellCommand +. br +. ad l +. nh +. Text \f[I]sh#\h'1m'\f[]\f[CR]\$*\f[]\&\" +. ft R +. ft P +. hy +. ad +.. +. +.c -------------------------------------------------------------------- +. +.c ShortOpt ([c [punct]]) +.c +.c `-c' somewhere in the text. +.c The second argument is some trailing punctuation. +.c +.de ShortOpt +. ds @1 \$1\" +. shift +. nh +. Text \f[CB]\*[@-]\f[]\f[B]\*[@1]\f[]\/\$* +. hy +. rm @1 +.. +. +.de TP+ +. br +. ns +. TP \$1 +.. +. +.c -------------------------------------------------------------------- +. +.c Topic +.c +.de Topic +. TP 2m +. Text \[bu] +.. +. +.ec +.\" End of macro definitions +. +. + + +.hy 0 +.TH FOOMATIC-RIP 1 "2002-11-26" "Foomatic Project" +.SH NAME +foomatic-rip \- Universal print filter/RIP wrapper +.SH SYNOPSIS + +.SS \fRGeneral Options: +.BI \fBfoomatic-rip\fR\ \fB[-v]\ [-q]\ [-d]\fP \fI\ <filter\ specific\ options> + +.SS \fRSpooler-less printing/CPS (older versions) filter: +.BI \fBfoomatic-rip\fR\ \fB[\fB-P\fR \ \fI<printer>\fR \ +| \ \fB--ppd\fR \ \fI<ppdfile>\fR \fB]\fR \ [\fB-J\fR\ \fI<jobtitle>\fR ] +[\fB-o\fR \ \fI<option>\fB=\fI<value>\fR \ [...]] \ \fB[\fI<files>\fB]\fR + +.SS \fRCUPS filter: +.BI \fBfoomatic-rip\fR\ \fI<jobid>\fR \ \fI<user>\fR \ \fI<jobtitle>\fR \ \fI<numcopies>\fR \ \fI<options>\fR \ \fB[\fI<file>\fB]\fR + +.SS \fRLPRng filter: +.BI \fBfoomatic-rip\fR\ --lprng\ \fB[\fB-J\fI<jobtitle>\fB]\fR \fB[\fB-Z\fI<option>\fB=\fI<value>\fB[,\fI<option>\fB=\fI<value>\fB[, \ \fB...]]\fR \ \fI<ppdfile>\fR +.br + +.BI \fBfoomatic-rip\fR\ \ \fB[\fB-J\fI<jobtitle>\fB]\fR \fB[\fB-Z\fI<option>\fB=\fI<value>\fB[,\fI<option>\fB=\fI<value>\fB[, \ \fB...]]\fR +.br +(printcap :pdd=<ppdfile>) + +.BI \fBfoomatic-rip\fR\ \fB--ppd\fR \ \fI<ppdfile>\fR \fB[\fB-J\fI<jobtitle>\fB]\fR \ \fB[\fB-Z\fI<option>\fB=\fI<value>\fB[,\fI<option>\fB=\fI<value>\fB[, \ \fB...]]\fR + +.SS \fRLPD/GNUlpr filter: +.BI \fBfoomatic-rip\fR\ \fB[\fB-w\fR\ \fI<number>\fB]\fR\ \fB[\fB-l\fR\ \fI<number>\fB]\fR\ \fB[\fB-x\fR\ \fI<number>\fB]\fR\ \fB[\fB-y\fR\ \fI<number>\fB]\fR\ \fB[\fB-i\fR\ \fI<number>\fB]\fR\ \fB[\fB-c\fB]\fR\ \fB[\fB-n\fR\ \fI<string>\fB]\fR\ \fB[\fB-h\fR\ \fI<string>\fB]\fR\ \fB[\fB-j|-J\fR\ \fI<jobtitle>\fB|\fI<options>\fB]\fR\ \fI<ppdfile>\fR + +.SS \fRPPR RIP: +.BI \fBfoomatic-rip\fR\ \fB[\fI<option>\fB=\fI<value>\fR \ [...]] + +.SS \fRPPR interface: +.BI \fBfoomatic-rip\fR\ \fI<queue>\fR \ \fI<destaddress>\fR \ \fI<options>\fR \ \fI<jobbreak>\fR \ \fI<feedback>\fR \ \fI<codes>\fR \ \fI<jobname>\fR \ \fI<routing>\fR \ \fI<for>\fR \ \fI<filetype>\fR \ \fB[\fI<file>\fB]\fR + +.SS \fRPDQ driver file generation: +.BI foomatic-rip\ \fB[\fB--ppd\fR \ \fI<ppdfile>\fB]\fR \ [\fB-o\fR \ \fI<option>\fB=\fI<value>\fR \ [...]] \ \fB--genpdq|--appendpdq|--genrawpdq|--appendrawpdq\fR + +.SS \fRPDQ filter: +.BI foomatic-rip\ \fB--pdq\fR\ \fB--ppd\fR \ \fI<ppdfile>\fR \fB]\fR \ [\fB-o\fR \ \fI<option>\fB=\fI<value>\fR \ [...]] \ \fI<file>\fR + +.SS \fRCPS (newer versions) filter: +.BI \fBfoomatic-rip\fR\ \fB--cps\fR\ \fB-P\fR \ \fI<printer>\fR \ [\fB-J\fR\ \fI<jobtitle>\fR ] \ [\fB-o\fR \ \fI<option>\fB=\fI<value>\fR \ [...]] \ \fB[\fI<files>\fB]\fR + +.SH DESCRIPTION +foomatic-rip is a universal print filter which works with every known free +software printer spooler. It has the following features: + +.Topic +It translates PostScript (and also other file formats) from standard +input to the printer's native language (usually put to standard +output). + +.Topic +The translation is done with an external renderer, usually GhostScript +(\fBgs(1)\fR). If no translation is needed (PostScript printer) the +renderer's command line reduces to \fBcat(1)\fR. The way how this +translation is done is described in a \fBPPD file\fR. + +.Topic +Printer capabilities, how to handle user options, and how to build the +renderer command line is always described by \fBPPD files\fR, these +PPD files can come from \fBFoomatic\fR or can be the ones supplied by +the manufacturers of PostScript printers. The PPD files are the same +for all spoolers. + +.Topic +foomatic-rip works with every known spooler (\fBCUPS\fR, \fBLPRng\fR, +\fBLPD\fR, \fBGNUlpr\fR, \fBPPR\fR, \fBPDQ\fR, \fBCPS\fR, and +\fBwithout spooler\fR). It auto-detects the spooler from which it was +called by the command line options and environment variables which +were supplied by the spooler. + +.Topic +Non-PostScript files are translated to PostScript before they are +passed to the renderer. This is usually done by \fBa2ps(1)\fR, +\fBenscript(1)\fR, or \fBmpage(1)\fR. foomatic-rip auto-detects which +program is installed, but manual configuration is also possible. + +.Topic +foomatic-rip does not only apply option settings supplied by the user +through the command line of the printing command, but also searches +the entire job for embedded option settings (only PostScript +jobs). Here not only settings affectimg the whole job are taken into +account, but also settings in the page headers, which are only valid +for the page where they were found, so applications which produce +PostScript code with page-specific printer option settings are fully +supported. + +.SH SPOOLER-LESS PRINTING + +.SS Options + +.TP 10 +.B \-v +\fRverbose mode for debugging. +.B WARNING: +This will create a file in /tmp that contains the debugging information. +This opens a security loophole and should not be used in production. + +.TP 10 +.B \-q +\fRquiet mode - minimal information output + +.TP 10 +.B \-d +\fRidentical to the 'opts' option, but option information is +left in text format. This is useful for running foomatic-rip +from the command line to determine what the printer option are. +The PPD file will need to be specified using the --ppd option. + +.TP 10 +.BI \-P \ <printer> +\fI<printer>\fR is the configured printer which should be used for this job. + +.TP 10 +.BI \--ppd \ <ppdfile> +The PPD file \fI<ppdfile>\fR should be applied for processing this job. +.TP 10 +.BI \-J \ <jobtitle> +The \fI<jobtitle>\fR will be printed in the head line of every page of +a plain text job. +.TP 10 +.BI \-o \ \fI<option>\fB=\fI<value>\fR +Option settings for this job, do + +.B foomatic-rip -P \fI<printer>\fR \fB-o docs \fI<file>\fR + +(\fI<file>\fR can be an arbitrary existing file, as \fB.bashrc\fR, +will not be printed) to print a list of available options for the +specified \fI<printer>\fR. +.TP 10 +.BI \fI<files>\fR +The file(s) to be printed. + +.P +\fBfoomatic-rip\fR will print from standard input unless a file to +print is specified on the command line. +If your printer PPD file is stored as \fI@@$ENV{'FOO_ETC'}@@/direct/<printer>.ppd\fR +or \fI~/.foomatic/direct/<printer>.ppd\fR you can use it by simply specifying "-P \fI<printer>\fR". + +Put a line + +\fB*FoomaticRIPPostPipe: "| \fI<command>\fB"\fR +.hy 0 + +into the PPD file, right after \fB*PPD-Adobe: "4.3"\fR, where +\fI<command>\fR is a command into which you wnat to re-direct the +output data. Due to the restictions of PPD files \fB<\fR, \fB>\fR, and +\fB"\fR are not allowed in the \fI<command>\fR, replace them as +follows: + +.CodeSkip +.nf +.B Character Replacement +.B --------------------- +.B < < +.B > > +.B " " +.B ' ' +.B & & +.fi + +This way you can print directly to your printer, use + +\fB*FoomaticRIPPostPipe: "| cat > /dev/lp0"\fR + +or + +\fB*FoomaticRIPPostPipe: "| cat > /dev/usb/lp0"\fR + +for local parallel or USB printers. To make normal users able to print +this way add them to the group \fBlp\fR and make sure that the +appropriate printer device file \fI/dev/...\fR is group-writable for +the \fBlp\fR group. + +for a TCP/Socket/JetDirect printer with the host name \fBprinter\fR +listening on port \fB9100\fR you need this: + +\fB*FoomaticRIPPostPipe: "| /usr/bin/nc -w 1 printer 9100"\fR + +Note the "-w 1" in the "nc" command line, it makes "nc" exiting +immediately after the data is tranferred to the printer. + +\fB*FoomaticRIPPostPipe: "| rlpr -Plp@printserver"\fR + +directs your jobs to the LPD printer queue \fBlp\fR on the machine +named \fBprintserver\fR. + +See also http://www.linuxprinting.org/direct-doc.html + +.SH "PRINTING WITH SPOOLER" + +See the documentation on the Linux Printing Web site: +.ft CW +http://www.linuxprinting.org +\fR + +.SH FILES +.PD 0 +.TP 0 +@@$ENV{'FOO_ETC'}@@/cups/<printer>.ppd +.TP 0 +@@$ENV{'FOO_ETC'}@@/lpd/<printer>.ppd +.TP 0 +@@$ENV{'FOO_ETC'}@@/ppr/<printer>.ppd +.TP 0 +@@$ENV{'FOO_ETC'}@@/pdq/<printer>.ppd +.TP 8 +@@$ENV{'FOO_ETC'}@@/direct/<printer>.ppd + +The PPD files of the currently defined printers +.PD 0 + +.\".SH SEE ALSO +.\".IR foomatic-XXX (1), + +.SH EXIT STATUS +.B foomatic-rip +returns 0 unless something unexpected happens. + +.SH AUTHOR +Till Kamppeter <\fItill.kamppeter@gmx.net\fR> with parts of Manfred +Wassmanns's <\fImanolo@NCC-1701.B.Shuttle.de\fR> man pages for the +Foomatic 2.0.x filters. + +.SH BUGS +None so far. + +Please send bug reports to foomatic-devel@linuxprinting.org. diff --git a/foomatic-rip.in b/foomatic-rip.in new file mode 100755 index 0000000..177b372 --- /dev/null +++ b/foomatic-rip.in @@ -0,0 +1,6310 @@ +#!@PERL@ +# The above Perl path may vary on your system; fix it!!! -*- perl -*- + +use strict; +use POSIX; +use Cwd; + +my $ripversion='$Revision: 3.43.2.9 $'; +#'# Fix emacs syntax highlighting + +# foomatic-rip is a spooler-independent filter script which takes +# PostScript as standard input and generates the printer's page +# description language (PDL)/raster format as standard output. This +# kind of filter is usually called Raster Image Processor (RIP), +# therefore the name "foomatic-rip". + +# Save it in one of the directories of your $PATH, so that it gets +# found when called from the command line (for spooler-less printing), +# link it to spooler-specific directories when you use CUPS or PPR: + +# ln -s /usr/bin/foomatic-rip /usr/lib/cups/filter/ +# ln -s /usr/bin/foomatic-rip /usr/lib/ppr/lib/ +# ln -s /usr/bin/foomatic-rip /usr/lib/ppr/interfaces/ + +# Mark this filter world-readable and world-executable (note that most +# spoolers run the print filters as a special user, as "lp", not as +# "root" or as the user who sent the job). + +# See http://www.linuxprinting.org/cups-doc.html +# http://www.linuxprinting.org/lpd-doc.html +# http://www.linuxprinting.org/ppr-doc.html +# http://www.linuxprinting.org/pdq-doc.html +# http://www.linuxprinting.org/direct-doc.html +# http://www.linuxprinting.org/ppd-doc.html + +# ========================================================================== +# +# User-configurable settings, edit them if needed +# +# ========================================================================== + +# What path to use for filter programs and such. Your printer driver +# must be in the path, as must be the renderer, $enscriptcommand, and +# possibly other stuff. The default path is often fine on Linux, but +# may not be on other systems. +# +my $execpath = "@prefix@/bin:/usr/local/bin:/usr/bin:/bin"; + +# CUPS raster drivers are searched here +my $cupsfilterpath = "@prefix@/lib/cups/filter:/usr/local/lib/cups/filter:/usr/local/libexec/cups/filter:/opt/cups/filter:/usr/lib/cups/filter"; + +# Location of the configuration file "filter.conf", this file can be +# used to change the settings of foomatic-rip without editing +# foomatic-rip. itself. This variable must contain the full pathname +# of the directory which contains the configuration file, usually +# "/etc/foomatic". +# Some versions of configure do not fully expand $sysconfdir +my $prefix = "@prefix@"; +my $configpath = "@sysconfdir@/foomatic"; + +# For the stuff below, the settings in the configuration file have priority. + +# Set to 1 to insert postscript code for page accounting (CUPS only). +my $ps_accounting = 1; +my $accounting_prolog = ""; + +# Enter here your personal command for converting non-postscript files +# (especially text) to PostScript. If you leave it blank, at first the +# line "textfilter: ..." from /etc/foomatic/filter.conf is read and +# then the commands given on the list below are tried, beginning with +# the first one. +# You can set this to "a2ps", "enscript" or "mpage" to select one of the +# default command strings. +my $fileconverter = ""; + +my($kid0,$kid1,$kid2,$kid3,$kid4); +my($kidfailed,$kid3finished,$kid4finished); +my($convkidfailed,$dockidfailed,$kid0finished,$kid1finished,$kid2finished); +my($fileconverterpid,$rendererpid,$fileconverterhandle,$rendererhandle); +my($jobhasjcl); + +# What 'echo' program to use. It needs -e and -n. Linux's builtin +# and regular echo work fine; non-GNU platforms may need to install +# gnu echo and put gecho here or something. +# +my $myecho = 'echo'; + +# Set debug to 1 to enable the debug logfile for this filter; it will +# appear as defined by $logfile. It will contain status from this +# filter, plus the renderer's stderr output. You can also add a line +# "debug: 1" to your /etc/foomatic/filter.conf to get all your +# Foomatic filters into debug mode. +# +# WARNING: This logfile is a security hole; do not use in production. +my $debug = 0; + +# This is the location of the debug logfile (and also the copy of the +# processed PostScript data) in case you have enabled debugging above. +# The logfile will get the extension ".log", the PostScript data ".ps". +my $logfile = "/tmp/foomatic-rip"; + +# End interesting enduser options + +# ========================================================================== +# +# foomatic-rip spooler-independent PS->Printer filter (RIP) of Foomatic +# +# Copyright 2002 - 2004 Grant Taylor <gtaylor@picante.com> +# & Till Kamppeter <till.kamppeter@gmx.net> +# & Helge Blischke <h.blischke@srz.de> +# +# This program 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; either version 2 of the License, or (at your +# option) any later version. +# +# This program 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 +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +# USA. +# + +my $added_lf = "\n"; + +# Flush everything immediately. +$|=1; + + + +## Constants used by this filter + +# Error codes, as some spooles behave different depending on the reason why +# the RIP failed, we return an error code. As I have only found a table of +# error codes for the PPR spooler. If our spooler is really PPR, these +# definitions get overwritten by the ones of the PPR version currently in +# use. + +my $EXIT_PRINTED = 0; # file was printed normally +my $EXIT_PRNERR = 1; # printer error occured +my $EXIT_PRNERR_NORETRY = 2; # printer error with no hope of retry +my $EXIT_JOBERR = 3; # job is defective +my $EXIT_SIGNAL = 4; # terminated after catching signal +my $EXIT_ENGAGED = 5; # printer is otherwise engaged (connection + # refused) +my $EXIT_STARVED = 6; # starved for system resources +my $EXIT_PRNERR_NORETRY_ACCESS_DENIED = 7; # bad password? bad port + # permissions? +my $EXIT_PRNERR_NOT_RESPONDING = 8; # just doesn't answer at all + # (turned off?) +my $EXIT_PRNERR_NORETRY_BAD_SETTINGS = 9; # interface settings are invalid +my $EXIT_PRNERR_NO_SUCH_ADDRESS = 10; # address lookup failed, may be + # transient +my $EXIT_PRNERR_NORETRY_NO_SUCH_ADDRESS = 11; # address lookup failed, not + # transient +my $EXIT_INCAPABLE = 50; # printer wants (lacks) features + # or resources +# Standard Unix signal names +#my SIGHUP = 1; +#my SIGINT = 2; +#my SIGQUIT = 3; +#my SIGKILL = 9; +#my SIGTERM = 15; +#my SIGUSR1 = 10; +#my SIGUSR2 = 12; +#my SIGTTIN = 21; +#my SIGTTOU = 22; + +my $ESPIPE = 29; # the errno value when seeking a pipe or socket + + + +## Some important variables + +# We don't know yet, which spooler will be used. If we don't detect +# one. we assume that we do spooler-less printing. Supported spoolers +# are currently: + +# cups - CUPS - Common Unix Printing System +# lpd - LPD - Line Printer Daemon +# lprng - LPRng - LPR - New Generation +# gnulpr - GNUlpr, an enhanced LPD (development stopped) +# ppr - PPR (foomatic-rip runs as a PPR RIP) +# ppr_int - PPR (foomatic-rip runs as an interface) +# cps - CPS - Coherent Printing System +# pdq - PDQ - Print, Don't Queue (development stopped) +# direct - Direct, spooler-less printing + +my $spooler = 'direct'; + +# PPD file name +my $ppdfile = ""; + +# Printer model +my $model = ""; + +# Printer queue name +my $printer = ""; + +# Printing options +my $optstr = ""; + +# Job title +my $jobtitle = ""; + +# Post pipe (command into which the output of this filter should be piped) +my $postpipe = ""; + +# Files to be printed +my @filelist = (); + +# JCL prefix to put before the JCL options (Can be modified by a +# "*JCLBegin:" keyword in the PPD file): +my $jclbegin = "\033%-12345X\@PJL\n"; + +# JCL command to switch the printer to the PostScript interpreter (Can +# be modified by a "*JCLToPSInterpreter:" keyword in the PPD file): +my $jcltointerpreter = ""; + +# JCL command to close a print job (Can be modified by a "*JCLEnd:" +# keyword in the PPD file): +my $jclend = "\033%-12345X\@PJL RESET\n"; + +# Under which name were we called and in which directory do we reside +$0 =~ m!^(.*/)([^/]+)$!; +my $programdir = $1; +my $programname = $2; + +# Filters to convert non-PostScript files +my @fileconverters = + (# a2ps (converts also other files than text) + 'a2ps -1 @@--medium=@@PAGESIZE@@ @@--center-title=@@JOBTITLE@@ -o -', + # enscript + 'enscript -G @@-M @@PAGESIZE@@ @@-b "Page $%|@@JOBTITLE@@ ' . + '--margins=36:36:36:36 --mark-wrapped-lines=arrow --word-wrap -p-', + # mpage + 'mpage -o -1 @@-b @@PAGESIZE@@ @@-H -h @@JOBTITLE@@ -m36l36b36t36r ' . + '-f -P- -'); + +# spooler-specific file converters, default for the specific spooler when +# none of the converters above is chosen. Remove weird characters from the +# command line arguments to enhance security +my @fixed_args = + (defined($ARGV[0])?removespecialchars($ARGV[0]):"", + defined($ARGV[1])?removespecialchars($ARGV[1]):"", + defined($ARGV[2])?removespecialchars($ARGV[2]):"", + defined($ARGV[3])?removespecialchars($ARGV[3]):"", + defined($ARGV[4])?removespecialchars($ARGV[4]):""); +my $spoolerfileconverters = { + 'cups' => "${programdir}texttops '$fixed_args[0]' '$fixed_args[1]' '$fixed_args[2]' " . + "'$fixed_args[3]' '$fixed_args[4] page-top=36 page-bottom=36 " . + "page-left=36 page-right=36 nolandscape cpi=12 lpi=7 " . + "columns=1 wrap'" + }; + +## Config file + +# Read config file if present +my %conf = readConfFile("$configpath/filter.conf"); + +# Get execution path from config file +$execpath = $conf{execpath} if defined $conf{execpath}; +$ENV{'PATH'} = $execpath; + +# Get CUPS filter path from config file +$cupsfilterpath = $conf{cupsfilterpath} if defined $conf{cupsfilterpath}; + +# Set debug mode +$debug = $conf{debug} if defined $conf{debug}; + +# Determine which filter to use for non-PostScript files to be converted +# to PostScript +if (defined $conf{textfilter}) { + $fileconverter = $conf{textfilter}; + $fileconverter eq 'a2ps' and $fileconverter = $fileconverters[0]; + $fileconverter eq 'enscript' and $fileconverter = $fileconverters[1]; + $fileconverter eq 'mpage' and $fileconverter = $fileconverters[2]; +} + + + +## Environment variables; + +# "PPD": PPD file name for CUPS or PPR (if we run as PPR RIP) +if (defined($ENV{'PPD'})) { + # Clean the file name from weird characters which could cause + # unexpected behaviour + $ppdfile = removespecialchars($ENV{'PPD'}); + # CUPS and PPR (RIP filter) use the "PPD" environment variable to + # make the PPD file name available (we set CUPS here preliminarily, + # in the next step we check for PPR) + $spooler = 'cups'; +} + +# "PPR_VERSION": PPR +if (defined($ENV{'PPR_VERSION'})) { + # We have PPR + $spooler = 'ppr'; +} + +# "PPR_RIPOPTS": PPR +if (defined($ENV{'PPR_RIPOPTS'})) { + # PPR 1.5 allows the user to specify options for the PPR RIP with the + # "--ripopts" option on the "ppr" command line. They are provided to + # the RIP via the "PPR_RIPOPTS" environment variable. + # Clean the option string from weird characters which could cause + # unexpected behaviour + $optstr .= removespecialchars("$ENV{'PPR_RIPOPTS'} "); + # We have PPR + $spooler = 'ppr'; +} + +# "LPOPTS": Option settings for some LPD implementations (ex: GNUlpr) +if (defined($ENV{'LPOPTS'})) { + my @lpopts = split(/,/, removespecialchars($ENV{'LPOPTS'})); + foreach my $opt (@lpopts) { + $opt =~ s/^\s+//; + $opt =~ s/\s+$//; + if ($opt =~ /\s+/) { + $opt = "\"$opt\""; + } + $optstr .= "$opt "; + } + # We have an LPD which accepts "-o" for options + $spooler = 'gnulpr'; +} + + + +## Named command line options + +# We do not use Getopt::Long because it does not work when between the +# option and the argument is no space ("-w80" instead of "-w 80"). This +# happens in the command line of LPRng, but also users could type in +# options this way when printing without spooler. + +# Make one option string with a non-printable character as separator, +# So we can parse it more easily. + +# To avoid the separator to be in the options itselves, it is filters +# out of the options. This does not break anything as having non +# printable characters in the command line options does not make sense +# nor is this needed. This way misinterpretation and even abuse is +# prevented. + +my $argstr = "\x01" . + join("\x01", map { removeunprintables($_) } @ARGV) . "\x01"; + +# Debug mode activated via command line +if ($argstr =~ s/\x01--debug\x01/\x01/) { + $debug = 1; +} + +# Command line options for verbosity +my $verbose = ($argstr =~ s/\x01-v\x01/\x01/); +my $quiet = ($argstr =~ s/\x01-q\x01/\x01/); +my $show_docs = ($argstr =~ s/\x01-d\x01/\x01/); +my $do_docs; +my $cupscolorprofile; + +# Where to send debugging log output to +my $logh; + +if ($debug) { + # Grotesquely unsecure; use for debugging only + open LOG, "> ${logfile}.log"; + $logh = *LOG; + + use IO::Handle; + $logh->autoflush(1); +} elsif (($quiet) && (!$verbose)) { + # Quiet mode, do not log + close $logh; + open LOG, "> /dev/null"; + $logh = *LOG; + + use IO::Handle; + $logh->autoflush(1); +} else { + # Default: log to STDERR + $logh=*STDERR; +} + + + +## Start debug logging +if ($debug) { + # If we are not in debug mode, we do this later, as we must find out at + # first which spooler is used. When printing without spooler we + # suppress logging because foomatic-rip is called directly on the + # command line and so we avoid logging onto the console. + print $logh "foomatic-rip version $ripversion running...\n"; + # Print the command line only in debug mode, Mac OS X adds very many + # options so that CUPS cannot handle the output of the command line + # in its log files. If CUPS encounters a line with more than 1024 + # characters sent into its log files, it aborts the job with an error. + if (($debug) || ($spooler ne 'cups')) { + print $logh "called with arguments: '", join("', '",@ARGV), "'\n"; + } +} + + + +## Continue with named options + +# Check for LPRng first so we do not pick up bogus ppd files by the -p option +if ($argstr =~ s/\x01--lprng\x01/\x01/) { + # We have LPRng + $spooler = 'lprng'; +} +# 'PRINTCAP_ENTRY' environment variable is : LPRng +# the :ppd=/path/to/ppdfile printcap entry should be used +if (defined($ENV{'PRINTCAP_ENTRY'})){ + $spooler = 'lprng'; + my( @pc); + @pc = split( /\s*:\s*/, $ENV{'PRINTCAP_ENTRY'} ); + shift @pc; + foreach (@pc) { + if( /^ppd=(.*)$/ or /^ppdfile=(.*)$/ ){ + $ppdfile = removespecialchars($1) if $1; + } + } +} elsif ($argstr =~ s/\x01--lprng\x01/\x01/g) { + # We have LPRng + $spooler = 'lprng'; +} + + +# PPD file name given via the command line +# allow duplicates, and use the last specified one +while ( ($spooler ne 'lprng') and ($argstr =~ s/\x01-p(\x01|)([^\x01]+)\x01/\x01/)) { + $ppdfile = removeshellescapes($2); +} +while ($argstr =~ s/\x01--ppd(\x01|=|)([^\x01]+)\x01/\x01/) { + $ppdfile = removeshellescapes($2); +} + +# Check for LPD/GNUlpr by typical options which the spooler puts onto +# the filter's command line (options "-w": text width, "-l": text +# length, "-i": indent, "-x", "-y": graphics size, "-c": raw printing, +# "-n": user name, "-h": host name) +if (($argstr =~ s/\x01-w(\x01|)\d+\x01/\x01/) || + ($argstr =~ s/\x01-l(\x01|)\d+\x01/\x01/) || + ($argstr =~ s/\x01-x(\x01|)\d+\x01/\x01/) || + ($argstr =~ s/\x01-y(\x01|)\d+\x01/\x01/) || + ($argstr =~ s/\x01-i(\x01|)\d+\x01/\x01/) || + ($argstr =~ s/\x01-c\x01/\x01/) || + ($argstr =~ s/\x01-n(\x01|)[^\x01]+\x01/\x01/) || + ($argstr =~ s/\x01-h(\x01|)[^\x01]+\x01/\x01/)) { + # We have LPD or GNUlpr + if (($spooler ne 'lpd') && ($spooler ne 'gnulpr') && ($spooler ne 'lprng')) { + $spooler = 'lpd'; + } +} + +# LPRng delivers the option settings via the "-Z" argument +if ($argstr =~ s/\x01-Z(\x01|)([^\x01]+)\x01/\x01/) { + my @lpopts = split(/,/, $2); + foreach my $opt (@lpopts) { + $opt =~ s/^\s+//; + $opt =~ s/\s+$//; + $opt = removeshellescapes($opt); + if ($opt =~ /\s+/) { + $opt = "\"$opt\""; + } + $optstr .= "$opt "; + } + # We have LPRng + $spooler = 'lprng'; +} + +# Job title and options for stock LPD +if ($argstr =~ s/\x01-[jJ](\x01|)([^\x01]+)\x01/\x01/) { + # An LPD + $jobtitle = removeshellescapes($2); + # Classic LPD hack + if ($spooler eq "lpd") { + $optstr .= "$jobtitle "; + } +} + +# Check for CPS +if ($argstr =~ s/\x01--cps\x01/\x01/) { + # We have cps + $spooler = 'cps'; +} + +# Options for spooler-less printing, CPS, or PDQ +while ($argstr =~ s/\x01-o(\x01|)([^\x01]+)\x01/\x01/) { + my $opt = $2; + $opt =~ s/^\s+//; + $opt =~ s/\s+$//; + $opt = removeshellescapes($opt); + if ($opt =~ /\s+/) { + $opt = "\"$opt\""; + } + $optstr .= "$opt "; + # If we don't print as a PPR RIP or as a CPS filter, we print without + # spooler (we check for PDQ later) + if (($spooler ne 'ppr') && ($spooler ne 'cps')) { + $spooler = 'direct'; + } +} + +# Printer for spooler-less printing or PDQ +if ($argstr =~ s/\x01-d(\x01|)([^\x01]+)\x01/\x01/) { + $printer = removeshellescapes($2); +} +# Printer for spooler-less printing, PDQ, or LPRng +if ($argstr =~ s/\x01-P(\x01|)([^\x01]+)\x01/\x01/) { + $printer = removeshellescapes($2); +} + +# Were we called from a PDQ wrapper? +if ($argstr =~ s/\x01--pdq\x01/\x01/) { + # We have PDQ + $spooler = 'pdq'; +} + +# Were we called to build the PDQ driver declaration file? +# "--appendpdq=<file>" appends the data to the <file>, +# "--genpdq=<file>" creates/overwrites <file> for the data, and +# "--genpdq" writes to standard output +my $genpdqfile = ""; +if (($argstr =~ s/\x01--(gen)(raw|)pdq(\x01|=|)([^\x01]*)\x01/\x01/) || + ($argstr =~ s/\x01--(append)(raw|)pdq(\x01|=|)([^\x01]+)\x01/\x01/)) { + # Determine output file name + if (!$4) { + $genpdqfile = ">&STDOUT"; + } else { + if ($1 eq 'gen') { + $genpdqfile = "> " . removeshellescapes($4); + } else { + $genpdqfile = ">> " . removeshellescapes($4); + } + } + # Do we want to have a PDQ driver declaration for a raw printer? + if ($2 eq 'raw') { + my $time = time(); + my @pdqfile = +"driver \"Raw-Printer-$time\" { + # This PDQ driver declaration file was generated automatically by + # foomatic-rip to allow raw (filter-less) printing. + language_driver all { + # We accept all file types and pass them through without any changes + filetype_regx \"\" + convert_exec { + ln -s \$INPUT \$OUTPUT + } + } + filter_exec { + ln -s \$INPUT \$OUTPUT + } +}"; + open PDQFILE, $genpdqfile or + rip_die("Cannot write PDQ driver declaration file", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + print PDQFILE join('', @pdqfile); + close PDQFILE; + exit $EXIT_PRINTED; + } + # We have PDQ + $spooler = 'pdq'; +} + + +# remove extra spacing if running as LPRng filter +$added_lf = "" if $spooler eq 'lprng'; + +## Command line arguments without name + +# Remaining arguments +my @rargs = split(/\x01/, $argstr); +shift @rargs; + +# Load definitions for PPR error messages, check whether we run as +# PPR interface or as PPR RIP +my( $ppr_printer, $ppr_address, $ppr_options, $ppr_jobbreak, $ppr_feedback, + $ppr_codes, $ppr_jobname, $ppr_routing, $ppr_for, $ppr_filetype, + $ppr_filetoprint ); +if ($spooler eq 'ppr') { + # Read interface.sh so we will know the correct exit codes and + # also signal.sh for the signal codes + my $deffound = 0; # Did we find one of the definition files + my @definitions; + for my $file (("lib/interface.sh", "lib/signal.sh")) { + + open FILE, "< $file" || do { + print $logh "error opening $file.\n"; + next; + }; + + $deffound = 1; + while(my $line = <FILE>) { + # Translate the shell script to Perl + if (($line !~ m/^\s*$/) && ($line !~ m/^\s*\#/)) { + $line =~ s/^\s*([^\#\s]*)/\$$1;/; + push (@definitions, $line); + } + } + close FILE; + } + + if ($deffound) { + # Apply the definitions loaded from PPR + eval join('',@definitions) || do { + print $logh "unable to evaluate definitions\n"; + rip_die ("Error in definitions evaluation", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + }; + } + + # Check whether we run as a PPR interface (if not, we run as a PPR RIP) + if (($rargs[3] =~ /^\s*\d\d?\s*$/) && + ($rargs[5] =~ /^\s*\d\d?\s*$/) && + (($#rargs == 10) || ($#rargs == 9) || ($#rargs == 7))) { + # PPR calls interfaces with many command line parameters, + # where the forth and the sixth is a small integer + # number. In addition, we have 8 (PPR <= 1.31), 10 + # (PPR>=1.32), 11 (PPR >= 1.50) command line parameters. + # We also check whether the current working directory is a + # PPR directory. + + # Get all command line parameters + $ppr_printer = removeshellescapes($rargs[0]); + $ppr_address = $rargs[1]; + $ppr_options = removeshellescapes($rargs[2]); + $ppr_jobbreak = $rargs[3]; + $ppr_feedback = $rargs[4]; + $ppr_codes = $rargs[5]; + $ppr_jobname = removeshellescapes($rargs[6]); + $ppr_routing = removeshellescapes($rargs[7]); + $ppr_for = $rargs[8]; + $ppr_filetype = $rargs[9]; + $ppr_filetoprint = removeshellescapes($rargs[10]); + + # Common job parameters + $printer = $ppr_printer; + $jobtitle = $ppr_jobname; + if ((!$jobtitle) && ($ppr_filetoprint)) { + $jobtitle = $ppr_filetoprint; + } + $optstr .= "$ppr_options $ppr_routing"; + + # Get the path of the PPD file from the queue configuration + $ppdfile = `LANG=en_US; ppad show $ppr_printer | grep PPDFile`; + $ppdfile = removeshellescapes($ppdfile); + $ppdfile =~ s/PPDFile:\s+//; + if ($ppdfile !~ m!^/!) { + $ppdfile = "../../share/ppr/PPDFiles/$ppdfile"; + } + chomp($ppdfile); + + # We have PPR and run as an interface + $spooler = 'ppr_int'; + } +} + +# CUPS +my( $cups_jobid, $cups_user, $cups_jobtitle, $cups_copies, $cups_options, + $cups_filename ); +if ($spooler eq 'cups') { + # Get all command line parameters + $cups_jobid = removeshellescapes($rargs[0]); + $cups_user = removeshellescapes($rargs[1]); + $cups_jobtitle = removeshellescapes($rargs[2]); + $cups_copies = removeshellescapes($rargs[3]); + $cups_options = removeshellescapes($rargs[4]); + $cups_filename = removeshellescapes($rargs[5]); + + # Common job parameters + #$printer = $cups_printer; + $jobtitle = $cups_jobtitle; + $optstr .= $cups_options; + + # Check for and handle inputfile vs stdin + if ((defined($cups_filename)) && ($cups_filename) && + ($cups_filename ne '-')) { + # We get the input from a file + @filelist = ($cups_filename); + print $logh "Getting input from file $cups_filename\n"; + } +} + +# LPD/LPRng/GNUlpr +if (($spooler eq 'lpd') || + ($spooler eq 'lprng' and !$ppdfile) || + ($spooler eq 'gnulpr')) { + + # Get PPD file name as the last command line argument + $ppdfile = removeshellescapes($rargs[$#rargs]); + +} + + +# No spooler, CPS, or PDQ +if (($spooler eq 'direct') || ($spooler eq 'cps') || ($spooler eq 'pdq')) { + # Which files do we want to print? + @filelist = map { removeshellescapes($_) } @rargs; +} + + + +## Additional spooler-specific preparations + +# CUPS + +if ($spooler eq 'cups') { + + # This piece of PostScript code (initial idea 2001 by Michael + # Allerhand (michael.allerhand at ed dot ac dot uk, vastly + # improved by Till Kamppeter in 2002) lets GhostScript output + # the page accounting information which CUPS needs on standard + # error. + # Redesign by Helge Blischke (2004-11-17): + # - As the PostScript job itself may define BeginPage and/or EndPage + # procedures, or the alternate pstops filter may have inserted + # such procedures, we make sure that the accounting routine + # will safely coexist with those. To achieve this, we force + # - the accountint stuff to be inserted at the very end of the + # PostScript job's setup section, + # - the accounting stuff just using the return value of the + # existing EndPage procedure, if any (and providing a default one + # if not). + # - As PostScript jobs may contain calls to setpagedevice "between" + # pages, e.g. to change media type, do in-job stapling, etc., + # we cannot rely on the "showpage count since last pagedevice + # activation" but instead count the physical pages by ourselves + # (in a global dictionary). + + if (defined $conf{ps_accounting}) { + $ps_accounting = $conf{ps_accounting}; + } + $accounting_prolog = $ps_accounting ? "[{ +%% Code for writing CUPS accounting tags on standard error + +/cupsPSLevel2 % Determine whether we can do PostScript level 2 or newer + systemdict/languagelevel 2 copy + known{get exec}{pop pop 1}ifelse 2 ge +def + +cupsPSLevel2 +{ % in case of level 2 or higher + currentglobal true setglobal % define a dictioary foomaticDict + globaldict begin % in global VM and establish a + /foomaticDict % pages count key there + << + /PhysPages 0 + >>def + end + setglobal +}if + +/cupsGetNumCopies { % Read the number of Copies requested for the current + % page + cupsPSLevel2 + { + % PS Level 2+: Get number of copies from Page Device dictionary + currentpagedevice /NumCopies get + } + { + % PS Level 1: Number of copies not in Page Device dictionary + null + } + ifelse + % Check whether the number is defined, if it is \"null\" use #copies + % instead + dup null eq { + pop #copies + } + if + % Check whether the number is defined now, if it is still \"null\" use 1 + % instead + dup null eq { + pop 1 + } if +} bind def + +/cupsWrite { % write a string onto standard error + (%stderr) (w) file + exch writestring +} bind def + +/cupsFlush % flush standard error to make it sort of unbuffered +{ + (%stderr)(w)file flushfile +}bind def + +cupsPSLevel2 +{ % In language level 2, we try to do something reasonable + << + /EndPage + [ % start the array that becomes the procedure + currentpagedevice/EndPage 2 copy known + {get} % get the existing EndPage procedure + {pop pop {exch pop 2 ne}bind}ifelse % there is none, define the default + /exec load % make sure it will be executed, whatever it is + /dup load % duplicate the result value + { % true: a sheet gets printed, do accounting + currentglobal true setglobal % switch to global VM ... + foomaticDict begin % ... and access our special dictionary + PhysPages 1 add % count the sheets printed (including this one) + dup /PhysPages exch def % and save the value + end % leave our dict + exch setglobal % return to previous VM + (PAGE: )cupsWrite % assemble and print the accounting string ... + 16 string cvs cupsWrite % ... the sheet count ... + ( )cupsWrite % ... a space ... + cupsGetNumCopies % ... the number of copies ... + 16 string cvs cupsWrite % ... + (\\n)cupsWrite % ... a newline + cupsFlush + }/if load + % false: current page gets discarded; do nothing + ]cvx bind % make the array executable and apply bind + >>setpagedevice +} +{ + % In language level 1, we do no accounting currently, as there is no global VM + % the contents of which are undesturbed by save and restore. + % If we may be sure that showpage never gets called inside a page related save / restore pair + % we might implement an hack with showpage similar to the one above. +}ifelse + +} stopped cleartomark +" : ""; + + # On which queue are we printing? + # CUPS gives the PPD file the same name as the printer queue, + # so we can get the queue name from the name of the PPD file. + $ppdfile =~ m!^(.*/)([^/]+)\.ppd$!; + $printer = $2; +} + +# No spooler, CPS, or PDQ + +if (($spooler eq 'direct') || ($spooler eq 'cps') || ($spooler eq 'pdq')) { + + # Path for personal Foomatic configuration + my $user_default_path = "$ENV{'HOME'}/.foomatic"; + + if (!$ppdfile) { + if (!$printer) { + # No printer definition file selected, check whether we have a + # default printer defined. + for my $conf_file (("./.directconfig", + "./directconfig", + "./.config", + "$user_default_path/direct/.config", + "$user_default_path/direct.conf", + "$configpath/direct/.config", + "$configpath/direct.conf")) { + if (open CONFIG, "< $conf_file") { + while (my $line = <CONFIG>) { + chomp $line; + if ($line =~ /^default\s*:\s*([^:\s]+)\s*$/) { + $printer = $1; + last; + } + } + close CONFIG; + } + if ($printer) { + last; + } + } + } + + # Neither in a config file nor on the command line a printer was + # selected. + if (!$printer) { + rip_die("No printer definition (option \"-P <name>\") " . + "specified!", $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + + # Search for the PPD file + + # Search also common spooler-specific locations, this way a printer + # configured under a certain spooler can also be used without + # spooler + + if (-r $printer) { + $ppdfile = $printer; + # CPS can have the PPD in the spool directory + } elsif (($spooler eq 'cps') && + (-r "/var/spool/lpd/${printer}/${printer}.ppd")) { + $ppdfile = "/var/spool/lpd/${printer}/${printer}.ppd"; + } elsif (($spooler eq 'cps') && + (-r "/var/local/spool/lpd/${printer}/${printer}.ppd")) { + $ppdfile = "/var/local/spool/lpd/${printer}/${printer}.ppd"; + } elsif (($spooler eq 'cps') && + (-r "/var/local/lpd/${printer}/${printer}.ppd")) { + $ppdfile = "/var/local/lpd/${printer}/${printer}.ppd"; + } elsif (($spooler eq 'cps') && + (-r "/var/spool/lpd/${printer}.ppd")) { + $ppdfile = "/var/spool/lpd/${printer}.ppd"; + } elsif (($spooler eq 'cps') && + (-r "/var/local/spool/lpd/${printer}.ppd")) { + $ppdfile = "/var/local/spool/lpd/${printer}.ppd"; + } elsif (($spooler eq 'cps') && + (-r "/var/local/lpd/${printer}.ppd")) { + $ppdfile = "/var/local/lpd/${printer}.ppd"; + } elsif (-r "${printer}.ppd") { # current dir + $ppdfile = "${printer}.ppd"; + } elsif (-r "$user_default_path/${printer}.ppd") { # user dir + $ppdfile = "$user_default_path/${printer}.ppd"; + } elsif (-r "$configpath/direct/${printer}.ppd") { # system dir + $ppdfile = "$configpath/direct/${printer}.ppd"; + } elsif (-r "$configpath/${printer}.ppd") { # system dir + $ppdfile = "$configpath/${printer}.ppd"; + } elsif (-r "/etc/cups/ppd/${printer}.ppd") { # CUPS config dir + $ppdfile = "/etc/cups/ppd/${printer}.ppd"; + } elsif (-r "/usr/local/etc/cups/ppd/${printer}.ppd") { + $ppdfile = "/usr/local/etc/cups/ppd/${printer}.ppd"; + } elsif (-r "/usr/share/ppr/PPDFiles/${printer}.ppd") { # PPR PPDs + $ppdfile = "/usr/share/ppr/PPDFiles/${printer}.ppd"; + } elsif (-r "/usr/local/share/ppr/PPDFiles/${printer}.ppd") { + $ppdfile = "/usr/local/share/ppr/PPDFiles/${printer}.ppd"; + } else { + rip_die ("There is no readable PPD file for the printer " . + "$printer, is it configured?", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + } +} + + + +## Files to be printed (can be more than one for spooler-less printing) + +# Empty file list -> print STDIN +if ($#filelist < 0) { + @filelist = ("<STDIN>"); +} + +# Check file list +my $file; +my $filecnt = 0; +for $file (@filelist) { + if ($file ne "<STDIN>") { + if ($file =~ /^-/) { + rip_die ("Invalid argument: $file", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } elsif (! -r $file) { + print $logh "File $file does not exist/is not readable\n"; + splice(@filelist, $filecnt, 1); + $filecnt --; + } + } + $filecnt ++; +} + + + +## When we print without spooler or with CPS do not log onto STDERR unless +## the "-v" ('Verbose') is set or the debug mode is used +if ((($spooler eq 'direct') || ($spooler eq 'cps') || ($genpdqfile)) && + (!$verbose) && (!$debug)) { + close $logh; + open LOG, "> /dev/null"; + $logh = *LOG; + + use IO::Handle; + $logh->autoflush(1); +} + + + +## Start logging +if (!$debug) { + # If we are in debug mode, we do this earlier. + print $logh "foomatic-rip version $ripversion running...\n"; + # Print the command line only in debug mode, Mac OS X adds very many + # options so that CUPS cannot handle the output of the command line + # in its log files. If CUPS encounters a line with more than 1024 + # characters sent into its log files, it aborts the job with an error. + if (($debug) || ($spooler ne 'cups')) { + print $logh "called with arguments: '", join("', '",@ARGV), "'\n"; + } +} + + + +## PPD file + +# Load the PPD file and build a data structure for the renderer's +# command line and the options +open PPD, "< $ppdfile" || do { + print $logh "error opening $ppdfile.\n"; + rip_die ("Unable to open PPD file $ppdfile", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); +}; + +print $logh "Parsing PPD file ...\n"; + +my $dat = {}; # data structure for the options +my $currentargument = ""; # We are currently reading this argument + +# If we have an old Foomatic 2.0.x PPD file, read its built-in Perl +# data structure into @datablob and the default values in %ppddefaults +# Then delete the $dat structure, replace it by the one "eval"ed from +# @datablob, and correct the default settings according to the ones of +# the main PPD structure +my @datablob; + +# Parse the PPD file +sub undossify( $ ); +while(<PPD>) { + # foomatic-rip should also work with PPD file downloaded under Windows. + $_ = undossify($_); + # Parse keywords + if (m!^\*NickName:\s*\"(.*)$!) { + # "*NickName: <code>" + my $line = $1; + # Store the value + # Code string can have multiple lines, read all of them + my $cmd = ""; + while ($line !~ m!\"!) { + if ($line =~ m!&&$!) { + # line continues in next line + $cmd .= substr($line, 0, -2); + } else { + # line ends here + $cmd .= "$line\n"; + } + # Read next line + $line = <PPD>; + chomp $line; + } + $line =~ m!^([^\"]*)\"!; + $cmd .= $1; + $model = unhtmlify($cmd); + } elsif (m!^\*FoomaticIDs:\s*(\S+)\s+(\S+)\s*$!) { + # "*FoomaticIDs: <printer ID> <driver ID>" + my $id = $1; + my $driver = $2; + # Store the values + $dat->{'id'} = $id; + $dat->{'driver'} = $driver; + } elsif (m!^\*FoomaticRIPPostPipe:\s*\"(.*)$!) { + # "*FoomaticRIPPostPipe: <code>" + my $line = $1; + # Store the value + # Code string can have multiple lines, read all of them + my $cmd = ""; + while ($line !~ m!\"!) { + if ($line =~ m!&&$!) { + # line continues in next line + $cmd .= substr($line, 0, -2); + } else { + # line ends here + $cmd .= "$line\n"; + } + # Read next line + $line = <PPD>; + chomp $line; + } + $line =~ m!^([^\"]*)\"!; + $cmd .= $1; + $postpipe = unhtmlify($cmd); + } elsif (m!^\*FoomaticRIPCommandLine:\s*\"(.*)$!) { + # "*FoomaticRIPCommandLine: <code>" + my $line = $1; + # Store the value + # Code string can have multiple lines, read all of them + my $cmd = ""; + while ($line !~ m!\"!) { + if ($line =~ m!&&$!) { + # line continues in next line + $cmd .= substr($line, 0, -2); + } else { + # line ends here + $cmd .= "$line\n"; + } + # Read next line + $line = <PPD>; + chomp $line; + } + $line =~ m!^([^\"]*)\"!; + $cmd .= $1; + $dat->{'cmd'} = unhtmlify($cmd); + } elsif (m!^\*cupsFilter:\s*\"(.*)$!) { + # "*cupsFilter: <code>" + my $line = $1; + # Store the value + # Code string can have multiple lines, read all of them + my $cmd = ""; + while ($line !~ m!\"!) { + if ($line =~ m!&&$!) { + # line continues in next line + $cmd .= substr($line, 0, -2); + } else { + # line ends here + $cmd .= "$line\n"; + } + # Read next line + $line = <PPD>; + chomp $line; + } + $line =~ m!^([^\"]*)\"!; + $cmd .= $1; + my $cupsfilterline = unhtmlify($cmd); + if ($cupsfilterline =~ /^\s*(\S+)\s+\d+\s+(\S+)\s*$/) { + print $logh "*cupsFilter: \"$cupsfilterline\"\n"; + # Make a hash by mime type for all CUPS filters set in this PPD + $dat->{'cupsfilter'}{$1} = $2; + } + } elsif (m!^\*CustomPageSize\s+True:\s*\"(.*)$!) { + # "*CustomPageSize True: <code>" + my $setting = "Custom"; + my $translation = "Custom Size"; + my $line = $1; + # Make sure that the argument is in the data structure + checkarg ($dat, "PageSize"); + checkarg ($dat, "PageRegion"); + # Make sure that the setting is in the data structure + checksetting ($dat, "PageSize", $setting); + checksetting ($dat, "PageRegion", $setting); + $dat->{'args_byname'}{'PageSize'}{'vals_byname'}{$setting}{'comment'} = $translation; + $dat->{'args_byname'}{'PageRegion'}{'vals_byname'}{$setting}{'comment'} = $translation; + # Store the value + # Code string can have multiple lines, read all of them + my $code = ""; + while ($line !~ m!\"!) { + if ($line =~ m!&&$!) { + # line continues in next line + $code .= substr($line, 0, -2); + } else { + # line ends here + $code .= "$line\n"; + } + # Read next line + $line = <PPD>; + chomp $line; + } + $line =~ m!^([^\"]*)\"!; + $code .= $1; + if ($code !~ m!^%% FoomaticRIPOptionSetting!m) { + $dat->{'args_byname'}{'PageSize'}{'vals_byname'}{$setting}{'driverval'} = $code; + $dat->{'args_byname'}{'PageRegion'}{'vals_byname'}{$setting}{'driverval'} = $code; + } + } elsif (m!^\*(JCL|)OpenUI\s+\*([^:]+):\s*(\S+)\s*$!) { + # "*[JCL]OpenUI *<option>[/<translation>]: <type>" + my $argnametrans = $2; + my $argtype = $3; + my $argname; + my $translation = ""; + if ($argnametrans =~ m!^([^:/\s]+)/([^:]*)$!) { + $argname = $1; + $translation = $2; + } else { + $argname = $argnametrans; + } + # Make sure that the argument is in the data structure + checkarg ($dat, $argname); + # Store the values + $dat->{'args_byname'}{$argname}{'comment'} = $translation; + # Set the argument type only if not defined yet, a + # definition in "*FoomaticRIPOption" has priority + if ( !($dat->{'args_byname'}{$argname}{'type'}) ) { + if ($argtype eq "PickOne") { + $dat->{'args_byname'}{$argname}{'type'} = 'enum'; + } elsif ($argtype eq "PickMany") { + $dat->{'args_byname'}{$argname}{'type'} = 'pickmany'; + } elsif ($argtype eq "Boolean") { + $dat->{'args_byname'}{$argname}{'type'} = 'bool'; + } + } + # Mark in which argument we are currently, so that we can find + # the entries for the choices + $currentargument = $argname; + } elsif (m!^\*(JCL|)CloseUI:\s+\*([^:/\s]+)\s*$!) { + # "*[JCL]CloseUI *<option>" + my $argname = $2; + # Unmark the current argument to do not mis-interpret any keywords + # as choices + $currentargument = ""; + } elsif ((m!^\*FoomaticRIPOption ([^/:\s]+):\s*(\S+)\s+(\S+)\s+(\S)\s*$!) || + (m!^\*FoomaticRIPOption ([^/:\s]+):\s*(\S+)\s+(\S+)\s+(\S)\s+(\S+)\s*$!)){ + # "*FoomaticRIPOption <option>: <type> <style> <spot> [<order>]" + # <order> only used for 1-choice enum options + my $argname = $1; + my $argtype = $2; + my $argstyle = $3; + my $spot = $4; + my $order = $5; + # Make sure that the argument is in the data structure + checkarg ($dat, $argname); + # Store the values + $dat->{'args_byname'}{$argname}{'type'} = $argtype; + if ($argstyle eq "PS") { + $dat->{'args_byname'}{$argname}{'style'} = 'G'; + } elsif ($argstyle eq "CmdLine") { + $dat->{'args_byname'}{$argname}{'style'} = 'C'; + } elsif ($argstyle eq "JCL") { + $dat->{'args_byname'}{$argname}{'style'} = 'J'; + $dat->{'jcl'} = 1; + } elsif ($argstyle eq "Composite") { + $dat->{'args_byname'}{$argname}{'style'} = 'X'; + } + $dat->{'args_byname'}{$argname}{'spot'} = $spot; + # $order only defined here for 1-choice enum options + if ($order) { + $dat->{'args_byname'}{$argname}{'order'} = $order; + } + } elsif (m!^\*FoomaticRIPOptionPrototype\s+([^/:\s]+):\s*\"(.*)$!) { + # "*FoomaticRIPOptionPrototype <option>: <code>" + # Used for numerical and string options only + my $argname = $1; + my $line = $2; + # Make sure that the argument is in the data structure + checkarg ($dat, $argname); + # Store the value + # Code string can have multiple lines, read all of them + my $proto = ""; + while ($line !~ m!\"!) { + if ($line =~ m!&&$!) { + # line continues in next line + $proto .= substr($line, 0, -2); + } else { + # line ends here + $proto .= "$line\n"; + } + # Read next line + $line = <PPD>; + chomp $line; + } + $line =~ m!^([^\"]*)\"!; + $proto .= $1; + $dat->{'args_byname'}{$argname}{'proto'} = unhtmlify($proto); + } elsif (m!^\*FoomaticRIPOptionRange\s+([^/:\s]+):\s*(\S+)\s+(\S+)\s*$!) { + # "*FoomaticRIPOptionRange <option>: <min> <max>" + # Used for numerical options only + my $argname = $1; + my $min = $2; + my $max = $3; + # Make sure that the argument is in the data structure + checkarg ($dat, $argname); + # Store the values + $dat->{'args_byname'}{$argname}{'min'} = $min; + $dat->{'args_byname'}{$argname}{'max'} = $max; + } elsif (m!^\*FoomaticRIPOptionMaxLength\s+([^/:\s]+):\s*(\S+)\s*$!) { + # "*FoomaticRIPOptionMaxLength <option>: <length>" + # Used for string options only + my $argname = $1; + my $maxlength = $2; + # Make sure that the argument is in the data structure + checkarg ($dat, $argname); + # Store the value + $dat->{'args_byname'}{$argname}{'maxlength'} = $maxlength; + } elsif (m!^\*FoomaticRIPOptionAllowedChars\s+([^/:\s]+):\s*\"(.*)$!) { + # "*FoomaticRIPOptionAllowedChars <option>: <code>" + # Used for string options only + my $argname = $1; + my $line = $2; + # Store the value + # Code string can have multiple lines, read all of them + my $code = ""; + while ($line !~ m!\"!) { + if ($line =~ m!&&$!) { + # line continues in next line + $code .= substr($line, 0, -2); + } else { + # line ends here + $code .= "$line\n"; + } + # Read next line + $line = <PPD>; + chomp $line; + } + $line =~ m!^([^\"]*)\"!; + $code .= $1; + # Make sure that the argument is in the data structure + checkarg ($dat, $argname); + # Store the value + $dat->{'args_byname'}{$argname}{'allowedchars'} = unhtmlify($code); + } elsif (m!^\*FoomaticRIPOptionAllowedRegExp\s+([^/:\s]+):\s*\"(.*)$!) { + # "*FoomaticRIPOptionAllowedRegExp <option>: <code>" + # Used for string options only + my $argname = $1; + my $line = $2; + # Store the value + # Code string can have multiple lines, read all of them + my $code = ""; + while ($line !~ m!\"!) { + if ($line =~ m!&&$!) { + # line continues in next line + $code .= substr($line, 0, -2); + } else { + # line ends here + $code .= "$line\n"; + } + # Read next line + $line = <PPD>; + chomp $line; + } + $line =~ m!^([^\"]*)\"!; + $code .= $1; + # Make sure that the argument is in the data structure + checkarg ($dat, $argname); + # Store the value + $dat->{'args_byname'}{$argname}{'allowedregexp'} = + unhtmlify($code); + } elsif (m!^\*OrderDependency:\s*(\S+)\s+(\S+)\s+\*([^:/\s]+)\s*$!) { + # "*OrderDependency: <order> <section> *<option>" + my $order = $1; + my $section = $2; + my $argname = $3; + # Make sure that the argument is in the data structure + checkarg ($dat, $argname); + # Store the values + $dat->{'args_byname'}{$argname}{'order'} = $order; + $dat->{'args_byname'}{$argname}{'section'} = $section; + } elsif (m!^\*Default([^/:\s]+):\s*([^/:\s]+)\s*$!) { + # "*Default<option>: <value>" + my $argname = $1; + my $default = $2; + # Make sure that the argument is in the data structure + checkarg ($dat, $argname); + # Store the value + $dat->{'args_byname'}{$argname}{'default'} = $default; + } elsif (m!^\*FoomaticRIPDefault([^/:\s]+):\s*([^/:\s]+)\s*$!) { + # "*FoomaticRIPDefault<option>: <value>" + # Used for numerical options only + my $argname = $1; + my $default = $2; + # Make sure that the argument is in the data structure + checkarg ($dat, $argname); + # Store the value + $dat->{'args_byname'}{$argname}{'fdefault'} = $default; + } elsif (m!^\*$currentargument\s+([^:]+):\s*\"(.*)$!) { + # "*<option> <choice>[/<translation>]: <code>" + my $settingtrans = $1; + my $line = $2; + my $translation = ""; + my $setting = ""; + if ($settingtrans =~ m!^([^:/\s]+)/([^:]*)$!) { + $setting = $1; + $translation = $2; + } else { + $setting = $settingtrans; + } + # Make sure that the argument is in the data structure + checkarg ($dat, $currentargument); + # Make sure that the setting is in the data structure (enum options) + my $bool = + ($dat->{'args_byname'}{$currentargument}{'type'} eq 'bool'); + if ($bool) { + if (lc($setting) eq "true") { + if (!$dat->{'args_byname'}{$currentargument}{'comment'}) { + $dat->{'args_byname'}{$currentargument}{'comment'} = + $translation; + } + $dat->{'args_byname'}{$currentargument}{'comment_true'} = + $translation; + } else { + $dat->{'args_byname'}{$currentargument}{'comment_false'} = + $translation; + } + } else { + checksetting ($dat, $currentargument, $setting); + # Make sure that this argument has a default setting, even if + # none is defined in this PPD file + if (!$dat->{'args_byname'}{$currentargument}{'default'}) { + $dat->{'args_byname'}{$currentargument}{'default'} = $setting; + } + $dat->{'args_byname'}{$currentargument}{'vals_byname'}{$setting}{'comment'} = $translation; + } + # Store the value + # Code string can have multiple lines, read all of them + my $code = ""; + while ($line !~ m!\"!) { + if ($line =~ m!&&$!) { + # line continues in next line + $code .= substr($line, 0, -2); + } else { + # line ends here + $code .= "$line\n"; + } + # Read next line + $line = <PPD>; + chomp $line; + } + $line =~ m!^([^\"]*)\"!; + $code .= $1; + if ($code !~ m!^%% FoomaticRIPOptionSetting!) { + if ($bool) { + if (lc($setting) eq "true") { + $dat->{'args_byname'}{$currentargument}{'proto'} = $code; + } else { + $dat->{'args_byname'}{$currentargument}{'protof'} = $code; + } + } else { + $dat->{'args_byname'}{$currentargument}{'vals_byname'}{$setting}{'driverval'} = $code; + } + } + } elsif ((m!^\*FoomaticRIPOptionSetting\s+([^/:=\s]+)=([^/:=\s]+):\s*\"(.*)$!) || + (m!^\*FoomaticRIPOptionSetting\s+([^/:=\s]+):\s*\"(.*)$!)) { + # "*FoomaticRIPOptionSetting <option>[=<choice>]: <code>" + # For boolean options <choice> is not given + my $argname = $1; + my $setting = $2; + my $line = $3; + my $bool = 0; + if (!$line) { + $line = $setting; + $bool = 1; + } + # Make sure that the argument is in the data structure + checkarg ($dat, $argname); + # Make sure that the setting is in the data structure (enum options) + if (!$bool) { + checksetting ($dat, $argname, $setting); + # Make sure that this argument has a default setting, even if + # none is defined in this PPD file + if (!$dat->{'args_byname'}{$argname}{'default'}) { + $dat->{'args_byname'}{$argname}{'default'} = $setting; + } + } + # Store the value + # Code string can have multiple lines, read all of them + my $code = ""; + while ($line !~ m!\"!) { + if ($line =~ m!&&$!) { + # line continues in next line + $code .= substr($line, 0, -2); + } else { + # line ends here + $code .= "$line\n"; + } + # Read next line + $line = <PPD>; + chomp $line; + } + $line =~ m!^([^\"]*)\"!; + $code .= $1; + if ($bool) { + $dat->{'args_byname'}{$argname}{'proto'} = unhtmlify($code); + } else { + $dat->{'args_byname'}{$argname}{'vals_byname'}{$setting}{'driverval'} = unhtmlify($code); + } + } elsif (m!^\*JCL(Begin|ToPSInterpreter|End):\s*\"(.*)$!) { + # "*JCL(Begin|ToPSInterpreter|End): <code>" + # The printer supports PJL/JCL when there is such a line + $dat->{'jcl'} = 1; + my $item = $1; + my $line = $2; + # Store the value + # Code string can have multiple lines, read all of them + my $code = ""; + while ($line !~ m!\"!) { + if ($line =~ m!&&$!) { + # line continues in next line + $code .= substr($line, 0, -2); + } else { + # line ends here + $code .= "$line\n"; + } + # Read next line + $line = <PPD>; + chomp $line; + } + $line =~ m!^([^\"]*)\"!; + $code .= $1; + if ($item eq 'Begin') { + $jclbegin = unhexify($code); + } elsif ($item eq 'ToPSInterpreter') { + $jcltointerpreter = unhexify($code); + } elsif ($item eq 'End') { + $jclend = unhexify($code); + } + } elsif (m!^\*\% COMDATA \#(.*)$!) { + # If we have an old Foomatic 2.0.x PPD file, collect its Perl data + push (@datablob, $1); + } +} +close PPD; + +# If we have an old Foomatic 2.0.x PPD file use its Perl data structure +if ($#datablob >= 0) { + print $logh "${added_lf}You are using an old Foomatic 2.0 PPD file, consider " . + "upgrading.${added_lf}\n"; + my $VAR1; + if (eval join('',@datablob)) { + # Overtake default settings from the main structure of the PPD file + for my $arg (@{$dat->{'args'}}) { + if ($arg->{'default'}) { + $VAR1->{'argsbyname'}{$arg->{'name'}}{'default'} = + $arg->{'default'}; + } + } + undef $dat; + $dat = $VAR1; + $dat->{'jcl'} = $dat->{'pjl'}; + } else { + # Perl structure broken + print $logh "${added_lf}Unable to evaluate datablob, print job may come " . + "out incorrectly or not at all.${added_lf}\n"; + } +} + + + +## We do not need to parse the PostScript job when we don't have +## any options. If we have options, we must check whether the +## default settings from the PPD file are valid and correct them +## if nexessary. + +my $dontparse = 0; +if ((!defined(@{$dat->{'args'}})) || + ($#{$dat->{'args'}} < 0)) { + # We don't have any options, so we do not need to parse the + # PostScript data + $dontparse = 1; +} else { + # Let the default value of a boolean option being 0 or 1 instead of + # "True" or "False", range-check the defaults of all options and + # issue warnings if the values are not valid + checkoptions($dat, 'default'); + + # Adobe's PPD specs do not support numerical + # options. Therefore the numerical options are mapped to + # enumerated options in the PPD file and their characteristics + # as a numerical option are stored in "*Foomatic..." + # keywords. A default must be between the enumerated + # fixed values. The default + # value must be given by a "*FoomaticRIPDefault<option>: + # <value>" line in the PPD file. But this value is only valid + # if the "official" default given by a "*Default<option>: + # <value>" line (it must be one of the enumerated values) + # points to the enumerated value which is closest to this + # value. This way a user can select a default value with a + # tool only supporting PPD files but not Foomatic extensions. + # This tool only modifies the "*Default<option>: <value>" line + # and if the "*FoomaticRIPDefault<option>: <value>" had always + # priority, the user's change in "*Default<option>: <value>" + # would have no effect. + + for my $arg (@{$dat->{'args'}}) { + if ($arg->{'fdefault'}) { + if ($arg->{'default'}) { + if ($arg->{'type'} =~ /^(int|float)$/) { + if ($arg->{'fdefault'} < $arg->{'min'}) { + $arg->{'fdefault'} = $arg->{'min'}; + } + if ($arg->{'fdefault'} > $arg->{'max'}) { + $arg->{'fdefault'} = $arg->{'max'}; + } + my $mindiff = abs($arg->{'max'} - $arg->{'min'}); + my $closestvalue; + for my $val (@{$arg->{'vals'}}) { + if (abs($arg->{'fdefault'} - $val->{'value'}) < + $mindiff) { + $mindiff = + abs($arg->{'fdefault'} - $val->{'value'}); + $closestvalue = $val->{'value'}; + } + } + if (($arg->{'default'} == $closestvalue) || + (abs($arg->{'default'} - $closestvalue) / + $closestvalue < 0.001)) { + $arg->{'default'} = $arg->{'fdefault'}; + } + } + } else { + $arg->{'default'} = $arg->{'fdefault'}; + } + } + } +} + +# Is our PPD for a CUPS raster driver +if (my $cupsfilter = $dat->{'cupsfilter'}{"application/vnd.cups-raster"}) { + + # Search filter in cupsfilterpath + # The %Y is a placeholder for the option settings + my $havefilter = 0; + for (split(':', $cupsfilterpath)) { + if (-x "$_/$cupsfilter") { + $havefilter=1; + $cupsfilter = "$_/$cupsfilter 0 '' '' 0 '%Y%X'"; + last; + } + } + + if (!$havefilter) { + + # We do not have the required filter, so we assume that + # rendering this job is supposed to be done on a remote + # server. So we do not define a renderer command line and + # embed only the option settings (as we had a PostScript + # printer). This way the settings are # taken into account + # when the job is rendered on the server. + print $logh "${added_lf}CUPS filter for this PPD file not found " . + "assuming that job will be rendered on a remote server. Only " . + "the PostScript of the options will be inserted into the " . + "PostScript data stream.${added_lf}\n"; + + } else { + + # use pstoraster script if available, otherwise run GhostScript + # directly + my $pstoraster = "pstoraster"; + my $havepstoraster = 0; + for (split(':', $cupsfilterpath)) { + if (-x "$_/$pstoraster") { + $havepstoraster=1; + $pstoraster = "$_/$pstoraster 0 '' '' 0 '%X'"; + last; + } + } + + if (!$havepstoraster) { + + # Build GhostScript command line + $pstoraster = "gs -dQUIET -dDEBUG -dPARANOIDSAFER -dNOPAUSE -dBATCH -dNOMEDIAATTRS -sDEVICE=cups -sOutputFile=-%W -" + + } + + # build GhostScript/CUPS driver command line + $dat->{'cmd'} = "$pstoraster | $cupsfilter"; + + # Set environment variables + $ENV{'PPD'} = $ppdfile; + + } +} + +# Was the RIP command line defined in the PPD file? If not, we assume a +# PostScript printer and do not render/translate the input data +if (!defined($dat->{'cmd'})) { + $dat->{'cmd'} = "cat%A%B%C%D%E%F%G%H%I%J%K%L%M%Z"; + if ($dontparse) { + # No command line, no options, we have a raw queue, don't check + # whether the input is PostScript and ignore the "docs" option, + # simply pass the input data to the backend. + $dontparse = 2; + $model = "Raw queue"; + } +} + + + +## Summary for debugging +print $logh "${added_lf}Parameter Summary\n"; +print $logh "-----------------${added_lf}\n"; +print $logh "Spooler: $spooler\n"; +print $logh "Printer: $printer\n"; +print $logh "PPD file: $ppdfile\n"; +print $logh "Printer model: $model\n"; +# Print the options string only in debug mode, Mac OS X adds very many +# options so that CUPS cannot handle the output of the option string +# in its log files. If CUPS encounters a line with more than 1024 characters +# sent into its log files, it aborts the job with an error. +if (($debug) || ($spooler ne 'cups')) { + print $logh "Options: $optstr\n"; +} +print $logh "Job title: $jobtitle\n"; +print $logh "File(s) to be printed: ${added_lf}@filelist${added_lf}\n"; + + + +## Parse options from command line ($optstr) + +# Before we start, save the defaults for printing documentation pages + +copyoptions($dat, 'default', 'userval'); + + +# The options are "foo='bar nut'", "foo", "nofoo", "'bar nut'", or +# "foo:'bar nut'" (when GPR was used) all with spaces between... +# In addition they can be preceeded by page ranges, separated with a +# colon. + +my @opts; + +# Variable for PPR's backend interface name (parallel, tcpip, atalk, ...) + +my $backend = ""; + +# Array to collect unknown options so that they can get passed to the +# backend interface of PPR. For other spoolers we ignore them. + +my @backendoptions = (); + +# "foo='bar nut'" +while ($optstr =~ s!(((even|odd|[\d,-]+):|)\w+=[\'\"].*?[\'\"]) ?!!i) { + push (@opts, $1); +} + +# "foo:'bar nut'" (GPR separates option and setting with a colon ":") +while ($optstr =~ s!(((even|odd|[\d,-]+):|)\w+:[\'\"].*?[\'\"]) ?!!i) { +#while ($optstr =~ s!(\w+=[\'\"].*?[\'\"])!!i) { + push (@opts, $1); +} + +# "'bar nut'", "'foo=bar nut'", "'foo:bar nut'" +while ($optstr =~ s!([\'\"].+?[\'\"]) ?!!) { + my $opt = $1; + $opt =~ s/[\'\"]//g; # Make only sure that we didn't quote + # the option for a second time when we read + # rge options from the command line or + # environment variable + push (@opts, $opt); + +} + +# "foo", "nofoo" +push(@opts, split(/ /,$optstr)); + +# Now actually process those pesky options... + +for (@opts) { + print $logh "Pondering option '$_'\n"; + + # "docs" option to print help page + if ((lc($_) =~ /^\s*docs\s*$/) || + (lc($_) =~ /^\s*docs\s*=\s*true\s*$/)) { + # The second one is necessary becuase CUPS 1.1.15 or newer sees + # "docs" as boolean option and modifies it to "docs=true" + $do_docs = 1; + next; + } + + # "profile" option to supply a color correction profile to a + # CUPS raster driver + if (lc($_) =~ /^\s*profile=(\S+)\s*$/) { + $cupscolorprofile=$1; + $dat->{'cmd'} =~ s!\%X!profile=$cupscolorprofile!g; + $dat->{'cmd'} =~ s!\%W! -c\"<</cupsProfile($cupscolorprofile)>>setpagedevice\"!g; + next; + } + + # Is the command line option limited to certain page ranges? If so, + # mark the setting with a hash key containing the ranges + my $optionset; + if (s/^(even|odd|[\d,-]+)://i) { + $optionset = "pages:$1"; + } else { + $optionset = 'userval'; + } + + my $arg; + if ((m!([^=]+)=\'?(.*)\'?!) || (m!([^=:]+):\'?(.*)\'?!)) { + my ($aname, $avalue) = ($1, $2); + + if (($optionset =~ /pages/) && + ($arg = argbyname($aname)) && + ((!defined($arg->{'section'})) || + ($arg->{'section'} !~ /^(Any|Page)Setup/))) { + print $logh "This option is not a \"PageSetup\" or " . + "\"AnySetup\" option, so it cannot be restricted to " . + "a page range.\n"; + next; + } + + # At first look for the "backend" option to determine the PPR + # backend to use + if (($aname =~ m!^backend$!i) && ($spooler eq 'ppr_int')) { + # Backend interface name + $backend = $avalue; + } elsif ($aname =~ m!^media$!i) { + + # Standard arguments? + # media=x,y,z + # sides=one|two-sided-long|short-edge + + # Rummage around in the media= option for known media, source, + # etc types. + # We ought to do something sensible to make the common manual + # boolean option work when specified as a media= tray thing. + # + # Note that this fails miserably when the option value is in + # fact a number; they all look alike. It's unclear how many + # drivers do that. We may have to standardize the verbose + # names to make them work as selections, too. + + my @values = split(',',$avalue); + for (@values) { + my $val; + if ($dat->{'args_byname'}{'PageSize'} and + $val=valbyname($dat->{'args_byname'}{'PageSize'},$_)) { + $dat->{'args_byname'}{'PageSize'}{$optionset} = + $val->{'value'}; + # Keep "PageRegion" in sync + if ($dat->{'args_byname'}{'PageRegion'} and + $val=valbyname($dat->{'args_byname'}{'PageRegion'}, + $_)) { + $dat->{'args_byname'}{'PageRegion'}{$optionset} = + $val->{'value'}; + } + } elsif ($dat->{'args_byname'}{'PageSize'} + and /^Custom/) { + $dat->{'args_byname'}{'PageSize'}{$optionset} = $_; + # Keep "PageRegion" in sync + if ($dat->{'args_byname'}{'PageRegion'}) { + $dat->{'args_byname'}{'PageRegion'}{$optionset} = + $_; + } + } elsif ($dat->{'args_byname'}{'MediaType'} and + $val=valbyname($dat->{'args_byname'}{'MediaType'}, + $_)) { + $dat->{'args_byname'}{'MediaType'}{$optionset} = + $val->{'value'}; + } elsif ($dat->{'args_byname'}{'InputSlot'} and + $val=valbyname($dat->{'args_byname'}{'InputSlot'}, + $_)) { + $dat->{'args_byname'}{'InputSlot'}{$optionset} = + $val->{'value'}; + } elsif (lc($_) eq 'manualfeed') { + # Special case for our typical boolean manual + # feeder option if we didn't match an InputSlot above + if (defined($dat->{'args_byname'}{'ManualFeed'})) { + $dat->{'args_byname'}{'ManualFeed'}{$optionset} = 1; + } + } else { + print $logh "Unknown \"media\" component: \"$_\".\n"; + } + } + } elsif ($aname =~ m!^sides$!i) { + # Handle the standard duplex option, mostly + if ($avalue =~ m!^two-sided!i) { + if (defined($dat->{'args_byname'}{'Duplex'})) { + # We set "Duplex" to '1' here, the real argument setting + # will be done later + $dat->{'args_byname'}{'Duplex'}{$optionset} = '1'; + # Check the binding: "long edge" or "short edge" + if ($avalue =~ m!long-edge!i) { + if (defined($dat->{'args_byname'}{'Binding'})) { + $dat->{'args_byname'}{'Binding'}{$optionset} = + $dat->{'args_byname'}{'Binding'}{'vals_byname'}{'LongEdge'}{'value'}; + } else { + $dat->{'args_byname'}{'Duplex'}{$optionset} = + 'LongEdge'; + } + } elsif ($avalue =~ m!short-edge!i) { + if (defined($dat->{'args_byname'}{'Binding'})) { + $dat->{'args_byname'}{'Binding'}{$optionset} = + $dat->{'args_byname'}{'Binding'}{'vals_byname'}{'ShortEdge'}{'value'}; + } else { + $dat->{'args_byname'}{'Duplex'}{$optionset} = + 'ShortEdge'; + } + } + } + } elsif ($avalue =~ m!^one-sided!i) { + if (defined($dat->{'args_byname'}{'Duplex'})) { + # We set "Duplex" to '0' here, the real argument setting + # will be done later + $dat->{'args_byname'}{'Duplex'}{$optionset} = '0'; + } + } + + # We should handle the other half of this option - the + # BindEdge bit. Also, are there well-known ipp/cups + # options for Collate and StapleLocation? These may be + # here... + + } else { + # Various non-standard printer-specific options + if ($arg = argbyname($aname)) { + if (defined(my $newvalue = + checkoptionvalue($dat, $aname, $avalue, 0))) { + # If the choice is valid, use it, otherwise + # ignore it. + $arg->{$optionset} = $newvalue; + # If this argument is PageSize or PageRegion, + # also set the other + syncpagesize($dat, $aname, $avalue, $optionset); + } else { + # Invalid choice, make log entry + print $logh "Invalid choice $aname=$avalue.\n"; + } + } elsif ($spooler eq 'ppr_int') { + # Unknown option, pass it to PPR's backend interface + push (@backendoptions, "$aname=$avalue"); + } else { + # Unknown option, make log entry + print $logh "Unknown option $aname=$avalue.\n"; + } + } + } elsif (m!^([\d\.]+)x([\d\.]+)([A-Za-z]*)$!) { + my ($w, $h, $u) = ($1, $2, $3); + # Custom paper size + if (($w != 0) && ($h != 0) && + ($arg=argbyname("PageSize")) && + (defined($arg->{'vals_byname'}{'Custom'}))) { + $arg->{$optionset} = "Custom.${w}x${h}${u}"; + # Keep "PageRegion" in sync + if ($dat->{'args_byname'}{'PageRegion'}) { + $dat->{'args_byname'}{'PageRegion'}{$optionset} = + $arg->{$optionset}; + } + } + } elsif ((m!^\s*no(.+)\s*$!i) and ($arg=argbyname($1))) { + # standard bool args: + # landscape; what to do here? + # duplex; we should just handle this one OK now? + $arg->{$optionset} = 0; + } elsif (m!^\s*(.+)\s*$!) { + if ($arg=argbyname($1)) { + $arg->{$optionset} = 1; + } else { + print $logh "Unknown boolean option \"$1\".\n"; + } + } +} +$do_docs = 1 if( $show_docs ); + + +## Were we called to build the PDQ driver declaration file? +my @pdqfile; +if ($genpdqfile) { + @pdqfile = buildpdqdriver($dat, 'userval'); + open PDQFILE, $genpdqfile or + rip_die("Cannot write PDQ driver declaration file", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + print PDQFILE join('', @pdqfile); + close PDQFILE; + exit $EXIT_PRINTED; +} + + + +## Set the $postpipe + +# $postpipe when running as a PPR RIP +if ($spooler eq 'ppr') { + # The PPR RIP sends the data output to /dev/fd/3 instead of to STDOUT + if (-w "/dev/fd/3") { + $postpipe = "| cat - > /dev/fd/3"; + } else { + $postpipe = "| cat - >&3"; + } +} + +# Set up PPR backend (if we run as a PPR interface). +if ($spooler eq 'ppr_int') { + + # Is the chosen backend installed and executable + if (!-x "interfaces/$backend") { + my $pwd = cwd; + print $logh "The backend interface $pwd/interfaces/$backend " . + "does not exist/is not executable!\n"; + rip_die ("The backend interface $pwd/interfaces/$backend " . + "does not exist/is not executable!", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + + # foomatic-rip cannot use foomatic-rip as backend + if ($backend eq "foomatic-rip") { + print $logh "\"foomatic-rip\" cannot use itself as backend " . + "interface!\n"; + ppr_die ($ppr_printer, + "\"foomatic-rip\" cannot use itself as backend interface!", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + + # Put the backend interface into the $postpipe + $postpipe = "| ( interfaces/$backend \"$ppr_printer\" ". + "\"$ppr_address\" \"" . join(" ",@backendoptions) . + "\" \"$ppr_jobbreak\" \"$ppr_feedback\" " . + "\"$ppr_codes\" \"$ppr_jobname\" \"$ppr_routing\" " . + "\"$ppr_for\" \"\" )"; + +} + +# CUPS and PDQ have their own backends, they do not need a $postpipe +if (($spooler eq 'cups') || ($spooler eq 'pdq')) { + # No $postpipe for CUPS or PDQ, even if one is defined in the PPD file + $postpipe = ""; +} + +# CPS needs always a $postpipe, set the default one for local printing +# if none is set +if (($spooler eq 'cps') && !$postpipe) { + $postpipe = "| cat - > \$LPDDEV"; +} + +if ($postpipe) { + print $logh "${added_lf}Output will be redirected to:\n$postpipe${added_lf}\n"; +} + + + +## Print documentation page when asked for +my ($docgeneratorhandle, $docgeneratorpid,$retval); +if ($do_docs) { + # Don't print the supplied files, STDIN will be redirected to the + # documentation page generator + @filelist = ("<STDIN>"); + # Start the documentation page generator + ($docgeneratorhandle, $docgeneratorpid) = + getdocgeneratorhandle($dat); + if ($retval != $EXIT_PRINTED) { + rip_die ("Error opening documentation page generator", + $retval); + } + # Read the further data from the documentation page generator and + # not from STDIN + if (!close STDIN && $! != $ESPIPE) { + rip_die ("Couldn't close STDIN", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + if (!open (STDIN, "<&$docgeneratorhandle")) { + rip_die ("Couldn't dup \$docgeneratorhandle", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + if( $show_docs ){ + while( <$docgeneratorhandle> ){ + print; + } + exit(0); + } +} + + + + +## In debug mode save the data supposed to be fed into the +## renderer also into a file, reset the file here + +if ($debug) { + system("> ${logfile}.ps"); +} + + + +## From here on we have to repeat all the rest of the program for +## every file to print + +for $file (@filelist) { + + print $logh +"${added_lf}================================================\n${added_lf}". +"File: $file\n${added_lf}" . +"================================================\n${added_lf}"; + + + + ## If we do not print standard input, open the file to print + if ($file ne "<STDIN>") { + if (! -r $file) { + print $logh "File $file missing or not readable, skipping.\n"; + next; + } + close STDIN; + open STDIN, "< $file" || do { + print $logh "Cannot open $file, skipping.\n"; + next; + } + } + + + + ## Do we have a raw queue + if ($dontparse == 2) { + # Raw queue, simply pass the input into the $postpipe (or to STDOUT + # when there is no $postpipe) + print $logh "Raw printing, executing \"cat $postpipe\"${added_lf}\n"; + system("cat $postpipe"); + next; + } + + + + ## First, for arguments with a default, stick the default in as + ## the initial value for the "header" option set, this option set + ## consists of the PPD defaults, the options specified on the + ## command line, and the options set in the header part of the + ## PostScript file (all before the first page begins). + + copyoptions($dat, 'userval', 'header'); + + + + ## Next, examine the PostScript job for traces of command-line and + ## JCL options. PPD-aware applications and spoolers stuff option + ## settings directly into the file, they do not necessarily send + ## PPD options by the command line. Also stuff in PostScript code + ## to apply option settings given by the command line and to set + ## the defaults given in the PPD file. + + # Examination strategy: read lines from STDIN until the first + # %%Page: comment appears and save them as @psheader. This is the + # page-independent header part of the PostScript file. The + # PostScript interpreter (renderer) must execute this part once + # before rendering any assortment of pages. Then pages can be + # printed in any arbitrary selection or order. All option + # settings we find here will be collected in the default option + # set for the RIP command line. + + # Now the pages will be read and sent to the renderer, one after + # the other. Every page is read into memory until the + # %%EndPageSetup comment appears (or a certain amount of lines was + # read). So we can get option settings only valid for this + # page. If we have such settings we set them in the modified + # command set for this page. + + # If the renderer is not running yet (first page) we start it with + # the command line built from the current modified command set and + # send the first page to it, in the end we leave the renderer + # running and keep input and output pipes open, so that it can + # accept further pages. If the renderer is still running from + # the previous page and the current modified command set is the + # same as the one for the previous page, we send the page. If + # the command set is different, we close the renderer, re-start + # it with the command line built from the new modified command + # set, send the header again, and then the page. + + # After the last page the trailer (%%Trailer) is sent. + + # The output pipe of this program stays open all the time so that + # the spooler does not assume that the job has finished when the + # renderer is re-started. + + # Non DSC-conforming documents will be read until a certain line + # number is reached. Command line or JCL options inserted later + # will be ignored. + + # If options are implemented by PostScript code supposed to be + # stuffed into the job's PostScript data we stuff the code for all + # these options into our job data, So all default settings made in + # the PPD file (the user can have edited the PPD file to change + # them) are taken care of and command line options get also + # applied. To give priority to settings made by applications we + # insert the options's code in the beginnings of their respective + # sections, so that sommething, which is already inserted, gets + # executed after our code. Missing sections are automatically + # created. In non-DSC-conforming files we insert the option code + # in the beginning of the file. This is the same policy as used by + # the "pstops" filter of CUPS. + + # If CUPS is the spooler, the option settings were already + # inserted by the "pstops" filter, so we don't insert them + # again. The only thing we do is correcting settings of numerical + # options when they were set to a value not available as choice in + # the PPD file, As "pstops" does not support "real" numerical + # options, it sees these settings as an invalid choice and stays + # with the default setting. In this case we correct the setting in + # the first occurence of the option's code, as this one is the one + # added by CUPS, later occurences come from applications and + # should not be touched. + + # If the input is not PostScript (if there is no "%!" after + # $maxlinestopsstart lines) a file conversion filter will + # automatically be applied to the incoming data, so that we will + # process the resulting PostScript here. This way we have always + # PostScript data here and so we can apply the printer/driver + # features described in the PPD file. + + # Supported file conversion filters are "a2ps", "enscript", + # "mpage", and spooler-specific filters. All filters convert + # plain text to PostScript, "a2ps" also other formats. The + # conversion filter is always used when one prints the + # documentation pages, as they are created as plain text, + # when CUPS is the spooler "pstops" is executed after the + # filter so that the default option settings from the PPD file + # and CUPS-specific options as N-up get applied. On regular + # printouts one gets always PostScript when CUPS or PPR is + # the spooler, so the filter is only used for regular + # printouts under LPD, LPRng, GNUlpr or without spooler. + + my $maxlines = 1000; # Maximum number of lines to be read + # when the documenent is not + # DSC-conforming. "$maxlines = 0" + # means that all will be read + # and examined. If it is + # discovered that the input file + # is DSC-conforming, this will + # be set to 0. + + my $maxlinestopsstart = 200; # That many lines are allowed until the + # "%!" indicating PS comes. These + # additional lines in the + # beginning are usually JCL + # commands. The lines will be + # ignored by our parsing but + # passed through. + + my $maxlinesforpageoptions=200; # Unfortunately, CUPS does not bracket + # "PageSetup" option with + # "%%BeginPageSetup" and + # "%%EndPageSetup", so the options + # can simply stand after the + # page header and before the + # page code, without special + # marking. So buffer this amount + # of lines before printing the + # page to check for options. + + my $maxnondsclinesinheader=1000; # If there is a block of more lines + # than this in the document + # header which is not in the + # "%%BeginProlog...%%EndProlog" + # or + # "%%BeginSetup...%%EndSetup" + # sections, the document is not + # considered as DSC-conforming + # and the rest gets passed + # through to the renderer without + # further parsing for options. + + my $nondsclines = 0; # Amount of lines found which are not in + # a section (see + # $maxnondsclinesinheader). + + my $nonpslines = 0; # lines before "%!" found yet. + + my $more_stuff = 1; # there is more stuff in stdin. + + my $linect = 0; # how many lines have we examined? + + my $onelinebefore = ""; # The line before the current line + # (Non-DSC comments are ignored) + + my $twolinesbefore = ""; # The line two lines before the current + # line (Non-DSC comments are ignored) + + my @psheader = (); # The header of the PostScript file, + # to be sent after each start of the + # renderer + + my @psfifo = (); # The input FIFO, data which we have + # pulled from stdin for examination, + # but not sent to the renderer yet. + + my $passthru = 0; # 0: write data into @psfifo; 1: pass + # data directly to the renderer + + my $isdscjob = 0; # Is the job DSC conforming + + my $inheader = 1; # Are we still in the header, before + # first "%%Page:" comment? + + my $optionset = 'header'; # Where do the option settings, which + # we have found, go? + + my $optionsalsointoheader = 0; # 1: We are in a "%%BeginSetup... + # %%EndSetup" section after the first + # "%%Page:..." line (OpenOffice.org + # does this and intends the options here + # apply to the whole document and not + # only to the current page). We have to + # add all lines also to the end of the + # @psheader now and we have to set + # non-PostScript options also in the + # "header" optionset. 0: otherwise. + + my $nestinglevel = 0; # Are we in the main document (0) or + # in an embedded document bracketed by + # "%%BeginDocument" and "%%EndDocument" + # (>0) We do not parse the PostScript + # in an embedded document. + + my $inpageheader = 0; # Are we in the header of a page, + # between "%%BeginPageSetup" and + # "%%EndPageSetup" (1) or not (0). + + my $lastpassthru = 0; # State of $passthru in previous line + # (to allow debug output when $passthru + # switches. + + my $ignorepageheader = 0; # Will be set to 1 as soon as active + # code (not between "%%BeginPageSetup" + # and "%%EndPageSetup") appears after a + # "%%Page:" comment. In this case + # "%%BeginPageSetup" and + # "%%EndPageSetup" is not allowed any + # more on this page and will be ignored. + # Will be set to 0 when a new "%%Page:" + # comment appears. + + my $printprevpage = 0; # We set this when encountering + # "%%Page:" and the previous page is not + # printed yet. Then it will be printed and + # the new page will be prepared in the + # next run of the loop (we don't read a + # new line and don't increase the + # $linect then). + + $fileconverterhandle = undef; # File handle to the fileconverter process + + $fileconverterpid = 0; # PID of the fileconverter process + + $rendererhandle = undef; # File handle to the renderer process + + $rendererpid = 0; # PID of the renderer process + + my $prologfound = 0; # Did we find the + # "%%BeginProlog...%%EndProlog" section? + + my $setupfound = 0; # Did we find the + # "%%BeginSetup...%%EndSetup" section? + + my $pagesetupfound = 0; # special page setup handling needed + + my $inprolog = 0; # We are between "%%BeginProlog" and + # "%%EndProlog". + + my $insetup = 0; # We are between "%%BeginSetup" and + # "%%EndSetup". + + my $infeature = 0; # We are between "%%BeginFeature" and + # "%%EndFeature". + + my $postscriptsection = 'jclsetup'; # In which section of the PostScript + # file are we currently? + + $nondsclines = 0; # Number of subsequent lines found which + # are at a non-DSC-conforming place, + # between the sections of the header. + + my $optionreplaced = 0; # Will be set to 1 when we are in an + # option ("%%BeginFeature... + # %%EndFeature") which we have replaced. + + $jobhasjcl = 0; # When the job does not start with + # PostScript directly, but is a + # PostScript job, we set this to 1 + # to avoid adding the JCL options + # for the second time. + + my $insertoptions = 1; # If we find out that a file with + # a DSC magic string + # ("%!PS-Adobe-") is not really + # DSC-conforming, we insert the + # options directly after the line + # with the magic string. We use + # this variable to store the + # number of the line with the + # magic string. + + my $currentpage = 0; # The page which we are currently + # printing. + + my $ooo110 = 0; # Flag to work around an application + # bug. + + if ($dontparse) { + # We do not parse the PostScript to find Foomatic options, we check + # only whether we have PostScript. + $maxlines = 1; + } + + print $logh "Reading PostScript input ...\n"; + + my $line; # Line to be read from stdin + do { + my $ignoreline = 0; # Comment line to be ignored when + # determining the last active line + # and the one before the last + + if (($printprevpage) || ($line=<STDIN>)) { + + if ($linect == $nonpslines) { + # In the beginning should be the postscript leader, + # sometimes after some JCL commands + if ($line !~ m/^.?%!/) { # There can be a Windows control + # character before "%!" + $nonpslines ++; + if ($maxlines == $nonpslines) { + $maxlines ++; + } + $jobhasjcl = 1; + if ($nonpslines > $maxlinestopsstart) { + # This is not a PostScript job, we must convert it + print $logh "${added_lf}Job does not start with \"%!\", " . + "is it PostScript?\n" . + "Starting file converter\n"; + # Reset all variables but conserve the data which + # we have already read. + $jobhasjcl = 0; + $linect = 0; + $nonpslines = 1; # Take into account that the line + # of this run of the loop will be + # put into @psheader, so the + # first line read by the file + # converter is already the second + # line. + $maxlines = 1001; + $onelinebefore = ""; + $twolinesbefore = ""; + my $alreadyread = join('', @psheader, @psfifo) . + $line; + $line = ""; + @psheader = (); + @psfifo = (); + # Start the file conversion filter + if (!$fileconverterpid) { + ($fileconverterhandle, $fileconverterpid) = + getfileconverterhandle + ($dat, $alreadyread); + if ($retval != $EXIT_PRINTED) { + rip_die ("Error opening file converter", + $retval); + } + } else { + rip_die("File conversion filter probably " . + "crashed", + $EXIT_JOBERR); + } + # Read the further data from the file converter and + # not from STDIN + if (!close STDIN && $! != $ESPIPE) { + rip_die ("Couldn't close STDIN", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + if (!open (STDIN, "<&$fileconverterhandle")) { + rip_die ("Couldn't dup \$fileconverterhandle", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + } + } else { + # Do we have a DSC-conforming document? + if (($line =~ m/^.?%!PS-Adobe-/) && + ($line !~ m/EPSF/)) { + # Do not stop parsing the document + if (!$dontparse) { + $maxlines = 0; + $isdscjob = 1; + $insertoptions = $linect + 1; + # We have written into @psfifo before, + # now we continue in @psheader and move + # over the data which is already in @psfifo + push (@psheader, @psfifo); + @psfifo = (); + } + print $logh + "--> This document is DSC-conforming!\n"; + } else { + # Job is not DSC-conforming, stick in all PostScript + # option settings in the beginning + $line .= makeprologsection($dat, $optionset, 1); + $line .= makesetupsection($dat, $optionset, 1); + $line .= makepagesetupsection($dat, $optionset, 1); + $prologfound = 1; + $setupfound = 1; + $pagesetupfound = 1; + } + } + } else { + if ($line =~ m/^\s*\%\%BeginDocument[: ]/) { + # Beginning of an embedded document + # Note that Adobe Acrobat has a bug and so uses + # "%%BeginDocument " instead of "%%BeginDocument:" + $nestinglevel ++; + print $logh "Embedded document, " . + "nesting level now: $nestinglevel\n"; + } elsif (($line =~ m/^\s*\%\%EndDocument/) && + ($nestinglevel > 0)) { + # End of an embedded document + $nestinglevel --; + print $logh "End of Embedded document, " . + "nesting level now: $nestinglevel\n"; + } elsif (($line =~ m/^\s*\%\%Creator[: ](.*)$/) && + ($nestinglevel == 0)) { + # Here we set flags to treat particular bugs of the + # PostScript produced by certain applications + my $creator = $1; + if ($creator =~ /^\s*OpenOffice.org\s+1.1.\d+\s*$/) { + # OpenOffice.org 1.1.x + # The option settings supposed to affect the + # whole document are put into the "%%PageSetup" + # section of the first page + print $logh "Document created with " . + "OpenOffice.org 1.1.x\n"; + $ooo110 = 1; + } + } elsif (($line =~ m/^\%\%BeginProlog/) && + ($nestinglevel == 0)) { + # Note: Below is another place where a "Prolog" + # section start will be considered. There we assume + # start of the "Prolog" if the job is DSC-Conformimg, + # but an arbitrary comment starting with "%%Begin", but + # not a comment explicitly treated here, is found. This + # is done because many "dvips" (TeX/LaTeX) files miss + # the "%%BeginProlog" comment. + # Beginning of Prolog + print $logh "${added_lf}-----------\nFound: \%\%BeginProlog\n"; + $inprolog = 1; + $postscriptsection = 'prolog' if $inheader; + $nondsclines = 0; + # Insert options for "Prolog" + if (!$prologfound) { + $line .= makeprologsection($dat, $optionset, 0); + } + $prologfound = 1; + } elsif (($line =~ m/^\%\%EndProlog/) && + ($nestinglevel == 0)) { + # End of Prolog + print $logh "Found: \%\%EndProlog\n"; + $inprolog = 0; + $insertoptions = $linect + 1; + } elsif (($line =~ m/^\%\%BeginSetup/) && + ($nestinglevel == 0)) { + # Beginning of Setup + print $logh "${added_lf}-----------\nFound: \%\%BeginSetup\n"; + $insetup = 1; + # We need to distinguish with the $inheader variable + # here whether we are in the header or on a page, as + # OpenOffice.org inserts a "%%BeginSetup...%%EndSetup" + # section after the first "%%Page:..." line and assumes + # this section to be valid for all pages. + $postscriptsection = 'setup' if $inheader; + $nondsclines = 0; + if ($inheader) { + # If there was no "Prolog" but there are + # options for the "Prolog", push a "Prolog" + # with these options onto the @psfifo here + if (!$prologfound) { + # "Prolog" missing, insert it here + $line = makeprologsection($dat, $optionset, 1) . + $line; + # Now we have a "Prolog" + $prologfound = 1; + } + # Insert options for "DocumentSetup" or "AnySetup" + if ($spooler ne 'cups') { + # For non-CUPS spoolers or no spooler at all, we leave + # everything as it is. + if (!$setupfound) { + $line .= makesetupsection($dat, $optionset, 0); + } + $setupfound = 1; + } + } else { + # Found option settings must be stuffed into both + # the header and the currrent page now. They will + # be written into both the "header" and the + # "currentpage" optionsets and the PostScript code + # lines of this section will not only go into the + # output stream, but also added to the end of the + # @psheader, so that they get repeated (to preserve + # the embedded PostScript option settings) on a + # restart of the renderer due to command line + # option changes + $optionsalsointoheader = 1; + print $logh "\"%%BeginSetup\" in page header\n"; + } + } elsif (($line =~ m/^\%\%EndSetup/) && + ($nestinglevel == 0)) { + # End of Setup + print $logh "Found: \%\%EndSetup\n"; + $insetup = 0; + if ($inheader) { + if ($spooler eq 'cups') { + # In case of CUPS, we must insert the + # accounting stuff just before the + # %%EndSetup comment in order to leave any + # EndPage procedures that have been + # defined by either the pstops filter or + # the PostScript job itself fully + # functional. + if (!$setupfound) { + $line = makesetupsection($dat, + $optionset, 0) . + $line; + } + $setupfound = 1; + } + $insertoptions = $linect + 1; + } else { + # The "%%BeginSetup...%%EndSetup" which + # OpenOffice.org has inserted after the first + # "%%Page:..." line ends here, so the following + # options go only onto the current page again + $optionsalsointoheader = 0; + } + } elsif (($line =~ m/^\%\%Page:(.*)$/) && + ($nestinglevel == 0)) { + if ((!$lastpassthru) && (!$inheader)) { + # In the last line we were not in passthru mode, + # so the last page is not printed. Prepare to do + # it now. + $printprevpage = 1; + # Print the previous page + $passthru = 1; + print $logh "New page found but previous not " . + "printed, print it now.\n"; + } else { + # The previous page is printed, so we can prepare + # the current one + $printprevpage = 0; + print $logh "${added_lf}-----------\nNew page: $1\n"; + # Count pages + $currentpage ++; + # We consider the beginning of the page already as + # page setup section, as some apps do not use + # "%%PageSetup" tags. + $postscriptsection = 'pagesetup'; + # Save PostScript state before beginning the page + #$line .= "/foomatic-saved-state save def\n"; + # Here begins a new page + if ($inheader) { + # Here we add some stuff which still belongs + # into the header + my $stillforheader; + # If there was no "Setup" but there are + # options for the "Setup", push a "Setup" + # with these options onto the @psfifo here + if (!$setupfound) { + # "Setup" missing, insert it here + $stillforheader = + makesetupsection($dat, $optionset, 1) . + $stillforheader; + # Now we have a "Setup" + $setupfound = 1; + } + # If there was no "Prolog" but there are + # options for the "Prolog", push a "Prolog" + # with these options onto the @psfifo here + if (!$prologfound) { + # "Prolog" missing, insert it here + $stillforheader = + makeprologsection($dat, $optionset, 1) . + $stillforheader; + # Now we have a "Prolog" + $prologfound = 1; + } + # Now we push this onto the header + push (@psheader, $stillforheader); + # The first page starts, so the header ends + $inheader = 0; + $nondsclines = 0; + # Option setting should go into the + # page-specific option set now + $optionset = 'currentpage'; + } else { + # Restore PostScript state after completing the + # previous page: + # + # foomatic-saved-state restore + # %%Page: ... + # /foomatic-saved-state save def + # + # Print this directly, so that if we need to + # restart the renderer for this page due to + # a command line change this is done under the + # old instance of the renderer + #print $rendererhandle + # "foomatic-saved-state restore\n"; + + # Save the option settings of the previous page + copyoptions($dat, 'currentpage', + 'previouspage'); + deleteoptions($dat, 'currentpage'); + } + # Initialize the option set + copyoptions($dat, 'header', 'currentpage'); + # Set command line options which apply only + # given pages + setoptionsforpage($dat, 'currentpage', $currentpage); + $pagesetupfound = 0; + if ($spooler eq 'cups') { + # Remove the "notfirst" flag from all options + # forseen for the "PageSetup" section, because + # when these are numerical options for CUPS. + # they have to be set to the correct value + # for every page + for my $arg (@{$dat->{'args'}}) { + if (($arg->{'section'} eq 'PageSetup') && + (defined($arg->{'notfirst'}))) { + delete($arg->{'notfirst'}); + } + } + } + # Insert PostScript option settings + # (options for section "PageSetup". + if ($isdscjob) { + $line .= + makepagesetupsection($dat, $optionset, + 0); + $pagesetupfound = 1; + } + # Now the page header comes, so buffer the data, + # because we must perhaps shut down and restart + # the renderer + $passthru = 0; + $ignorepageheader = 0; + $optionsalsointoheader = 0; + } + } elsif (($line =~ m/^\%\%BeginPageSetup/) && + ($nestinglevel == 0) && + (!$ignorepageheader)) { + # Start of the page header, up to %%EndPageSetup + # nothing of the page will be drawn, page-specific + # option settngs (as letter-head paper for page 1) + # go here + print $logh "${added_lf}Found: \%\%BeginPageSetup\n"; + $passthru = 0; + $inpageheader = 1; + $postscriptsection = 'pagesetup'; + if (($ooo110) && ($currentpage == 1)) { + $optionsalsointoheader = 1; + } else { + $optionsalsointoheader = 0; + } + } elsif (($line =~ m/^\%\%EndPageSetup/) && + ($nestinglevel == 0) && + (!$ignorepageheader)) { + # End of the page header, the page is ready to be + # printed + print $logh "Found: \%\%EndPageSetup\n"; + print $logh "End of page header\n"; + # We cannot for sure say that the page header ends here + # OpenOffice.org puts (due to a bug) a "%%BeginSetup... + # %%EndSetup" section after the first "%%Page:...". It + # is possible that CUPS inserts a "%%BeginPageSetup... + # %%EndPageSetup" before this section, which means that + # the options in the "%%BeginSetup...%%EndSetup" section + # are after the "%%EndPageSetup", so we continue for + # searching options up to the buffer size limit + # $maxlinesforpageoptions. + $passthru = 0; + $inpageheader = 0; + $optionsalsointoheader = 0; + } elsif ((($line =~ m/^\%\%(BeginFeature):\s*\*?([^\*\s=]+)\s+()(\S[^\r\n]*)\r?\n?$/) || + ($line =~ m/^\s*\%\%\s*(FoomaticRIPOptionSetting):\s*([^\*\s=]+)\s*=\s*(\@?)([^\@\s][^\r\n]*)\r?\n?$/)) && + ($nestinglevel == 0) && + (!$optionreplaced) && + ((!$passthru) || (!$isdscjob))) { + my ($linetype, $option, $fromcomposite, $value) = + ($1, $2, $3, $4); + + # Mark that we are in a "Feature" section + if ($linetype eq 'BeginFeature') { + $infeature = 1; + } + + # OK, we have an option. If it's not a + # *ostscript-style option (ie, it's command-line or + # JCL) then we should note that fact, since the + # attribute-to-filter option passing in CUPS is kind of + # funky, especially wrt boolean options. + + print $logh "Found: $line"; + if (my $arg=argbyname($option)) { + print $logh " Option: $option=" . + ($fromcomposite ? "From" : "") . $value; + if (($spooler eq 'cups') && + ($linetype eq 'BeginFeature') && + (!defined($arg->{'notfirst'})) && + ($arg->{$optionset} ne $value) && + (($inheader) || + ($arg->{section} eq 'PageSetup'))) { + # We have the first occurence of an + # option setting and the spooler is CUPS, + # so this setting is inserted by "pstops". + # The value from the command line was not + # inserted by "pstops" so it seems to be + # not under the choices in the PPD. + # Possible reasons: + # + # - "pstops" ignores settings of numerical + # or string options which are not one of + # the choices in the PPD file, and inserts + # the default value instead. + # + # - On the command line an option was applied + # only to selected pages: + # "-o <page ranges>:<option>=<values> + # This is not supported by CUPS, so not + # taken care of by "pstops". + # + # We must fix this here by replacing the setting + # inserted by "pstops" with the exact setting + # given on the command line. + + # $arg->{$optionset} is already + # range-checked, so do not check again here + # Insert DSC comment + my $dest = ((($inheader) && ($isdscjob)) ? + \@psheader : \@psfifo); + push(@{$dest}, + "%%BeginFeature: " . + "*$option $arg->{$optionset}\n"); + my $val; + if ($arg->{'style'} eq 'G') { + # PostScript option, insert the code + if ($arg->{'type'} eq 'bool') { + # Boolean option + if (defined($arg->{$optionset}) && + $arg->{$optionset} == 1) { + push(@{$dest}, $arg->{'proto'} . "\n"); + } elsif ($arg->{'protof'}) { + push(@{$dest}, $arg->{'protof'}. "\n"); + } + } elsif ((($arg->{'type'} eq 'enum') || + ($arg->{'type'} eq 'string') || + ($arg->{'type'} eq 'password')) && + (defined($val = + $arg->{'vals_byname'}{$arg->{$optionset}}))) { + # Enumerated choice of string or enum + # option + push(@{$dest}, $val->{'driverval'} . "\n"); + } elsif ((($arg->{'type'} eq 'string') || + ($arg->{'type'} eq 'password')) && + ($arg->{$optionset} eq 'None')) { + # 'None' is mapped to the empty string in + # string options + my $driverval = $arg->{'proto'}; + $driverval =~ s/\%s//g; + push(@{$dest}, $driverval . "\n"); + } else { + # Setting for numerical or string option + # which is not under the enumerated choices + my $sprintfproto = $arg->{'proto'}; + $sprintfproto =~ s/\%(?!s)/\%\%/g; + push(@{$dest}, + sprintf($sprintfproto, + $arg->{$optionset}) . + "\n"); + } + } else { + # Command line or JCL option + push(@{$dest}, + "%% FoomaticRIPOptionSetting: " . + "$option=$arg->{$optionset}\n"); + } + print $logh " --> Correcting numerical/string " . + "option to $option=$arg->{$optionset}" . + " (Command line argument)\n"; + # We have replaced this option on the + # FIFO + $optionreplaced = 1; + } + # Mark that we have already found this option + $arg->{'notfirst'} = 1; + if (!$optionreplaced) { + if ($arg->{'style'} ne 'G') { + # "Controlled by '<Composite>'" setting of + # a member option of a composite option + if ($fromcomposite) { + $value = "From$value"; + } + # Non-PostScript option + # Check whether it is valid + if (defined(my $newvalue = + checkoptionvalue($dat, $option, + $value, 0))) { + print $logh " --> Setting option\n"; + # Valid choice, set it. + $arg->{$optionset} = $newvalue; + if ($optionsalsointoheader) { + $arg->{'header'} = $newvalue; + } + if (($arg->{'type'} eq 'enum') && + (($option eq 'PageSize') || + ($option eq 'PageRegion')) && + ($newvalue =~ /^Custom/) && + ($linetype eq + 'FoomaticRIPOptionSetting')) { + # Custom page size + $twolinesbefore =~ + /^\s*([\d\.]+)\s+([\d\.]+)\s+([\d\.]+)\s+([\d\.]+)\s+([\d\.]+)\s*$/; + my ($w, $h) = ($1, $2); + if (($w) && ($h) && + ($w != 0) && ($h != 0)) { + $newvalue = "$newvalue.${w}x$h"; + $arg->{$optionset} = $newvalue; + if ($optionsalsointoheader) { + $arg->{'header'} = + $newvalue; + } + } + } + # For a composite option insert the + # code from the member options with + # current setting "From<composite>" + # The code from the member options + # is chosen according to the setting + # of the composite option. + if (($arg->{'style'} eq 'X') && + ($linetype eq + 'FoomaticRIPOptionSetting')) { + buildcommandline($dat, $optionset); + $line .= $arg->{$postscriptsection}; + } + # If this argument is PageSize or + # PageRegion, also set the other + syncpagesize($dat, $option, $newvalue, + $optionset); + if ($optionsalsointoheader) { + syncpagesize($dat, $option, + $newvalue, 'header'); + } + } else { + # Invalid option, log it. + print $logh " --> Invalid option " . + "setting found in job\n"; + } + } elsif ($fromcomposite) { + # PostScript option, but we have to look up + # the PostScript code to be inserted from + # the setting of a composite option, as this + # option is set to "Controlled by + # '<Composite>'". + # Set the option + if (defined(my $newvalue = + checkoptionvalue + ($dat, $option, + "From$value", 0))) { + print $logh " --> Looking up setting " . + "in composite option '$value'\n"; + # Valid choice, set it. + $arg->{$optionset} = $newvalue; + if ($optionsalsointoheader) { + $arg->{'header'} = $newvalue; + } + # Update composite options + buildcommandline($dat, $optionset); + # Substitute PostScript comment by + # the real code + $line = $arg->{'compositesubst'}; + } else { + # Invalid option, log it. + print $logh " --> Invalid option " . + "setting found in job\n"; + } + } else { + # it is a PostScript style option with + # the code readily inserted, no option + # for the renderer command line/JCL to set, + # no lookup of a composite option needed, + # so nothing to do here... + print $logh + " --> Option will be set by " . + "PostScript interpreter\n"; + } + } + } else { + # This option is unknown to us. WTF? + print $logh "Unknown option $option=$value found " . + "in the job\n"; + } + } elsif (($line =~ m/^\%\%EndFeature/) && + ($nestinglevel == 0)) { + # End of Feature + $infeature = 0; + # If the option setting was replaced, it ends here, too, + # end the next option is not necessarily also replaced. + $optionreplaced = 0; + } elsif (($line =~ m/^\%\%Begin/) && + ($isdscjob) && + (!$prologfound) && + ($nestinglevel == 0)) { + # In some PostScript files (especially when generated + # by "dvips" of TeX/LaTeX) the "%%BeginProlog" is + # missing, so assume that it was before the current + # line (the first line starting with "%%Begin". + print $logh "Job claims to be DSC-conforming, but " . + "\"%%BeginProlog\" was missing before first " . + "line with another \"%%Begin...\" comment " . + "(is this a TeX/LaTeX/dvips-generated PostScript " . + "file?). Assuming start of \"Prolog\" here.\n"; + # Beginning of Prolog + $inprolog = 1; + $nondsclines = 0; + # Insert options for "Prolog" before the current line + if (!$prologfound) { + $line = + "%%BeginProlog\n" . + makeprologsection($dat, $optionset, 0) . + $line; + } + $prologfound = 1; + } elsif (($line =~ m/^\s*\%/) || ($line =~ m/^\s*$/)) { + # This is an unknown PostScript comment or a blank line, + # no active code + $ignoreline = 1; + } else { + # This line is active PostScript code + if ($inheader) { + if ((!$inprolog) && (!$insetup)) { + # Outside the "Prolog" and "Setup" section + # a correct DSC-conforming document has no + # active PostScript code, so consider the + # file as non-DSC-conforming when there are + # too many of such lines. + $nondsclines ++; + if ($nondsclines > $maxnondsclinesinheader) { + # Consider document as not DSC-conforming + print $logh "This job seems not to be " . + "DSC-conforming, DSC-comment for " . + "next section not found, stopping " . + "to parse the rest, passing it " . + "directly to the renderer.\n"; + # Stop scanning for further option settings + $maxlines = 1; + $isdscjob = 0; + # Insert defaults and command line settings + # in the beginning of the job or after the + # last valid section + splice(@psheader, $insertoptions, 0, + ($prologfound ? () : + makeprologsection($dat, $optionset, + 1)), + ($setupfound ? () : + makesetupsection($dat, $optionset, + 1)), + ($pagesetupfound ? () : + makepagesetupsection($dat, + $optionset, + 1))); + $prologfound = 1; + $setupfound = 1; + $pagesetupfound = 1; + } + } + } else { + if (!$inpageheader) { + # PostScript code inside a page, but not between + # "%%BeginPageSetup" and "%%EndPageSetup", so + # we are perhaps already drawing onto a page now + if ($onelinebefore =~ m/^\%\%Page:/) { + print $logh "No page header or page " . + "header not DSC-conforming\n"; + } + # Stop buffering lines to search for options + # placed not DSC-conforming + if (scalar(@psfifo) >= + $maxlinesforpageoptions) { + print $logh "Stopping search for " . + "page header options\n"; + $passthru = 1; + # If there comes a page header now, ignore + # it + $ignorepageheader = 1; + $optionsalsointoheader = 0; + } + } + } + } + } + + # Debug info + if ($lastpassthru != $passthru) { + if ($passthru) { + print $logh "Found:\n $line" . + " --> Output goes directly to the renderer now.\n${added_lf}"; + } else { + print $logh "Found:\n $line" . + " --> Output goes to the FIFO buffer now.${added_lf}\n"; + } + } + + # We are in an option which was replaced, do not output + # the current line. + if ($optionreplaced) { + $line = ""; + } + + # If we are in a "%%BeginSetup...%%EndSetup" section after + # the first "%%Page:..." and the current line belongs to + # an option setting, we have to copy the line also to the + # @psheader. + if (($optionsalsointoheader) && + (($infeature) || ($line =~ m/^\%\%EndFeature/))) { + push (@psheader, $line); + } + + # Store or send the current line + if (($inheader) && ($isdscjob)) { + # We are still in the PostScript header, collect all lines + # in @psheader + push (@psheader, $line); + } else { + if (($passthru) && ($isdscjob)) { + if (!$lastpassthru) { + # We enter passthru mode with this line, so the + # command line can have changed, check it and + # close the renderer if needed + if (($rendererpid) && + (!optionsequal($dat, 'currentpage', + 'previouspage', 0))) { + print $logh "Command line/JCL options " . + "changed, restarting renderer\n"; + $retval = closerendererhandle + ($rendererhandle, $rendererpid); + if ($retval != $EXIT_PRINTED) { + rip_die ("Error closing renderer", + $retval); + } + $rendererpid = 0; + } + } + # Flush @psfifo and send line directly to the renderer + if (!$rendererpid) { + # No renderer running, start it + ($rendererhandle, $rendererpid) = + getrendererhandle + ($dat, join('', @psheader, @psfifo)); + if ($retval != $EXIT_PRINTED) { + rip_die ("Error opening renderer", + $retval); + } + # @psfifo is sent out, flush it. + @psfifo = (); + } + if ($#psfifo >= 0) { + # Send @psfifo to renderer + print $rendererhandle join('', @psfifo); + # flush @psfifo + @psfifo = (); + } + # Send line to renderer + if (!$printprevpage) { + print $rendererhandle $line; + } + } else { + # Push the line onto the stack for later spitting up... + push (@psfifo, $line); + } + } + + if (!$printprevpage) { + $linect++; + } + + } else { + # EOF! + $more_stuff = 0; + # No PostScript header in the whole file? Then it's not + # PostScript, convert it. + # We open the file converter here when the file has less + # lines than the amount which we search for the PostScript + # header ($maxlinestopsstart). + if ($linect <= $nonpslines) { + # This is not a PostScript job, we must convert it + print $logh "${added_lf}Job does not start with \"%!\", " . + "is it PostScript?\n" . + "Starting file converter\n"; + # Reset all variables but conserve the data which + # we have already read. + $jobhasjcl = 0; + $linect = 0; + $nonpslines = 0; + $maxlines = 1000; + $onelinebefore = ""; + $twolinesbefore = ""; + my $alreadyread = join('', @psheader, @psfifo); + @psheader = (); + @psfifo = (); + $line = ""; + # Start the file conversion filter + if (!$fileconverterpid) { + ($fileconverterhandle, $fileconverterpid) = + getfileconverterhandle($dat, $alreadyread); + if ( defined($retval) and $retval != $EXIT_PRINTED) { + rip_die ("Error opening file converter", + $retval); + } + } else { + rip_die("File conversion filter probably " . + "crashed", + $EXIT_JOBERR); + } + # Read the further data from the file converter and + # not from STDIN + if (!close STDIN && $! != $ESPIPE) { + rip_die ("Couldn't close STDIN", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + if (!open (STDIN, "<&$fileconverterhandle")) { + rip_die ("Couldn't dup \$fileconverterhandle", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + # Now we have new (converted) stuff in STDIN, so + # continue in the loop + $more_stuff = 1; + } + } + + $lastpassthru = $passthru; + + if ((!$ignoreline) && (!$printprevpage)) { + $twolinesbefore = $onelinebefore; + $onelinebefore = $line; + } + + } while ((($maxlines == 0) or ($linect < $maxlines)) and + ($more_stuff != 0)); + + # Some buffer still containing data? Send it out to the renderer. + if (($more_stuff != 0) || ($inheader) || ($#psfifo >= 0)) { + # Flush @psfifo and send the remaining data to the renderer, this + # only happens with non-DSC-conforming jobs or non-Foomatic PPDs + if ($more_stuff) { + print $logh "Stopped parsing the PostScript data, ". + "sending rest directly to renderer.\n"; + } else { + print $logh "Flushing FIFO.\n"; + } + if ($inheader) { + # No page initialized yet? Copy the "header" option set into the + # "currentpage" option set, so that the renderer will find the + # options settings. + copyoptions($dat, 'header', 'currentpage'); + $optionset = 'currentpage'; + # If not done yet, insert defaults and command line settings + # in the beginning of the job or after the last valid section + splice(@psheader, $insertoptions, 0, + ($prologfound ? () : + makeprologsection($dat, $optionset, 1)), + ($setupfound ? () : + makesetupsection($dat, $optionset, 1)), + ($pagesetupfound ? () : + makepagesetupsection($dat, $optionset, 1))); + $prologfound = 1; + $setupfound = 1; + $pagesetupfound = 1; + } + if (($rendererpid) && + (!optionsequal($dat, 'currentpage', + 'previouspage', 0))) { + print $logh "Command line/JCL options " . + "changed, restarting renderer\n"; + $retval = closerendererhandle + ($rendererhandle, $rendererpid); + if ($retval != $EXIT_PRINTED) { + rip_die ("Error closing renderer", + $retval); + } + $rendererpid = 0; + } + if (!$rendererpid) { + ($rendererhandle, $rendererpid) = + getrendererhandle($dat, join('', @psheader, @psfifo)); + if ($retval != $EXIT_PRINTED) { + rip_die ("Error opening renderer", + $retval); + } + # We have sent @psfifo now + @psfifo = (); + } + if ($#psfifo >= 0) { + # Send @psfifo to renderer + print $rendererhandle join('', @psfifo); + # flush @psfifo + @psfifo = (); + } + # Print the rest of the input data + if ($more_stuff) { + while (<STDIN>) { + print $rendererhandle $_; + } + } + } + + # At every "%%Page:..." comment we have saved the PostScript state + # and we have increased the page number. So if the page number is + # non-zero we had at least one "%%Page:..." comment and so we have + # to give a restore the PostScript state. + #if ($currentpage > 0) { + # print $rendererhandle "foomatic-saved-state restore\n"; + #} + + # Close the renderer + if ($rendererpid) { + $retval = closerendererhandle ($rendererhandle, $rendererpid); + if ($retval != $EXIT_PRINTED) { + rip_die ("Error closing renderer", + $retval); + } + $rendererpid = 0; + } + + # Close the file converter (if it was used) + if ($fileconverterpid) { + $retval = closefileconverterhandle + ($fileconverterhandle, $fileconverterpid); + if ($retval != $EXIT_PRINTED) { + rip_die ("Error closing file converter", + $retval); + } + $fileconverterpid = 0; + } +} + + +## Close the documentation page generator +if ($docgeneratorpid) { + $retval = closedocgeneratorhandle + ($docgeneratorhandle, $docgeneratorpid); + if ($retval != $EXIT_PRINTED) { + rip_die ("Error closing documentation page generator", + $retval); + } + $docgeneratorpid = 0; +} + + + +## Close last input file +close STDIN; + + + +## Only for debugging +if ($debug && 1) { + use Data::Dumper; + local $Data::Dumper::Purity=1; + local $Data::Dumper::Indent=1; + print $logh Dumper($dat); +} + + + +## The End +print $logh "${added_lf}Closing foomatic-rip.\n"; +close $logh; + +exit $retval; + + + +## Functions to let foomatic-rip fork to do several tasks in parallel. + +# To do the filtering without loading the whole file into memory we work +# on a data stream, we read the data line by line analyse it to decide what +# filters to use and start the filters if we have found out which we need. +# We buffer the data only as long as we didn't determing which filters to +# use for this piece of data and with which options. There are no temporary +# files used. + +# foomatic-rip splits into up to 6 parallel processes to do the whole +# filtering (listed in the order of the data flow): + +# KID0: Generate documentation pages (only jobs with "docs" option) +# KID2: Put together already read data and current input stream for +# feeding into the file conversion filter (only non-PostScript +# and "docs" jobs) +# KID1: Run the file conversion filter to convert non-PostScript +# input into PostScript (only non-PostScript and "docs" jobs) +# MAIN: Prepare the job auto-detecting the spooler, reading the PPD, +# extracting the options from the command line, and parsing +# the job data itself. It analyses the job data to check +# whether it is PostScript and starts KID1/KID2 if not, it +# also stuffs PostScript code from option settings into the +# PostScript data stream. It starts the renderer (KID3/KID4) +# as soon as it knows its command line and restarts it when +# page-specific option settings need another command line +# or different JCL commands. +# KID3: The rendering process. In most cases GhostScript, "cat" +# for native PostScript printers with their manufacturer's +# PPD files. +# KID4: Put together the JCL commands and the renderer's output +# and send all that either to STDOUT or pipe it into the +# command line defined with $postpipe. + +## This function runs the renderer command line (and if defined also +## the postpipe) and returns a file handle for stuffing in the +## PostScript data. +sub getrendererhandle { + + my ($dat, $prepend) = @_; + + print $logh "${added_lf}Starting renderer\n"; + + # Catch signals + $retval = $EXIT_PRINTED; + use sigtrap qw(handler set_exit_prnerr USR1 + handler set_exit_prnerr_noretry USR2 + handler set_exit_engaged TTIN); + + # Variables for the kid processes reporting their state + + # Set up a pipe for the kids to pass their exit stat to the main process + pipe KID_MESSAGE, KID_MESSAGE_IN; + + # When one kid fails put the exit stat here + $kidfailed = 0; + + # When a kid exits successfully, mark it here + $kid3finished = 0; + $kid4finished = 0; + + # Build the command line and get the JCL commands + buildcommandline($dat, 'currentpage'); + my $commandline = $dat->{'currentcmd'}; + my @jclprepend = @{$dat->{'jclprepend'}} if defined $dat->{'jclprepend'}; + my @jclappend = @{$dat->{'jclappend'}} if defined $dat->{'jclappend'}; + + use IO::Handle; + pipe KID3_IN, KID3; + KID3->autoflush(1); + $kid3 = fork(); + if (!defined($kid3)) { + close KID3; + close KID3_IN; + print $logh "$0: cannot fork for kid3!\n"; + rip_die ("can't fork for kid3", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + if ($kid3) { + + # we are the parent; return a glob to the filehandle + close KID3_IN; + + # Feed in the PostScript header and the FIFO contents + print KID3 $prepend; + + KID3->flush(); + return ( *KID3, $kid3 ); + + } else { + close KID3; + + pipe KID4_IN, KID4; + KID4->autoflush(1); + $kid4 = fork(); + if (!defined($kid4)) { + close KID4; + close KID4_IN; + print $logh "$0: cannot fork for kid4!\n"; + close KID_MESSAGE; + print KID_MESSAGE_IN "3 $EXIT_PRNERR_NORETRY_BAD_SETTINGS\n"; + close KID_MESSAGE_IN; + rip_die ("can't fork for kid4", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + + if ($kid4) { + # parent, child of primary task; we are |commandline| + close KID4_IN; + + print $logh "renderer PID kid4=$kid4\n"; + print $logh "renderer command: $commandline\n"; + + if (!close STDIN && $! != $ESPIPE) { + close KID3_IN; + close KID4; + close KID_MESSAGE; + print KID_MESSAGE_IN + "3 $EXIT_PRNERR_NORETRY_BAD_SETTINGS\n"; + close KID_MESSAGE_IN; + rip_die ("Couldn't close STDIN in $kid4", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + if (!open (STDIN, "<&KID3_IN")) { + close KID3_IN; + close KID4; + close KID_MESSAGE; + print KID_MESSAGE_IN + "3 $EXIT_PRNERR_NORETRY_BAD_SETTINGS\n"; + close KID_MESSAGE_IN; + rip_die ("Couldn't dup KID3_IN", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + if (!close STDOUT) { + close KID3_IN; + close KID4; + close KID_MESSAGE; + print KID_MESSAGE_IN + "3 $EXIT_PRNERR_NORETRY_BAD_SETTINGS\n"; + close KID_MESSAGE_IN; + rip_die ("Couldn't close STDOUT in $kid4", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + if (!open (STDOUT, ">&KID4")) { + close KID3_IN; + close KID4; + close KID_MESSAGE; + print KID_MESSAGE_IN + "3 $EXIT_PRNERR_NORETRY_BAD_SETTINGS\n"; + close KID_MESSAGE_IN; + rip_die ("Couldn't dup KID4", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + if ($debug) { + if (!open (STDERR, ">&$logh")) { + close KID3_IN; + close KID4; + close KID_MESSAGE; + print KID_MESSAGE_IN + "3 $EXIT_PRNERR_NORETRY_BAD_SETTINGS\n"; + close KID_MESSAGE_IN; + rip_die ("Couldn't dup logh to stderr", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + } + + # Massage commandline to execute foomatic-gswrapper + my $havewrapper = 0; + for (split(':', $ENV{'PATH'})) { + if (-x "$_/foomatic-gswrapper") { + $havewrapper=1; + last; + } + } + if ($havewrapper) { + $commandline =~ s!^\s*gs\s!foomatic-gswrapper !g; + $commandline =~ s!(\|\s*)gs\s!\|foomatic-gswrapper !g; + $commandline =~ s!(;\s*)gs\s!; foomatic-gswrapper !g; + } + + # If the renderer command line contains the "echo" + # command, replace the "echo" by the user-chosen $myecho + # (important for non-GNU systems where GNU echo is in a + # special path + $commandline =~ s!^\s*echo\s!$myecho !g; + $commandline =~ s!(\|\s*)echo\s!\|$myecho !g; + $commandline =~ s!(;\s*)echo\s!; $myecho !g; + + # In debug mode save the data supposed to be fed into the + # renderer also into a file + if ($debug) { + $commandline = "tee -a ${logfile}.ps | ( $commandline )"; + } + + # Actually run the thing... + system("$commandline"); + if ($? != 0) { + my $rendererretval = $? >> 8; + print $logh "renderer return value: $rendererretval\n"; + my $renderersignal = $? & 127; + print $logh "renderer received signal: $rendererretval\n"; + close STDOUT; + close KID4; + close STDIN; + close KID3_IN; + # Handle signals + if ($renderersignal == SIGUSR1) { + $retval = $EXIT_PRNERR; + } elsif ($renderersignal == SIGUSR2) { + $retval = $EXIT_PRNERR_NORETRY; + } elsif ($renderersignal == SIGTTIN) { + $retval = $EXIT_ENGAGED; + } + if ($retval != $EXIT_PRINTED) { + close KID_MESSAGE; + print KID_MESSAGE_IN "3 $retval\n"; + close KID_MESSAGE_IN; + exit $retval; + } + # Evaluate renderer result + if ($rendererretval == 0) { + # Success, exit with 0 and inform main process + close KID_MESSAGE; + print KID_MESSAGE_IN "3 $EXIT_PRINTED\n"; + close KID_MESSAGE_IN; + exit $EXIT_PRINTED; + } elsif ($rendererretval == 1) { + # Syntax error? PostScript error? + close KID_MESSAGE; + print KID_MESSAGE_IN "3 $EXIT_JOBERR\n"; + close KID_MESSAGE_IN; + rip_die ("Possible error on renderer command line or PostScript error. Check options.", + $EXIT_JOBERR); + } elsif ($rendererretval == 139) { + # Seems to indicate a core dump + close KID_MESSAGE; + print KID_MESSAGE_IN "3 $EXIT_JOBERR\n"; + close KID_MESSAGE_IN; + rip_die ("The renderer may have dumped core.", + $EXIT_JOBERR); + } elsif ($rendererretval == 141) { + # Broken pipe, presumably additional filter interface + # exited. + close KID_MESSAGE; + print KID_MESSAGE_IN "3 $EXIT_PRNERR\n"; + close KID_MESSAGE_IN; + rip_die ("A filter used in addition to the renderer" . + " itself may have failed.", + $EXIT_PRNERR); + } elsif (($rendererretval == 243) || ($retval == 255)) { + # PostScript error? + close KID_MESSAGE; + print KID_MESSAGE_IN "3 $EXIT_JOBERR\n"; + close KID_MESSAGE_IN; + exit $EXIT_JOBERR; + } else { + # Unknown error + close KID_MESSAGE; + print KID_MESSAGE_IN "3 $EXIT_PRNERR\n"; + close KID_MESSAGE_IN; + rip_die ("The renderer command line returned an" . + " unrecognized error code $rendererretval.", + $EXIT_PRNERR); + } + } + close STDOUT; + close KID4; + close STDIN; + close KID3_IN; + # When arrived here the renderer command line was successful + # So exit with zero exit value here and inform the main process + close KID_MESSAGE; + print KID_MESSAGE_IN "3 $EXIT_PRINTED\n"; + close KID_MESSAGE_IN; + # Wait for postpipe/output child + waitpid($kid4, 0); + print $logh "KID3 finished\n"; + exit $EXIT_PRINTED; + } else { + # child, trailing task on the pipe; we write jcl stuff + close KID4; + close KID3_IN; + + my $fileh = *STDOUT; + + # Do we have a $postpipe, if yes, launch the command(s) and + # point our output into it/them + if ($postpipe) { + if (!open PIPE,$postpipe) { + close KID4_IN; + close KID_MESSAGE; + print KID_MESSAGE_IN + "4 $EXIT_PRNERR_NORETRY_BAD_SETTINGS\n"; + close KID_MESSAGE_IN; + rip_die ("cannot execute postpipe $postpipe", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + $fileh = *PIPE; + } + + # Debug output + print $logh "JCL: " . join("", @jclprepend) . "<job data> ${added_lf}" . + join("", @jclappend) . "\n"; + + # wrap the JCL around the job data, if there are any + # options specified... + # Should the driver already have inserted JCL commands we merge + # our JCL header with the one from the driver + my $driverjcl = 0; + if ( @jclprepend > 1 ) { + # JCL header read from renderer output + my @jclheader = (); + # Determine magic string of JCL in use (usually "@PJL") + # For that we take the first part of the second JCL line up + # to the first space + if ($jclprepend[1] =~ /^(\S+)/) { + my $jclstr = $1; + # Read from the renderer output until the first non-JCL + # line appears + while (my $line = <KID4_IN>) { + push(@jclheader, $line); + last if ($line !~ /$jclstr/); + } + # If we had read at least two lines, at least one is + # a JCL header, so do the merging + if (@jclheader > 1) { + $driverjcl = 1; + # Discard the first and the last entry of the + # @jclprepend array, we only need the option settings + # to merge them in + pop(@jclprepend); + shift(@jclprepend); + # Line after which we insert new JCL commands in the + # JCL header of the job + my $insert = 1; + # Go through every JCL command in @jclprepend + for my $line (@jclprepend) { + # Search the command in the JCL header from the + # driver. As search term use only the string from + # the beginning of the line to the "=", so the + # command will also be found when it has another + # value + $line =~ /^([^=]+)/; + my $cmd = $1; + my $cmdfound = 0; + for (@jclheader) { + # If the command is there, replace it + $_ =~ s/$cmd\b.*(\r\n|\n|\r)/$line/ and + $cmdfound = 1; + } + if (!$cmdfound) { + # If the command is not found, insert it + if (@jclheader > 2) { + # @jclheader has more than one line, + # insert the new command beginning + # right after the first line and continuing + # after the previous inserted command + splice(@jclheader, $insert, 0, $line); + $insert ++; + } else { + # If we have only one line of JCL it + # is probably something like the + # "@PJL ENTER LANGUAGE=..." line + # which has to be in the end, but + # it also contains the + # "<esc>%-12345X" which has to be in the + # beginning of the job. So we split the + # line right before the $jclstr and + # append our command to the end of the + # first part and let the second part + # be a second JCL line. + $jclheader[0] =~ + /^(.*?)($jclstr.*(\r\n|\n|\r))/; + my $first = "$1$line"; + my $second = "$2"; + my $third = $jclheader[1]; + @jclheader = ($first, $second, $third); + } + } + } + # Now pass on the merged JCL header + print $fileh @jclheader; + } else { + # The driver didn't create a JCL header, simply + # prepend ours and then pass on the line which we + # already have read + print $fileh @jclprepend, @jclheader; + } + } else { + # No merging of JCL header possible, simply prepend it + print $fileh @jclprepend; + } + } + + # The rest of the job data + while (<KID4_IN>) { + print $fileh $_; + } + + # A JCL trailer + if (( @jclprepend > 1 ) && (!$driverjcl)) { + print $fileh @jclappend; + } + + if (!close $fileh) { + close KID4_IN; + close KID_MESSAGE; + print KID_MESSAGE_IN + "4 $EXIT_PRNERR_NORETRY_BAD_SETTINGS\n"; + close KID_MESSAGE_IN; + rip_die ("error closing $fileh", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + close KID4_IN; + + print $logh "tail process done writing data to STDOUT\n"; + + # Handle signals of the backend interface + if ($retval != $EXIT_PRINTED) { + close KID_MESSAGE; + print KID_MESSAGE_IN "4 $retval\n"; + close KID_MESSAGE_IN; + exit $retval; + } + + # Successful exit, inform main process + close KID_MESSAGE; + print KID_MESSAGE_IN "4 $EXIT_PRINTED\n"; + close KID_MESSAGE_IN; + + print $logh "KID4 finished\n"; + exit($EXIT_PRINTED); + } + } +} + + + +## Close the renderer process and wait until all kid processes finish. + +sub closerendererhandle { + + my ($rendererhandle, $rendererpid) = @_; + + print $logh "${added_lf}Closing renderer\n"; + + # Do it! + close $rendererhandle; + + # Wait for all kid processes to finish or one kid process to fail + close KID_MESSAGE_IN; + while ((!$kidfailed) && + !(($kid3finished) && + ($kid4finished))) { + my $message = <KID_MESSAGE>; + chomp $message; + if ($message =~ /(\d+)\s+(\d+)/) { + my $kid_id = $1; + my $exitstat = $2; + print $logh "KID$kid_id exited with status $exitstat\n"; + if ($exitstat > 0) { + $kidfailed = $exitstat; + } elsif ($kid_id == 3) { + $kid3finished = 1; + } elsif ($kid_id == 4) { + $kid4finished = 1; + } + } + } + + close KID_MESSAGE; + + # If a kid failed, return the exit stat of this kid + if ($kidfailed != 0) { + $retval = $kidfailed; + } + + print $logh "Renderer exit stat: $retval\n"; + # Wait for renderer child + waitpid($rendererpid, 0); + print $logh "Renderer process finished\n"; + return ($retval); +} + + + +## This function is only used when the input data is not +## PostScript. Then it runs a filter which converts non-PostScript +## files into PostScript. The user can choose which filter he wants +## to use. The filter command line is provided by $fileconverter. + +sub getfileconverterhandle { + + # Already read data must be converted, too + my ($dat, $alreadyread) = @_; + + print $logh "${added_lf}Starting converter for non-PostScript files\n"; + + # Determine with which command non-PostScript files are converted + # to PostScript + if ($fileconverter eq "") { + if ($spoolerfileconverters->{$spooler}) { + $fileconverter = $spoolerfileconverters->{$spooler}; + } else { + for my $c (@fileconverters) { + ($c =~ m/^\s*(\S+)\s+/) || ($c = m/^\s*(\S+)$/); + my $command = $1; + if( -x $command ){ + $fileconverter = $command; + } else { + for (split(':', $ENV{'PATH'})) { + if (-x "$_/$command") { + $fileconverter = $c; + last; + } + } + } + if ($fileconverter ne "") { + last; + } + } + } + if ($fileconverter eq "") { + $fileconverter = "echo \"Cannot convert file to " . + "PostScript!\" 1>&2"; + } + } + + # Insert the page size into the $fileconverter + if ($fileconverter =~ /\@\@([^@]+)\@\@PAGESIZE\@\@/) { + # We always use the "header" option swt here, with a + # non-PostScript file we have no "currentpage" + my $optstr = $1; + my $arg; + my $sizestr = (($arg = $dat->{'args_byname'}{'PageSize'}) + ? $arg->{'header'} + : ""); + if ($sizestr) { + # Use wider margins so that the pages come out completely on + # every printer model (especially HP inkjets) + if ($fileconverter =~ /^\s*(a2ps)\s+/) { + if (lc($sizestr) eq "letter") { + $sizestr = "Letterdj"; + } elsif (lc($sizestr) eq "a4") { + $sizestr = "A4dj"; + } + } + $optstr .= $sizestr; + } else { + $optstr = ""; + } + $fileconverter =~ s/\@\@([^@]+)\@\@PAGESIZE\@\@/$optstr/; + } + + # Insert the job title into the $fileconverter + if ($fileconverter =~ /\@\@([^@]+)\@\@JOBTITLE\@\@/) { + if ($do_docs) { + $jobtitle = + "Documentation for the $model"; + } + my $titlearg = $1; + my ($arg, $optstr); + ($arg = $jobtitle) =~ s/\"/\\\"/g; + if (($titlearg =~ /\"/) || $arg) { + $optstr = $titlearg . ($titlearg =~ /\"/ ? '' : '"') . + ($arg ? "$arg\"" : '"'); + } else { + $optstr = ""; + } + $fileconverter =~ s/\@\@([^@]+)\@\@JOBTITLE\@\@/$optstr/; + } + + # Apply "pstops" when having used a file converter under CUPS, so + # CUPS can stuff the default settings into the PostScript output + # of the file converter (so all CUPS settings get also applied when + # one prints the documentation pages (all other files we get + # already converted to PostScript by CUPS. + if ($spooler eq 'cups') { + $fileconverter .= + " | ${programdir}pstops '$rargs[0]' '$rargs[1]' '$rargs[2]' " . + "'$rargs[3]' '$rargs[4]'"; + } + + # Variables for the kid processes reporting their state + + # Set up a pipe for the kids to pass their exit stat to the main process + pipe KID_MESSAGE_CONV, KID_MESSAGE_CONV_IN; + + # When one kid fails put the exit stat here + $convkidfailed = 0; + + # When a kid exits successfully, mark it here + $kid1finished = 0; + $kid2finished = 0; + + use IO::Handle; + pipe KID1_IN, KID1; + KID1->autoflush(1); + my $kid1 = fork(); + if (!defined($kid1)) { + close KID1; + close KID1_IN; + print $logh "$0: cannot fork for kid1!\n"; + rip_die ("can't fork for kid1", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + + if ($kid1) { + + # we are the parent; return a glob to the filehandle + close KID1; + + return ( *KID1_IN, $kid1 ); + + } else { + # We go on reading the job data and stuff it into the file + # converter + close KID1_IN; + + pipe KID2_IN, KID2; + KID2->autoflush(1); + $kid2 = fork(); + if (!defined($kid2)) { + print $logh "$0: cannot fork for kid2!\n"; + close KID1; + close KID2; + close KID2_IN; + close KID_MESSAGE_CONV; + print KID_MESSAGE_CONV_IN + "1 $EXIT_PRNERR_NORETRY_BAD_SETTINGS\n"; + rip_die ("can't fork for kid2", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + + if ($kid2) { + # parent, child of primary task; we are |$fileconverter| + close KID2; + + print $logh "file converter PID kid2=$kid2\n"; + if (($debug) || ($spooler ne 'cups')) { + print $logh "file converter command: $fileconverter\n"; + } + + if (!close STDIN && $! != $ESPIPE) { + close KID1; + close KID2_IN; + close KID_MESSAGE_CONV; + print KID_MESSAGE_CONV_IN + "1 $EXIT_PRNERR_NORETRY_BAD_SETTINGS\n"; + close KID_MESSAGE_CONV_IN; + rip_die ("Couldn't close STDIN in $kid2", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + if (!open (STDIN, "<&KID2_IN")) { + close KID1; + close KID2_IN; + close KID_MESSAGE_CONV; + print KID_MESSAGE_CONV_IN + "1 $EXIT_PRNERR_NORETRY_BAD_SETTINGS\n"; + close KID_MESSAGE_CONV_IN; + rip_die ("Couldn't dup KID2_IN", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + if (!close STDOUT) { + close KID1; + close KID2_IN; + close KID_MESSAGE_CONV; + print KID_MESSAGE_CONV_IN + "1 $EXIT_PRNERR_NORETRY_BAD_SETTINGS\n"; + close KID_MESSAGE_CONV_IN; + rip_die ("Couldn't close STDOUT in $kid2", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + if (!open (STDOUT, ">&KID1")) { + close KID1; + close KID2_IN; + close KID_MESSAGE_CONV; + print KID_MESSAGE_CONV_IN + "1 $EXIT_PRNERR_NORETRY_BAD_SETTINGS\n"; + close KID_MESSAGE_CONV_IN; + rip_die ("Couldn't dup KID1", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + if ($debug) { + if (!open (STDERR, ">&$logh")) { + close KID1; + close KID2_IN; + close KID_MESSAGE_CONV; + print KID_MESSAGE_CONV_IN + "1 $EXIT_PRNERR_NORETRY_BAD_SETTINGS\n"; + close KID_MESSAGE_CONV_IN; + rip_die ("Couldn't dup logh to stderr", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + } + + # Actually run the thing... + system("$fileconverter"); + if ($? != 0) { + my $fileconverterretval = $? >> 8; + print $logh "file converter return value: " . + "$fileconverterretval\n"; + my $fileconvertersignal = $? & 127; + print $logh "file converter received signal: ". + "$fileconverterretval\n"; + close STDOUT; + close KID1; + close STDIN; + close KID2_IN; + # Handle signals + if ($fileconvertersignal == SIGUSR1) { + $retval = $EXIT_PRNERR; + } elsif ($fileconvertersignal == SIGUSR2) { + $retval = $EXIT_PRNERR_NORETRY; + } elsif ($fileconvertersignal == SIGTTIN) { + $retval = $EXIT_ENGAGED; + } + if ($retval != $EXIT_PRINTED) { + close KID_MESSAGE_CONV; + print KID_MESSAGE_CONV_IN "1 $retval\n"; + close KID_MESSAGE_CONV_IN; + exit $retval; + } + # Evaluate fileconverter result + if ($fileconverterretval == 0) { + # Success, exit with 0 and inform main process + close KID_MESSAGE_CONV; + print KID_MESSAGE_CONV_IN "1 $EXIT_PRINTED\n"; + close KID_MESSAGE_CONV_IN; + exit $EXIT_PRINTED; + } else { + # Unknown error + close KID_MESSAGE_CONV; + print KID_MESSAGE_CONV_IN "1 $EXIT_PRNERR\n"; + close KID_MESSAGE_CONV_IN; + rip_die ("The file converter command line returned " . + "an unrecognized error code " . + "$fileconverterretval.", + $EXIT_PRNERR); + } + } + close STDOUT; + close KID1; + close STDIN; + close KID2_IN; + # When arrived here the fileconverter command line was + # successful. + # So exit with zero exit value here and inform the main process + close KID_MESSAGE_CONV; + print KID_MESSAGE_CONV_IN "1 $EXIT_PRINTED\n"; + close KID_MESSAGE_CONV_IN; + # Wait for input child + waitpid($kid1, 0); + print $logh "KID1 finished\n"; + exit $EXIT_PRINTED; + } else { + # child, first part of the pipe, reading in the data from + # standard input and stuffing it into the file converter + # after putting in the already read data (in $alreadyread) + close KID1; + close KID2_IN; + + # At first pass the data which we have already read to the + # filter + print KID2 $alreadyread; + # Then read the rest from standard input + while (<STDIN>) { + print KID2 $_; + } + + if (!close STDIN && $! != $ESPIPE) { + close KID2; + close KID_MESSAGE_CONV; + print KID_MESSAGE_CONV_IN + "2 $EXIT_PRNERR_NORETRY_BAD_SETTINGS\n"; + close KID_MESSAGE_CONV_IN; + rip_die ("error closing STDIN", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + close KID2; + + print $logh "tail process done reading data from STDIN\n"; + + # Successful exit, inform main process + close KID_MESSAGE_CONV; + print KID_MESSAGE_CONV_IN "2 $EXIT_PRINTED\n"; + close KID_MESSAGE_CONV_IN; + + print $logh "KID2 finished\n"; + exit($EXIT_PRINTED); + } + } +} + + + +## Close the file conversion process and wait until all kid processes +## finish. + +sub closefileconverterhandle { + + my ($fileconverterhandle, $fileconverterpid) = @_; + + print $logh "${added_lf}Closing file converter\n"; + + # Do it! + close $fileconverterhandle; + + # Wait for all kid processes to finish or one kid process to fail + close KID_MESSAGE_CONV_IN; + while ((!$convkidfailed) && + !(($kid1finished) && + ($kid2finished))) { + my $message = <KID_MESSAGE_CONV>; + chomp $message; + if ($message =~ /(\d+)\s+(\d+)/) { + my $kid_id = $1; + my $exitstat = $2; + print $logh "KID$kid_id exited with status $exitstat\n"; + if ($exitstat > 0) { + $convkidfailed = $exitstat; + } elsif ($kid_id == 1) { + $kid1finished = 1; + } elsif ($kid_id == 2) { + $kid2finished = 1; + } + } + } + + close KID_MESSAGE_CONV; + + # If a kid failed, return the exit stat of this kid + if ($convkidfailed != 0) { + $retval = $convkidfailed; + } + + print $logh "File converter exit stat: $retval\n"; + # Wait for fileconverter child + waitpid($fileconverterpid, 0); + print $logh "File converter process finished\n"; + return ($retval); +} + + + +## Generate the documentation page and return a filehandle to get it + +sub getdocgeneratorhandle { + + # The data structure with the options + my ($dat) = @_; + + print $logh "${added_lf}Generating documentation page for the $model\n"; + + # Printer queue name + my $printerstr; + if ($printer) { + $printerstr = $printer; + } else { + $printerstr = "<printer>"; + } + + # Spooler-specific differences + my ($command, + $enumopt, $enumoptleft, $enumoptequal, $enumoptright, + $boolopt, $booloptfalseprefix, $booloptleft, $booloptequal, + $booloptright, + $numopt, $numoptleft, $numoptequal, $numoptright, + $stropt, $stroptleft, $stroptequal, $stroptright, + $optsep, $trailer, $custompagesize); + if ($spooler eq 'cups') { + ($command, + $enumopt, $enumoptleft, $enumoptequal, $enumoptright, + $boolopt, $booloptfalseprefix, $booloptleft, $booloptequal, + $booloptright, + $numopt, $numoptleft, $numoptequal, $numoptright, + $stropt, $stroptleft, $stroptequal, $stroptright, + $optsep, $trailer, $custompagesize) = + ("lpr -P $printerstr ", + "-o ", "", "=", "", + "-o ", "no", "", "=", "", + "-o ", "", "=", "", + "-o ", "", "=", "", + " "," <file>", + "\n Custom size: -o PageSize=Custom." . + "<width>x<height>[<unit>]\n" . + " Units: pt (default), in, cm, mm\n" . + " Example: -o PageSize=Custom.4.0x6.0in\n"); + } elsif ($spooler eq 'lpd') { + ($command, + $enumopt, $enumoptleft, $enumoptequal, $enumoptright, + $boolopt, $booloptfalseprefix, $booloptleft, $booloptequal, + $booloptright, + $numopt, $numoptleft, $numoptequal, $numoptright, + $stropt, $stroptleft, $stroptequal, $stroptright, + $optsep, $trailer, $custompagesize) = + ("lpr -P $printerstr -J \"", + "", "", "=", "", + "", "", "", "=", "", + "", "", "=", "", + "", "", "=", "", + " ", "\" <file>", + "\n Custom size: PageSize=Custom." . + "<width>x<height>[<unit>]\n" . + " Units: pt (default), in, cm, mm\n" . + " Example: PageSize=Custom.4.0x6.0in\n"); + } elsif ($spooler eq 'gnulpr') { + ($command, + $enumopt, $enumoptleft, $enumoptequal, $enumoptright, + $boolopt, $booloptfalseprefix, $booloptleft, $booloptequal, + $booloptright, + $numopt, $numoptleft, $numoptequal, $numoptright, + $stropt, $stroptleft, $stroptequal, $stroptright, + $optsep, $trailer, $custompagesize) = + ("lpr -P $printerstr ", + "-o ", "", "=", "", + "-o ", "", "", "=", "", + "-o ", "", "=", "", + "-o ", "", "=", "", + " "," <file>", + "\n Custom size: -o PageSize=Custom." . + "<width>x<height>[<unit>]\n" . + " Units: pt (default), in, cm, mm\n" . + " Example: -o PageSize=Custom.4.0x6.0in\n"); + } elsif ($spooler eq 'lprng') { + ($command, + $enumopt, $enumoptleft, $enumoptequal, $enumoptright, + $boolopt, $booloptfalseprefix, $booloptleft, $booloptequal, + $booloptright, + $numopt, $numoptleft, $numoptequal, $numoptright, + $stropt, $stroptleft, $stroptequal, $stroptright, + $optsep, $trailer, $custompagesize) = + ("lpr -P $printerstr ", + "-Z ", "", "=", "", + "-Z ", "", "", "=", "", + "-Z ", "", "=", "", + "-Z ", "", "=", "", + " "," <file>", + "\n Custom size: -Z PageSize=Custom." . + "<width>x<height>[<unit>]\n" . + " Units: pt (default), in, cm, mm\n" . + " Example: -Z PageSize=Custom.4.0x6.0in\n"); + } elsif ($spooler eq 'ppr') { + ($command, + $enumopt, $enumoptleft, $enumoptequal, $enumoptright, + $boolopt, $booloptfalseprefix, $booloptleft, $booloptequal, + $booloptright, + $numopt, $numoptleft, $numoptequal, $numoptright, + $stropt, $stroptleft, $stroptequal, $stroptright, + $optsep, $trailer, $custompagesize) = + ("ppr -d $printerstr --ripopts \"", + "", "", "=", "", + "", "", "", "=", "", + "", "", "=", "", + "", "", "=", "", + " ","\" <file>", + "\n Custom size: PageSize=Custom." . + "<width>x<height>[<unit>]\n" . + " Units: pt (default), in, cm, mm\n" . + " Example: PageSize=Custom.4.0x6.0in\n"); + } elsif ($spooler eq 'ppr-int') { + ($command, + $enumopt, $enumoptleft, $enumoptequal, $enumoptright, + $boolopt, $booloptfalseprefix, $booloptleft, $booloptequal, + $booloptright, + $numopt, $numoptleft, $numoptequal, $numoptright, + $stropt, $stroptleft, $stroptequal, $stroptright, + $optsep, $trailer, $custompagesize) = + ("ppr -d $printerstr -i \"", + "", "", "=", "", + "", "", "", "=", "", + "", "", "=", "", + "", "", "=", "", + " ","\" <file>", + "\n Custom size: PageSize=Custom." . + "<width>x<height>[<unit>]\n" . + " Units: pt (default), in, cm, mm\n" . + " Example: PageSize=Custom.4.0x6.0in\n"); + } elsif ($spooler eq 'cps') { + ($command, + $enumopt, $enumoptleft, $enumoptequal, $enumoptright, + $boolopt, $booloptfalseprefix, $booloptleft, $booloptequal, + $booloptright, + $numopt, $numoptleft, $numoptequal, $numoptright, + $stropt, $stroptleft, $stroptequal, $stroptright, + $optsep, $trailer, $custompagesize) = + ("lpr -P $printerstr ", + "-o ", "", "=", "", + "-o ", "", "", "=", "", + "-o ", "", "=", "", + "-o ", "", "=", "", + " "," <file>", + "\n Custom size: -o PageSize=Custom." . + "<width>x<height>[<unit>]\n" . + " Units: pt (default), in, cm, mm\n" . + " Example: -o PageSize=Custom.4.0x6.0in\n"); + } elsif ($spooler eq 'direct') { + ($command, + $enumopt, $enumoptleft, $enumoptequal, $enumoptright, + $boolopt, $booloptfalseprefix, $booloptleft, $booloptequal, + $booloptright, + $numopt, $numoptleft, $numoptequal, $numoptright, + $stropt, $stroptleft, $stroptequal, $stroptright, + $optsep, $trailer, $custompagesize) = + ("$programname -P $printerstr ", + "-o ", "", "=", "", + "-o ", "", "", "=", "", + "-o ", "", "=", "", + "-o ", "", "=", "", + " "," <file>", + "\n Custom size: -o PageSize=Custom." . + "<width>x<height>[<unit>]\n" . + " Units: pt (default), in, cm, mm\n" . + " Example: -o PageSize=Custom.4.0x6.0in\n"); + } elsif ($spooler eq 'pdq') { + ($command, + $enumopt, $enumoptleft, $enumoptequal, $enumoptright, + $boolopt, $booloptfalseprefix, $booloptleft, $booloptequal, + $booloptright, + $numopt, $numoptleft, $numoptequal, $numoptright, + $stropt, $stroptleft, $stroptequal, $stroptright, + $optsep, $trailer, $custompagesize) = + ("pdq -P $printerstr ", + "-o", "", "_", "", + "-o", "no", "", "_", "", + "-a", "", "=", "", + "-a", "", "=", "", + " "," <file>", + "\n" . + "Option 'PageWidth':\n". + " Page Width (for \"Custom\" page size)\n" . + " A floating point number argument\n" . + " Range: 0 <= x <= 100000\n" . + " Example: -aPageWidth=123.4\n" . + "\n" . + "Option 'PageHeight':\n" . + " Page Height (for \"Custom\" page size)\n" . + " A floating point number argument\n" . + " Range: 0 <= x <= 100000\n" . + " Example: -aPageHeight=234.5\n" . + "\n" . + "Option 'PageSizeUnit':\n" . + " Unit (for \"Custom\" page size)\n" . + " An enumerated choice argument\n" . + " Possible choices:\n" . + " o -oPageSizeUnit_pt: Points (1/72 inch)\n" . + " o -oPageSizeUnit_in: Inches\n" . + " o -oPageSizeUnit_cm: cm\n" . + " o -oPageSizeUnit_mm: mm\n" . + " Example: -oPageSizeUnit_mm\n"); + } + + # Variables for the kid processes reporting their state + + # Set up a pipe for the kids to pass their exit stat to the main process + pipe KID_MESSAGE_DOC, KID_MESSAGE_DOC_IN; + + # When the kid fails put the exit stat here + $dockidfailed = 0; + + # When the kid exits successfully, mark it here + $kid0finished = 0; + + use IO::Handle; + pipe KID0_IN, KID0; + KID0->autoflush(1); + my $kid0 = fork(); + if (!defined($kid0)) { + close KID0; + close KID0_IN; + print $logh "$0: cannot fork for kid0!\n"; + rip_die ("can't fork for kid0", + $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + + if ($kid0) { + # we are the parent; return a glob to the filehandle + close KID0; + print $logh "Documentation page generator PID kid0=$kid0\n"; + return ( *KID0_IN, $kid0 ); + } + + # we are the kid; we generate the documentation page + + close KID0_IN; + + # Kill data on STDIN to satisfy PPR + if (($spooler eq 'ppr_int') || ($spooler eq 'ppr')) { + while (my $dummy = <STDIN>) {}; + } + close STDIN + or print $logh "Error closing STDIN for docs print\n"; + + # write the job into KID0 + select KID0; + + print "\nInvokation summary for the $model\n\n"; + print "Use the following command line:\n\n"; + if ($booloptfalseprefix) { + # I think that what you want to indicate is that the prefix for a false + # boolean has this form: xxx [no]<switch> or something similar + print " ${command}${enumopt}${enumoptleft}<option>" . + "${enumoptequal}<choice>${enumoptright}${optsep}" . + "${boolopt}${booloptleft}\[${booloptfalseprefix}\]<switch>" . + "${booloptright}${optsep}" . + "${numopt}${numoptleft}<num. option>${numoptequal}" . + "<value>${numoptright}${optsep}" . + "${stropt}${stroptleft}<string option>${stroptequal}" . + "<string>${stroptright}" . + "${trailer}\n\n"; + } else { + print " ${command}${enumopt}${enumoptleft}<option>" . + "${enumoptequal}<choice>${enumoptright}${optsep}" . + "${boolopt}${booloptleft}<switch>${booloptequal}" . + "<True/False>${booloptright}${optsep}" . + "${numopt}${numoptleft}<num. option>${numoptequal}" . + "<value>${numoptright}${optsep}" . + "${stropt}${stroptleft}<string option>${stroptequal}" . + "<string>${stroptright}" . + "${trailer}\n\n"; + } + + print "The following options are available for this printer:\n\n"; + + for my $arg (@{$dat->{'args'}}) { + my ($name, + $type, + $comment, + $spot, + $default) = ($arg->{'name'}, + $arg->{'type'}, + $arg->{'comment'}, + $arg->{'spot'}, + $arg->{'default'}); + + # Is this really an option? Otherwise skip it. + next if (!$type); + + # We don't need "PageRegion", we have "PageSize" + next if ($name eq "PageRegion"); + + # Skip enumerated choice options with only one choice + next if (($type eq 'enum') && ($#{$arg->{'vals'}} < 1)); + + my $commentstr = ""; + if ($comment) { + $commentstr = " $comment\n"; + } + + my $typestr; + if ($type eq "enum") { + $typestr = "An enumerated choice"; + } elsif ($type eq "bool") { + $typestr = "A boolean"; + } elsif ($type eq "int") { + $typestr = "An integer number"; + } elsif ($type eq "float") { + $typestr = "A floating point number"; + } elsif (($type eq "string") || ($type eq "password")) { + $typestr = "A string"; + } + + print "Option '$name':\n$commentstr $typestr argument\n"; + print " This options corresponds to a PJL command\n" if ($arg->{'style'} eq 'J'); + + if ($type eq 'bool') { + print " Possible choices:\n"; + if ($booloptfalseprefix) { + print " o $name: $arg->{'comment_true'}\n"; + print " o $booloptfalseprefix$name: " . + "$arg->{'comment_false'}\n"; + if (defined($default)) { + my $defstr = ($default ? "" : "$booloptfalseprefix"); + print " Default: $defstr$name\n"; + } + print " Example: ${boolopt}${booloptleft}${name}" . + "${booloptright}\n"; + } else { + print " o True: $arg->{'comment_true'}\n"; + print " o False: $arg->{'comment_false'}\n"; + if (defined($default)) { + my $defstr = ($default ? "True" : "False"); + print " Default: $defstr\n"; + } + print " Example: ${boolopt}${booloptleft}${name}" . + "${booloptequal}True${booloptright}\n"; + } + } elsif ($type eq 'enum') { + print " Possible choices:\n"; + my $exarg; + my $havecustomsize = 0; + for (@{$arg->{'vals'}}) { + my ($choice, $comment) = ($_->{'value'}, $_->{'comment'}); + print " o $choice: $comment\n"; + if (($name eq "PageSize") && ($choice eq "Custom")) { + $havecustomsize = 1; + } + $exarg=$choice; + } + if (defined($default)) { + print " Default: $default\n"; + } + print " Example: ${enumopt}${enumoptleft}${name}" . + "${enumoptequal}${exarg}${enumoptright}\n"; + if ($havecustomsize) { + print $custompagesize; + } + } elsif ($type eq 'int' or $type eq 'float') { + my ($max, $min) = ($arg->{'max'}, $arg->{'min'}); + my $exarg; + if (defined($max)) { + print " Range: $min <= x <= $max\n"; + $exarg=$max; + } + if (defined($default)) { + print " Default: $default\n"; + $exarg=$default; + } + if (!$exarg) { $exarg=0; } + print " Example: ${numopt}${numoptleft}${name}" . + "${numoptequal}${exarg}${numoptright}\n"; + } elsif ($type eq 'string' or $type eq 'password') { + my $maxlength = $arg->{'maxlength'}; + if (defined($maxlength)) { + print " Maximum length: $maxlength characters\n"; + } + if (defined($default)) { + print " Default: $default\n"; + } + print " Examples/special settings:\n"; + for (@{$arg->{'vals'}}) { + my ($value, $comment, $driverval, $proto) = + ($_->{'value'}, $_->{'comment'}, $_->{'driverval'}, + $arg->{'proto'}); + # Retrieve the original string from the prototype + # and the driverval + my $string; + if ($proto) { + my $s = index($proto, '%s'); + my $l = length($driverval) - length($proto) + 2; + if (($s < 0) || ($l < 0)) { + $string = $driverval; + } else { + $string = substr($driverval, $s, $l); + } + } else { + $string = $driverval; + } + print " o ${stropt}${stroptleft}${name}" . + "${stroptequal}${value}${stroptright}"; + if (($value ne $string) || ($comment ne $value)) { + print " ("; + } + if ($value ne $string) { + if ($string eq '') { + print "blank string"; + } else { + print "\"$string\""; + } + } + if (($value ne $string) && ($comment ne $value)) { + print ", "; + } + if ($value ne $comment) { + print "$comment"; + } + if (($value ne $string) || ($comment ne $value)) { + print ")"; + } + print "\n"; + } + } + + print "\n"; + } + + select STDOUT; + close KID0 + or print $logh "Error closing KID0 for docs print\n"; + close STDOUT + or print $logh "Error closing STDOUT for docs print\n"; + + # Finished successfully, inform main process + close KID_MESSAGE_DOC; + print KID_MESSAGE_DOC_IN "0 $EXIT_PRINTED\n"; + close KID_MESSAGE_DOC_IN; + + print $logh "KID0 finished\n"; + exit($EXIT_PRINTED); + +} + + + +## Close the documentation page generation process and wait until the +## kid process finishes. + +sub closedocgeneratorhandle { + + my ($handle, $pid) = @_; + + print $logh "${added_lf}Closing documentation page generator\n"; + + # Do it! + close $handle; + + # Wait for the kid process to finish or the kid process to fail + close KID_MESSAGE_DOC_IN; + while ((!$dockidfailed) && + (!$kid0finished)) { + my $message = <KID_MESSAGE_DOC>; + chomp $message; + if ($message =~ /(\d+)\s+(\d+)/) { + my $kid_id = $1; + my $exitstat = $2; + print $logh "KID$kid_id exited with status $exitstat\n"; + if ($exitstat > 0) { + $dockidfailed = $exitstat; + } elsif ($kid_id eq "0") { + $kid0finished = 1; + } + } + } + + close KID_MESSAGE_DOC; + + # If the kid failed, return the exit stat of the kid + if ($dockidfailed != 0) { + $retval = $dockidfailed; + } + + print $logh "Documentation page generator exit stat: $retval\n"; + # Wait for fileconverter child + waitpid($pid, 0); + print $logh "Documentation page generator process finished\n"; + return ($retval); +} + + + +# Find an argument by name in a case-insensitive way +sub argbyname { + my $name = $_[0]; + + for my $arg (@{$dat->{'args'}}) { + return $arg if (lc($name) eq lc($arg->{'name'})); + } + + return undef; +} + +sub valbyname { + my ($arg,$name) = @_; + + for my $val (@{$arg->{'vals'}}) { + return $val if (lc($name) eq lc($val->{'value'})); + } + + return undef; +} + +# Write a Good-Bye letter and clean up before committing suicide (send +# error message to caller) + +sub rip_die { + my ($message, $exitstat) = @_; + my $errmsg = "$!"; + my $errcod = $! + 0; + + # Close the documentation page generator (if it was used) + if ($docgeneratorpid) { + if ($kid0) { + print $logh "Killing process $kid0 (KID0)\n"; + kill(9, $kid0); + } + $docgeneratorpid = 0; + } + + # Close the file converter (if it was used) + if ($fileconverterpid) { + if ($kid2) { + print $logh "Killing process $kid2 (KID2)\n"; + kill(9, $kid2); + } + if ($kid1) { + print $logh "Killing process $kid1 (KID1)\n"; + kill(9, $kid1); + } + $fileconverterpid = 0; + } + + # Close the renderer + if ($rendererpid) { + if ($kid4) { + print $logh "Killing process $kid4 (KID4)\n"; + kill(9, $kid4); + } + if ($kid3) { + print $logh "Killing process $kid3 (KID3)\n"; + kill(9, $kid3); + } + $rendererpid = 0; + } + + print $logh "Process dying with \"$message\", exit stat: $exitstat\n\terror: $errmsg ($errcod)\n"; + if ($spooler eq 'ppr_int') { + # Special error handling for PPR intefaces + $message =~ s/\\/\\\\/; + $message =~ s/\"/\\\"/; + my @messagelines = split("\n", $message); + my $firstline = "TRUE"; + for my $line (@messagelines) { + system("lib/alert $printer $firstline \"$line\""); + $firstline = "FALSE"; + } + } else { + print STDERR $message . "\n"; + } + exit $exitstat; +} + +# Signal handling routines + +sub set_exit_prnerr { + $retval = $EXIT_PRNERR; +} + +sub set_exit_prnerr_noretry { + $retval = $EXIT_PRNERR_NORETRY; +} + +sub set_exit_engaged { + $retval = $EXIT_ENGAGED; +} + +# Read the config file + +sub readConfFile { + my ($file) = @_; + + my %conf; + # Read config file if present + if (open CONF, "< $file") { + while (<CONF>) + { + $conf{$1}="$2" if (m/^\s*([^\#\s]\S*)\s*:\s*(.*)\s*$/); + } + close CONF; + } + + return %conf; +} + +sub removeunprintables { + # Remove unprintable characters + my $str = $_[0]; + $str =~ s/[\x00-\x1f]//g; + return $str; +} + +sub removeshellescapes { + # Remove shell escape characters + my $str = $_[0]; + $str =~ s/[\|<>&!\$\'\"\#\*\?\(\)\[\]\{\}]//g; + return $str; +} + +sub removespecialchars { + # Remove unprintable and shell escape characters + return removeshellescapes(removeunprintables($_[0])); +} + +sub unhtmlify { + # Replace HTML/XML entities by the original characters + my $str = $_[0]; + $str =~ s/\'/\'/g; + $str =~ s/\"/\"/g; + $str =~ s/\>/\>/g; + $str =~ s/\</\</g; + $str =~ s/\&/\&/g; + return $str; +} + +sub unhexify { + # Replace hex notation for unprintable characters in PPD files + # by the actual characters ex: "<0A>" --> chr(hex("0A")) + my ($input) = @_; + my $output = ""; + my $hexmode = 0; + my $firstdigit = ""; + for (my $i = 0; $i < length($input); $i ++) { + my $c = substr($input, $i, 1); + if ($hexmode) { + if ($c eq ">") { + # End of hex string + $hexmode = 0; + } elsif ($c =~ /^[0-9a-fA-F]$/) { + # Hexadecimal digit, two of them give a character + if ($firstdigit ne "") { + $output .= chr(hex("$firstdigit$c")); + $firstdigit = ""; + } else { + $firstdigit = $c; + } + } + } else { + if ($c eq "<") { + # Beginning of hex string + $hexmode = 1; + } else { + # Normal character + $output .= $c; + } + } + } + return $output; +} + +sub undossify( $ ) { + # Remove "dossy" line ends ("\r\n") from a string + my $str = $_[0]; + $str =~ s/\r\n/\n/gs; + $str =~ s/\r$//s; + return( $str ); +} + +sub checkarg { + # Check if there is already an argument record $argname in $dat, if not, + # create one + my ($dat, $argname) = @_; + return if defined($dat->{'args_byname'}{$argname}); + # argument record + my $rec; + $rec->{'name'} = $argname; + # Insert record in 'args' array for browsing all arguments + push(@{$dat->{'args'}}, $rec); + # 'args_byname' hash for looking up arguments by name + $dat->{'args_byname'}{$argname} = $dat->{'args'}[$#{$dat->{'args'}}]; + # Default execution style is 'G' (PostScript) since all arguments for + # which we don't find "*Foomatic..." keywords are usual PostScript + # options + $dat->{'args_byname'}{$argname}{'style'} = 'G'; + # Default prototype for code to insert, used by enum options + $dat->{'args_byname'}{$argname}{'proto'} = '%s'; + # stop Perl nattering about undefined to string comparisons + $dat->{'args_byname'}{$argname}{'type'} = ''; + print $logh "Added option $argname\n"; +} + +sub checksetting { + # Check if there is already an choice record $setting in the $argname + # argument in $dat, if not, create one + my ($dat, $argname, $setting) = @_; + return if + defined($dat->{'args_byname'}{$argname}{'vals_byname'}{$setting}); + # setting record + my $rec; + $rec->{'value'} = $setting; + # Insert record in 'vals' array for browsing all settings + push(@{$dat->{'args_byname'}{$argname}{'vals'}}, $rec); + # 'vals_byname' hash for looking up settings by name + $dat->{'args_byname'}{$argname}{'vals_byname'}{$setting} = + $dat->{'args_byname'}{$argname}{'vals'}[$#{$dat->{'args_byname'}{$argname}{'vals'}}]; +} + +sub removearg { + # remove the argument record $argname from $dat + my ($dat, $argname) = @_; + return if !defined($dat->{'args_byname'}{$argname}); + # Remove 'args_byname' hash for looking up arguments by name + delete $dat->{'args_byname'}{$argname}; + # Remove argument itself + for (my $i = 0; $i <= $#{$dat->{'args'}}; $i ++) { + if ($dat->{'args'}[$i]{'name'} eq $argname) { + print $logh "Removing option " . + $argname . "\n"; + splice(@{$dat->{'args'}}, $i, 1); + last; + } + } +} + +sub removepsargs { + # remove all records of PostScript arguments from $dat + my ($dat) = @_; + return if !defined($dat); + for (my $i = 0; $i <= $#{$dat->{'args'}}; $i ++) { + if ($dat->{'args'}[$i]{'style'} eq 'G') { + print $logh "Removing PostScript option " . + $dat->{'args'}[$i]{'name'} . "\n"; + # Remove 'args_byname' hash for looking up arguments by name + delete $dat->{'args_byname'}{$dat->{'args'}[$i]{'name'}}; + # Remove argument itself + splice(@{$dat->{'args'}}, $i, 1); + $i --; + } + } +} + +sub checkoptionvalue { + + ## This function checks whether a given value is valid for a given + ## option. If yes, it returns a cleaned value (e. g. always 0 or 1 + ## for boolean options), otherwise "undef". If $forcevalue is set, + ## we always determine a corrected value to insert (we never return + ## "undef"). + + # Is $value valid for the option named $argname? + my ($dat, $argname, $value, $forcevalue) = @_; + + # Record for option $argname + my $arg = $dat->{'args_byname'}{$argname}; + $arg->{'type'} = '' if not defined $arg->{'type'}; + + if ($arg->{'type'} eq 'bool') { + my $lcvalue = lc($value); + if ((($lcvalue) eq 'true') || + (($lcvalue) eq 'on') || + (($lcvalue) eq 'yes') || + (($lcvalue) eq '1')) { + return 1; + } elsif ((($lcvalue) eq 'false') || + (($lcvalue) eq 'off') || + (($lcvalue) eq 'no') || + (($lcvalue) eq '0')) { + return 0; + } elsif ($forcevalue) { + # This maps Unknown to mean False. Good? Bad? + # It was done so in Foomatic 2.0.x, too. + my $name = $arg->{'name'}; + print $logh + "The value $value for $name is not a " . + "choice!\n" . + " --> Using False instead!\n"; + return 0; + } + } elsif ($arg->{'type'} eq 'enum') { + if ($value =~ /^None$/i) { + return 'None'; + } elsif (defined($arg->{'vals_byname'}{$value})) { + return $value; + } elsif ((($arg->{'name'} eq "PageSize") || + ($arg->{'name'} eq "PageRegion")) && + (defined($arg->{'vals_byname'}{'Custom'})) && + ($value =~ m!^Custom\.([\d\.]+)x([\d\.]+)([A-Za-z]*)$!)) { + # Custom paper size + return $value; + } elsif ($forcevalue) { + # wtf!? that's not a choice! + my $name = $arg->{'name'}; + # Return the first entry of the list + my $firstentry = $arg->{'vals'}[0]{'value'}; + print $logh + "The value $value for $name is not a " . + "choice!\n" . + " --> Using $firstentry instead!\n"; + return $firstentry; + } + } elsif (($arg->{'type'} eq 'int') || + ($arg->{'type'} eq 'float')) { + if (($value <= $arg->{'max'}) && + ($value >= $arg->{'min'})) { + return $value; + } elsif ($forcevalue) { + my $name = $arg->{'name'}; + my $newvalue; + if ($value > $arg->{'max'}) { + $newvalue = $arg->{'max'} + } elsif ($value < $arg->{'min'}) { + $newvalue = $arg->{'min'} + } + print $logh + "The value $value for $name is out of " . + "range!\n" . + " --> Using $newvalue instead!\n"; + return $newvalue; + } + } elsif (($arg->{'type'} eq 'string') || + ($arg->{'type'} eq 'password')) { + if (defined($arg->{'vals_byname'}{$value})) { + my $name = $arg->{'name'}; + print $logh + "The value $value for $name is a predefined choice\n"; + return $value; + } elsif (stringvalid($dat, $argname, $value)) { + # Check whether the string is one of the enumerated choices + my $sprintfproto = $arg->{'proto'}; + $sprintfproto =~ s/\%(?!s)/\%\%/g; + my $driverval = sprintf($sprintfproto, $value); + for my $val (@{$arg->{'vals'}}) { + if (($val->{'driverval'} eq $driverval) || + ($val->{'driverval'} eq $value)) { + my $name = $arg->{'name'}; + print $logh + "The string $value for $name is the predefined " . + "choice $val->{value}\n"; + return $val->{value}; + } + } + # "None" is mapped to the empty string + if ($value eq 'None') { + my $name = $arg->{'name'}; + print $logh + "Option $name: 'None' is the mapped to the " . + "empty string\n"; + return ''; + } + # No matching choice? Return the original string + return $value; + } elsif ($forcevalue) { + my $name = $arg->{'name'}; + my $str = substr($value, 0, $arg->{'maxlength'}); + if (stringvalid($dat, $argname, $str)) { + print $logh + "The string $value for $name is longer than " . + "$arg->{'maxlength'}, string shortened to $str\n"; + return $str; + } elsif ($#{$arg->{'vals'}} >= 0) { + # First list item + my $firstentry = $arg->{'vals'}[0]{'value'}; + print $logh + "The string $value for $name contains forbidden " . + "characters or does not match the regular expression " . + "defined for this option, using predefined choice " . + "$firstentry instead\n"; + return $firstentry; + } else { + # We should not get here + rip_die("Option $name incorrectly defined in the " . + "PPD file!\n", $EXIT_PRNERR_NORETRY_BAD_SETTINGS); + } + } + } + return undef; +} + +sub stringvalid { + + ## Checks whether a user-supplied value for a string option is valid + ## It must be within the length limit, should only contain allowed + ## characters and match the given regexp + + # Option and string + my ($dat, $argname, $value) = @_; + + my $arg = $dat->{'args_byname'}{$argname}; + + # Maximum length + return 0 if (defined($arg->{'maxlength'}) && + (length($value) > $arg->{'maxlength'})); + + # Allowed characters + if ($arg->{'allowedchars'}) { + my $chars = $arg->{'allowedchars'}; + $chars =~ s/(?<!\\)((\\\\)*)\//$2\\\//g; + return 0 if $value !~ /^[$chars]*$/; + } + + # Regular expression + if ($arg->{'allowedregexp'}) { + my $regexp = $arg->{'allowedregexp'}; + $regexp =~ s/(?<!\\)((\\\\)*)\//$2\\\//g; + return 0 if $value !~ /$regexp/; + } + + # All checks passed + return 1; +} + +sub checkoptions { + + ## Let the values of a boolean option being 0 or 1 instead of + ## "True" or "False", range-check the defaults of all options and + ## issue warnings if the values are not valid + + # Option set to be examined + my ($dat, $optionset) = @_; + + for my $arg (@{$dat->{'args'}}) { + if (defined($arg->{$optionset})) { + $arg->{$optionset} = + checkoptionvalue + ($dat, $arg->{'name'}, $arg->{$optionset}, 1); + } + } + + # If the settings for "PageSize" and "PageRegion" are different, + # set the one for "PageRegion" to the one for "PageSize" and issue + # a warning. + if ($dat->{'args_byname'}{'PageSize'}{$optionset} ne + $dat->{'args_byname'}{'PageRegion'}{$optionset}) { + print $logh "Settings for \"PageSize\" and \"PageRegion\" are " . + "different:\n" . + " PageSize: $dat->{'args_byname'}{'PageSize'}{$optionset}\n" . + " PageRegion: ". + "$dat->{'args_byname'}{'PageRegion'}{$optionset}\n" . + "Using the \"PageSize\" value " . + "\"$dat->{'args_byname'}{'PageSize'}{$optionset}\"," . + " for both.\n"; + $dat->{'args_byname'}{'PageRegion'}{$optionset} = + $dat->{'args_byname'}{'PageSize'}{$optionset}; + } +} + +# If the PageSize or PageRegion was changed, also change the other + +sub syncpagesize { + + # Name and value of the option we set, and the option set where we + # did the change + my ($dat, $name, $value, $optionset) = @_; + + # Don't do anything if we were called with an option other than + # "PageSize" or "PageRegion" + return if (($name ne "PageSize") && ($name ne "PageRegion")); + + # Don't do anything if not both "PageSize" and "PageRegion" exist + return if ((!defined($dat->{'args_byname'}{'PageSize'})) || + (!defined($dat->{'args_byname'}{'PageRegion'}))); + + my $dest; + + # "PageSize" --> "PageRegion" + if ($name eq "PageSize") { + $dest = "PageRegion"; + } + + # "PageRegion" --> "PageSize" + if ($name eq "PageRegion") { + $dest = "PageSize"; + } + + # Do it! + my $val; + if ($val=valbyname($dat->{'args_byname'}{$dest}, $value)) { + # Standard paper size + $dat->{'args_byname'}{$dest}{$optionset} = $val->{'value'}; + } elsif ($val=valbyname($dat->{'args_byname'}{$dest}, "Custom")) { + # Custom paper size + $dat->{'args_byname'}{$dest}{$optionset} = $value; + } +} + +sub copyoptions { + + ## Copy one option set into another one + + # Source and destination option sets + my ($dat, $srcoptionset, $destoptionset) = @_; + + for my $arg (@{$dat->{'args'}}) { + if (defined($arg->{$srcoptionset})) { + $arg->{$destoptionset} = $arg->{$srcoptionset}; + } + } +} + +sub deleteoptions { + + ## Delete an option set + + # option set to be removed + my ($dat, $optionset) = @_; + + for my $arg (@{$dat->{'args'}}) { + if (defined($arg->{$optionset})) { + delete($arg->{$optionset}); + } + } +} + +sub optionsequal { + + ## Compare two option sets, if they are equal, return 1, otherwise 0 + + # Option sets to be compared, flag to compare only command line and JCL + # options + my ($dat, $firstoptionset, $secondoptionset, $exceptPS) = @_; + + for my $arg (@{$dat->{'args'}}) { + next if ($exceptPS && ($arg->{'style'} eq 'G')); + if ((defined($arg->{$firstoptionset})) && + (defined($arg->{$secondoptionset}))) { + # Both entries exist + return 0 if $arg->{$firstoptionset} ne $arg->{$secondoptionset}; + } elsif ((defined($arg->{$firstoptionset})) || + (defined($arg->{$secondoptionset}))) { + # One entry exists + return 0; + } + # If no entry exists, the non-existing entries are considered as + # equal + } + return 1; +} + +sub makeprologsection { + + # option set to be used, + # $comments = 1: Add "%%BeginProlog...%%EndProlog" + my ($dat, $optionset, $comments) = @_; + + # Collect data to be inserted here + my @output; + + # Start comment + if ($comments) { + print $logh "\"Prolog\" section is missing, inserting it.\n"; + push(@output, "%%BeginProlog\n"); + } + + # Generate the option code (not necessary when CUPS is spooler) + if ($spooler ne 'cups') { + print $logh "Inserting option code into \"Prolog\" section.\n"; + buildcommandline ($dat, $optionset); + push(@output, @{$dat->{'prologprepend'}}); + } + + # End comment + if ($comments) { + push(@output, "%%EndProlog\n"); + } + + return join('', @output); +} + +sub makesetupsection { + + # option set to be used, $comments = 1: Add "%%BeginSetup...%%EndSetup" + my ($dat, $optionset, $comments) = @_; + + # Collect data to be inserted here + my @output; + + # Start comment + if ($comments) { + print $logh "\"Setup\" section is missing, inserting it.\n"; + push(@output, "%%BeginSetup\n"); + } + + # PostScript code to generate accounting messages for CUPS + if ($spooler eq 'cups') { + print $logh "Inserting PostScript code for CUPS' page accounting\n"; + push(@output, $accounting_prolog); + } + + # Generate the option code (not necessary when CUPS is spooler) + if ($spooler ne 'cups') { + print $logh "Inserting option code into \"Setup\" section.\n"; + buildcommandline ($dat, $optionset); + push(@output, @{$dat->{'setupprepend'}}); + } + + # End comment + if ($comments) { + push(@output, "%%EndSetup\n"); + } + + return join('', @output); +} + +sub makepagesetupsection { + + # option set to be used, + # $comments = 1: Add "%%BeginPageSetup...%%EndPageSetup" + my ($dat, $optionset, $comments) = @_; + + # Collect data to be inserted here + my @output; + + # Start comment + if ($comments) { + push(@output, "%%BeginPageSetup\n"); + print $logh "\"PageSetup\" section is missing, inserting it.\n"; + } + + # Generate the option code (not necessary when CUPS is spooler) + print $logh "Inserting option code into \"PageSetup\" section.\n"; + buildcommandline ($dat, $optionset); + if ($spooler ne 'cups') { + push(@output, @{$dat->{'pagesetupprepend'}}); + } else { + push(@output, @{$dat->{'cupspagesetupprepend'}}); + } + + # End comment + if ($comments) { + push(@output, "%%EndPageSetup\n"); + } + + return join('', @output); +} + +sub parsepageranges { + + ## Parse a string containing page ranges and either check whether a + ## given page is in the ranges or, if the given page number is zero, + ## determine the score how specific this page range string is. + + # String with page ranges and number of current page (0 for score) + my ($ranges, $page) = @_; + + my $currentnumber = 0; + my $rangestart = 0; +####### Question: is rangeend ever used? + my $rangeend = 0; + my $currentkeyword = ''; + my $invalidrange = 0; + my $totalscore = 0; + my $pageinside = 0; + my $currentrange = ''; + + my $evaluaterange = sub { + # evaluate the current range: determine its score and whether the + # current page is member of it. + if ($invalidrange) { + # Range is invalid, issue a warning + print $logh " Invalid range: $currentrange\n"; + } else { + # We have a valid range, evaluate it + if ($currentkeyword) { + if ($currentkeyword =~ /^even/i) { + # All even-numbered pages + $totalscore += 50000; + $pageinside = 1 if (($page % 2) == 0); + } elsif ($currentkeyword =~ /^odd/i) { + # All odd-numbered pages + $totalscore += 50000; + $pageinside = 1 if (($page % 2) == 1); + } else { + # Invalid range + print $logh " Invalid range: $currentrange\n"; + } + } elsif (($rangestart == 0) && ($currentnumber > 0)) { + # Page range is a single page + $totalscore += 1; + $pageinside = 1 if ($page == $currentnumber); + } elsif (($rangestart > 0) && ($currentnumber > 0)) { + # Page range is a sequence of pages + $totalscore += (abs($currentnumber - $rangestart) + 1); + if ($currentnumber < $rangestart) { + my $tmp = $currentnumber; + $currentnumber = $rangestart; + $rangestart = $tmp; + } + $pageinside = 1 if (($page <= $currentnumber) && + ($page >= $rangestart)); + } elsif ($rangestart > 0) { + # Page range goes to the end of the document + $totalscore += 100000; + $pageinside = 1 if ($page >= $rangestart); + } else { + # Invalid range + print $logh " Invalid range: $currentrange\n"; + } + } + # Range is evaluated, remove all recordings of the current range + $rangestart = 0; + $currentnumber = 0; + $currentkeyword = ''; + $invalidrange = 0; + $currentrange = ''; + }; + + for (my $i = 0; $i < length($ranges); $i ++) { + my $c = substr($ranges, $i, 1); + if (!$invalidrange) { + if ($c =~ /\d/) { + # Digit + if ($currentkeyword) { + # Add to keyword + $currentkeyword .= $c; + } else { + # Build a page number + $currentnumber *= 10; + $currentnumber += $c; + } + } elsif ($c =~ /[a-z_]/i) { + # Letter or underscore + if (($rangestart > 0) || ($rangeend > 0) || + ($currentnumber > 0)) { + # Keyword not allowed after a page number or a + # page range + $invalidrange = 1; + } else { + # Build a keyword + $currentkeyword .= $c; + } + } elsif ($c eq '-') { + # Page range + if (($rangestart > 0) || ($currentkeyword)) { + # Keyword or two '-' not allowed in page range + $invalidrange = 1; + } else { + # Save start of range, reset page number + $rangestart = $currentnumber; + if ($rangestart == 0) { + $rangestart = 1; + } + $currentnumber = 0; + } + } + } + if ($c eq ',') { + # End of a range + &$evaluaterange(); + } else { + # Make a string of the current range, for warnings + $currentrange .= $c; + } + } + # End of input string + &$evaluaterange(); + # Return value + if (($page == 0) || ($pageinside)) { + return $totalscore; + } else { + return 0; + } +} + +sub setoptionsforpage { + + ## Set the options for a given page + + # Foomatic data, name of the option set where to apply the options, and + # number of the page + my ($dat, $optionset, $page) = @_; + + my $bestscore = 10000000; + my $value; + for my $arg (@{$dat->{'args'}}) { + $value = ''; + for my $key (keys %{$arg}) { + next if $key !~ /^pages:(.*)$/; + my $pageranges = $1; + if (my $score = parsepageranges($pageranges, $page)) { + if ($score <= $bestscore) { + $bestscore = $score; + $value = $arg->{$key}; + } + } + } + if ($value) { + $arg->{$optionset} = $value; + } + } +} + +sub buildcommandline { + + ## Build a renderer command line, based on the given option set + + # Foomatic data and name of the option set to apply + my ($dat, $optionset) = @_; + + # Construct the proper command line. + $dat->{'currentcmd'} = $dat->{'cmd'}; + my @prologprepend; + my @setupprepend; + my @pagesetupprepend; + my @cupspagesetupprepend; + my @jclprepend; + my @jclappend; + + # At first search for composite options and determine how they + # set their member options + for my $arg (@{$dat->{'args'}}) { $arg->{'order'} = 0 if !defined $arg->{'order'}; } + for my $arg (sort { $a->{'order'} <=> $b->{'order'} } + @{$dat->{'args'}}) { + + # Here we are only interested in composite options, skip the others + next if $arg->{'style'} ne 'X'; + + my $name = $arg->{'name'}; + # Check whether this composite option is controlled by another + # composite option, so nested composite options are possible. + my $userval = ($arg->{'fromcomposite'} ? + $arg->{'fromcomposite'} : $arg->{$optionset}); + + # Get the current setting + my $v = $arg->{'vals_byname'}{$userval}; + my @settings = split(/\s+/s, $v->{'driverval'}); + for my $s (@settings) { + my ($key, $value); + if ($s =~ /^([^=]+)=(.+)$/) { + $key = $1; + $value = $2; + } elsif ($s =~ /^no([^=]+)$/) { + $key = $1; + $value = 0; + } elsif ($s =~ /^([^=]+)$/) { + $key = $1; + $value = 1; + } + $a = $dat->{'args_byname'}{$key}; + if ($a->{$optionset} eq "From$name") { + # We must set this option according to the + # composite option + $a->{'fromcomposite'} = $value; + # Mark the option telling by which composite option + # it is controlled + $a->{'controlledby'} = $name; + } else { + $a->{'fromcomposite'} = ""; + } + } + # Remove PostScript code to be inserted after an appearance of the + # Composite option in the PostScript code. + undef $arg->{'jclsetup'}; + undef $arg->{'prolog'}; + undef $arg->{'setup'}; + undef $arg->{'pagesetup'}; + } + + for my $arg (sort { $a->{'order'} <=> $b->{'order'} } + @{$dat->{'args'}}) { + + # Composite options have no direct influence on the command + # line, skip them here + next if $arg->{'style'} eq 'X'; + + my $name = $arg->{'name'}; + my $spot = $arg->{'spot'}; + my $cmd = $arg->{'proto'}; + my $cmdf = $arg->{'protof'}; + my $type = ($arg->{'type'} || ""); + my $section = $arg->{'section'}; + my $userval = ($arg->{'fromcomposite'} ? + $arg->{'fromcomposite'} : $arg->{$optionset}); + my $cmdvar = ""; + + # If we have both "PageSize" and "PageRegion" options, we kept + # them all the time in sync, so we don't need to insert the settings + # of both options. So skip "PageRegion". + next if (($name eq "PageRegion") && + (defined($dat->{'args_byname'}{'PageSize'})) && + (defined($dat->{'args_byname'}{'PageRegion'}))); + + # Build the command line snippet/PostScript/JCL code for the current + # option + if ($type eq 'bool') { + + # If true, stick the proto into the command line, if false + # and we have a proto for false, stick that in + if (defined($userval) && $userval == 1) { + $cmdvar = $cmd; + } elsif ($cmdf) { + $userval = 0; + $cmdvar = $cmdf; + } + + } elsif ($type eq 'int' or $type eq 'float') { + + # If defined, process the proto and stick the result into + # the command line or postscript queue. + if (defined($userval)) { + my $min = $arg->{'min'}; + my $max = $arg->{'max'}; + # We have already range-checked, correct only + # floating point inaccuricies here + if ($userval < $min) { + $userval = $min; + } + if ($userval > $max) { + $userval = $max; + } + my $sprintfcmd = $cmd; + $sprintfcmd =~ s/\%(?!s)/\%\%/g; + $cmdvar = sprintf($sprintfcmd, + ($type eq 'int' + ? sprintf("%d", $userval) + : sprintf("%f", $userval))); + } else { + $userval = 'None'; + } + + } elsif ($type eq 'enum') { + + # If defined, stick the selected value into the proto and + # thence into the commandline + if (defined($userval)) { + # CUPS assumes that options with the choices "Yes", "No", + # "On", "Off", "True", or "False" are boolean options and + # maps "-o Option=On" to "-o Option" and "-o Option=Off" + # to "-o noOption", which foomatic-rip maps to "0" and "1". + # So when "0" or "1" is unavailable in the option, we try + # "Yes", "No", "On", "Off", "True", and "False". + my $val; + my $found = 0; + if ($val=valbyname($arg,$userval)) { + $found = 1; + } elsif ($userval =~ /^Custom\.[\d\.]+x[\d\.]+[A-Za-z]*$/) { + # Custom paper size + $val = valbyname($arg,"Custom"); + $found = 1; + } elsif ($userval eq '0') { + foreach (qw(No Off False None)) { + if ($val=valbyname($arg,$_)) { + $userval = $_; + $arg->{$optionset} = $userval; + $found = 1; + last; + } + } + } elsif ($userval eq '1') { + foreach (qw(Yes On True)) { + if ($val=valbyname($arg,$_)) { + $userval = $_; + $arg->{$optionset} = $userval; + $found = 1; + last; + } + } + } elsif ($userval eq 'LongEdge') { + # Handle different names for the choices of the + # "Duplex" option + foreach (qw(LongEdge DuplexNoTumble)) { + if ($val=valbyname($arg,$_)) { + $userval = $_; + $arg->{$optionset} = $userval; + $found = 1; + last; + } + } + } elsif ($userval eq 'ShortEdge') { + foreach (qw(ShortEdge DuplexTumble)) { + if ($val=valbyname($arg,$_)) { + $userval = $_; + $arg->{$optionset} = $userval; + $found = 1; + last; + } + } + } + if ($found) { + my $sprintfcmd = $cmd; + $sprintfcmd =~ s/\%(?!s)/\%\%/g; + $cmdvar = sprintf($sprintfcmd, + (defined($val->{'driverval'}) + ? $val->{'driverval'} + : $val->{'value'})); + # Custom paper size + if ($userval =~ /^Custom\.([\d\.]+)x([\d\.]+)([A-Za-z]*)$/) { + my $width = $1; + my $height = $2; + my $unit = $3; + # convert width and height to PostScript points + if (lc($unit) eq "in") { + $width *= 72.0; + $height *= 72.0; + } elsif (lc($unit) eq "cm") { + $width *= (72.0/2.54); + $height *= (72.0/2.54); + } elsif (lc($unit) eq "mm") { + $width *= (72.0/25.4); + $height *= (72.0/25.4); + } + # Round width and height + $width =~ s/\.[0-4].*$// or + $width =~ s/\.[5-9].*$// and $width += 1; + $height =~ s/\.[0-4].*$// or + $height =~ s/\.[5-9].*$// and $height += 1; + # Insert width and height into the prototype + if ($cmdvar =~ /^\s*pop\W/s) { + # Custom page size for PostScript printers + $cmdvar = "$width $height 0 0 0\n$cmdvar"; + } else { + # Custom page size for Foomatic/Gimp-Print + $cmdvar =~ s/\%0/$width/ or + $cmdvar =~ s/(\W)0(\W)/$1$width$2/ or + $cmdvar =~ s/^0(\W)/$width$1/m or + $cmdvar =~ s/(\W)0$/$1$width/m or + $cmdvar =~ s/^0$/$width/m; + $cmdvar =~ s/\%1/$height/ or + $cmdvar =~ s/(\W)0(\W)/$1$height$2/ or + $cmdvar =~ s/^0(\W)/$height$1/m or + $cmdvar =~ s/(\W)0$/$1$height/m or + $cmdvar =~ s/^0$/$height/m; + } + } + } else { + # User gave unknown value? + $userval = 'None'; + print $logh "Value $userval for $name is not a valid choice.\n"; + } + } else { + $userval = 'None'; + } + + } elsif (($type eq 'string') || ($type eq 'password')) { + # Stick the entered value into the proto and + # thence into the commandline + if (defined($userval)) { + my $val; + if ($val=valbyname($arg,$userval)) { + $userval = $val->{'value'}; + $cmdvar = (defined($val->{'driverval'}) + ? $val->{'driverval'} + : $val->{'value'}); + } else { + my $sprintfcmd = $cmd; + $sprintfcmd =~ s/\%(?!s)/\%\%/g; + $cmdvar = sprintf($sprintfcmd, $userval); + } + } else { + $userval = 'None'; + } + + } else { + # Ignore unknown option types silently + } + + # Insert the built snippet at the correct place + if ($arg->{'style'} eq 'G') { + # Place this Postscript command onto the prepend queue + # for the appropriate section. + if ($cmdvar) { + my $open = "[{\n%%BeginFeature: *$name $userval\n"; + my $close = "\n%%EndFeature\n} stopped cleartomark\n"; + if ($section eq "Prolog") { + push (@prologprepend, "$open$cmdvar$close"); + my $a = $arg; + while ($a->{'controlledby'}) { + # Collect option PostScript code to be inserted when + # the composite option which controls this option + # is found in the PostScript code + $a = $dat->{'args_byname'}{$a->{'controlledby'}}; + $a->{'prolog'} .= "$cmdvar\n"; + } + } elsif ($section eq "AnySetup") { + if ($optionset ne 'currentpage') { + push (@setupprepend, "$open$cmdvar$close"); + } elsif ($arg->{'header'} ne $userval) { + push (@pagesetupprepend, "$open$cmdvar$close"); + push (@cupspagesetupprepend, "$open$cmdvar$close"); + } + my $a = $arg; + while ($a->{'controlledby'}) { + # Collect option PostScript code to be inserted when + # the composite option which controls this option + # is found in the PostScript code + $a = $dat->{'args_byname'}{$a->{'controlledby'}}; + $a->{'setup'} .= "$cmdvar\n"; + $a->{'pagesetup'} .= "$cmdvar\n"; + } + } elsif ($section eq "DocumentSetup") { + push (@setupprepend, "$open$cmdvar$close"); + my $a = $arg; + while ($a->{'controlledby'}) { + # Collect option PostScript code to be inserted when + # the composite option which controls this option + # is found in the PostScript code + $a = $dat->{'args_byname'}{$a->{'controlledby'}}; + $a->{'setup'} .= "$cmdvar\n"; + } + } elsif ($section eq "PageSetup") { + push (@pagesetupprepend, "$open$cmdvar$close"); + my $a = $arg; + while ($a->{'controlledby'}) { + # Collect option PostScript code to be inserted when + # the composite option which controls this option + # is found in the PostScript code + $a = $dat->{'args_byname'}{$a->{'controlledby'}}; + $a->{'pagesetup'} .= "$cmdvar\n"; + } + } elsif ($section eq "JCLSetup") { + # PJL/JCL argument + $dat->{'jcl'} = 1; + push (@jclprepend, unhexify($cmdvar)); + my $a = $arg; + while ($a->{'controlledby'}) { + # Collect option PostScript code to be inserted when + # the composite option which controls this option + # is found in the PostScript code + $a = $dat->{'args_byname'}{$a->{'controlledby'}}; + $a->{'jclsetup'} .= "$cmdvar\n"; + } + } else { + push (@setupprepend, "$open$cmdvar$close"); + my $a = $arg; + while ($a->{'controlledby'}) { + # Collect option PostScript code to be inserted when + # the composite option which controls this option + # is found in the PostScript code + $a = $dat->{'args_byname'}{$a->{'controlledby'}}; + $a->{'setup'} .= "$cmdvar\n"; + } + } + } + # Do we have an option which is set to "Controlled by + # '<Composite>'"? Then make PostScript code available + # for substitution of "%% FoomaticRIPOptionSetting: ..." + if ($arg->{'fromcomposite'}) { + $arg->{'compositesubst'} = "$cmdvar\n"; + } + } elsif ($arg->{'style'} eq 'J') { + # JCL argument + $dat->{'jcl'} = 1; + # put JCL commands onto JCL stack... + push (@jclprepend, "\@PJL $cmdvar\n") if $cmdvar; + } elsif ($arg->{'style'} eq 'C') { + # command-line argument + + # Insert the processed argument in the commandline + # just before every occurance of the spot marker. + $dat->{'currentcmd'} =~ s!\%$spot!$cmdvar\%$spot!g; + } + # Insert option into command line of CUPS raster driver + if ($dat->{'currentcmd'} =~ m!\%Y!) { + next if !defined($userval) or $userval eq ""; + $dat->{'currentcmd'} =~ s!\%Y!$name=$userval \%Y!g; + } + # Remove the marks telling that this option is currently controlled + # by a composite option (setting "From<composite>") + undef $arg->{'fromcomposite'}; + undef $arg->{'controlledby'}; + } + + + ### Tidy up after computing option statements for all of P, J, and + ### C types: + + ## C type finishing + # Pluck out all of the %n's from the command line prototype + my @letters = qw/A B C D E F G H I J K L M W X Y Z/; + for my $spot (@letters) { + # Remove the letter markers from the commandline + $dat->{'currentcmd'} =~ s!\%$spot!!g; + } + + ## J type finishing + # Compute the proper stuff to say around the job + + if ((defined($dat->{'jcl'})) && (!$jobhasjcl)) { + + # Stick beginning of job cruft on the front of the jcl stuff... + unshift (@jclprepend, $jclbegin); + + # Command to switch to the interpreter + push (@jclprepend, $jcltointerpreter); + + # Arrange for JCL RESET command at end of job + push (@jclappend, $jclend); + + # Put the JCL stuff into the data structure + @{$dat->{'jclprepend'}} = @jclprepend; + @{$dat->{'jclappend'}} = @jclappend; + } + + ## G type finishing + # Save PostScript options + @{$dat->{'prologprepend'}} = @prologprepend; + @{$dat->{'setupprepend'}} = @setupprepend; + @{$dat->{'pagesetupprepend'}} = @pagesetupprepend; + @{$dat->{'cupspagesetupprepend'}} = @cupspagesetupprepend; +} + +sub buildpdqdriver { + + # Build a PDQ driver description file to use the given PPD file + # together with foomatic-rip with the PDQ printing system + + # Foomatic data and name of the option set for the default settings + my ($dat, $optionset) = @_; + + # Construct structure with driver information + my @pdqdriver = (); + + # Construct option list + my @driveropts = (); + + # Do we have a "Custom" setting for the page size? + # Then we have to insert the following into the "filter_exec" script. + my @setcustompagesize = (); + + # Fata for a custom page size, to allow a custom size as default + my $pagewidth = 612; + my $pageheight = 792; + my $pageunit = "pt"; + + + + ## First, compute the various option/value clauses + for my $arg (@{$dat->{'args'}}) { + + if ($arg->{'type'} eq "enum") { + + # Option with only one choice, omit it, foomatic-rip will set + # this choice anyway. + next if ($#{$arg->{'vals'}} < 1); + + my $nam = $arg->{'name'}; + + # Omit "PageRegion" option, it does the same as "PageSize". + next if $nam eq "PageRegion"; + + my $com = $arg->{'comment'}; + + # Assure that the comment is not empty + if (!$com) { + $com = $nam; + } + + my $def = $arg->{$optionset}; + $arg->{'varname'} = "$nam"; + $arg->{'varname'} =~ s![\-\/\.]!\_!g; + my $varn = $arg->{'varname'}; + + # 1, if setting "PageSize=Custom" was found + # Then we must add options for page width and height + my $custompagesize = 0; + + # If the default is a custom size we have to set also + # defaults for the width, height, and units of the page + if (($nam eq "PageSize") && + ($def =~ /^Custom\.([\d\.]+)x([\d\.]+)([A-Za-z]*)$/)) { + $def = "Custom"; + $pagewidth = $1; + $pageheight = $2; + $pageunit = $3; + } + + # No quotes, thank you. + $com =~ s!\"!\\\"!g; + + push(@driveropts, + " option {\n", + " var = \"$varn\"\n", + " desc = \"$com\"\n"); + + # get enumeration values for each enum arg + my ($ev, @vals, @valstmp); + for $ev (@{$arg->{'vals'}}) { + my $choiceshortname = $ev->{'value'}; + my $choicename = "${nam}_${choiceshortname}"; + my $val = " -o ${nam}=${choiceshortname}"; + my $com = $ev->{'comment'}; + + # Assure that the comment is not empty + if (!$com) { + $com = $choiceshortname; + } + + # stick another choice on driveropts + push(@valstmp, + " choice \"$choicename\" {\n", + " desc = \"$com\"\n", + " value = \"$val\"\n", + " }\n"); + if (($nam eq "PageSize") && + ($choiceshortname eq "Custom")) { + $custompagesize = 1; + if ($#setcustompagesize < 0) { + push(@setcustompagesize, + " # Custom page size settings\n", + " # We aren't really checking for " . + "legal vals.\n", + " if [ \"x\${$varn}\" == 'x$val' ]; " . + "then\n", + " $varn=\"\${$varn}.\${PageWidth}" . + "x\${PageHeight}\${PageSizeUnit}\"\n", + " fi\n\n"); + } + } + } + + push(@driveropts, + " default_choice \"" . $nam . "_" . $def . "\"\n", + @valstmp, + " }\n\n"); + + if ($custompagesize) { + # Add options to set the custom page size + push(@driveropts, + " argument {\n", + " var = \"PageWidth\"\n", + " desc = \"Page Width (for \\\"Custom\\\" page " . + "size)\"\n", + " def_value \"$pagewidth\"\n", + " help = \"Minimum value: 0, Maximum value: " . + "100000\"\n", + " }\n\n", + " argument {\n", + " var = \"PageHeight\"\n", + " desc = \"Page Height (for \\\"Custom\\\" page " . + "size)\"\n", + " def_value \"$pageheight\"\n", + " help = \"Minimum value: 0, Maximum value: " . + "100000\"\n", + " }\n\n", + " option {\n", + " var = \"PageSizeUnit\"\n", + " desc = \"Unit (for \\\"Custom\\\" page size)\"\n", + " default_choice \"PageSizeUnit_$pageunit\"\n", + " choice \"PageSizeUnit_pt\" {\n", + " desc = \"Points (1/72 inch)\"\n", + " value = \"pt\"\n", + " }\n", + " choice \"PageSizeUnit_in\" {\n", + " desc = \"Inches\"\n", + " value = \"in\"\n", + " }\n", + " choice \"PageSizeUnit_cm\" {\n", + " desc = \"cm\"\n", + " value = \"cm\"\n", + " }\n", + " choice \"PageSizeUnit_mm\" {\n", + " desc = \"mm\"\n", + " value = \"mm\"\n", + " }\n", + " }\n\n"); + } + + } elsif ($arg->{'type'} eq 'int' or $arg->{'type'} eq 'float') { + + my $nam = $arg->{'name'}; + my $com = $arg->{'comment'}; + + # Assure that the comment is not empty + if (!$com) { + $com = $nam; + } + + my $def = $arg->{$optionset}; + my $max = $arg->{'max'}; + my $min = $arg->{'min'}; + $arg->{'varname'} = "$nam"; + $arg->{'varname'} =~ s![\-\/\.]!\_!g; + my $varn = $arg->{'varname'}; + my $legal = $arg->{'legal'} = + "Minimum value: $min, Maximum value: $max"; + + my $defstr = ""; + if ($def) { + $defstr = sprintf(" def_value \"%s\"\n", $def); + } + + push(@driveropts, + " argument {\n", + " var = \"$varn\"\n", + " desc = \"$com\"\n", + $defstr, + " help = \"$legal\"\n", + " }\n\n"); + + } elsif ($arg->{'type'} eq 'bool') { + + my $nam = $arg->{'name'}; + my $com = $arg->{'comment'}; + + # Assure that the comment is not empty + if (!$com) { + $com = $nam; + } + + my $tcom = $arg->{'comment_true'}; + my $fcom = $arg->{'comment_false'}; + my $def = $arg->{$optionset}; + $arg->{'legal'} = "Value is a boolean flag"; + $arg->{'varname'} = "$nam"; + $arg->{'varname'} =~ s![\-\/\.]!\_!g; + my $varn = $arg->{'varname'}; + + my $defstr = ""; + if ($def) { + $defstr = sprintf(" default_choice \"%s\"\n", + $def ? "$nam" : "no$nam"); + } else { + $defstr = sprintf(" default_choice \"%s\"\n", "no$nam"); + } + push(@driveropts, + " option {\n", + " var = \"$varn\"\n", + " desc = \"$com\"\n", + $defstr, + " choice \"$nam\" {\n", + " desc = \"$tcom\"\n", + " value = \" -o $nam=True\"\n", + " }\n", + " choice \"no$nam\" {\n", + " desc = \"$fcom\"\n", + " value = \" -o $nam=False\"\n", + " }\n", + " }\n\n"); + + } elsif ($arg->{'type'} eq 'string' or $arg->{'type'} eq 'password') { + + my $nam = $arg->{'name'}; + my $com = $arg->{'comment'}; + + # Assure that the comment is not empty + if (!$com) { + $com = $nam; + } + + my $def = $arg->{$optionset}; + my $maxlength = $arg->{'maxlength'}; + my $proto = $arg->{'proto'}; + $arg->{'varname'} = "$nam"; + $arg->{'varname'} =~ s![\-\/\.]!\_!g; + my $varn = $arg->{'varname'}; + + my $legal; + if (defined($maxlength)) { + $legal .= "Maximum length: $maxlength characters, "; + } + $legal .= "Examples/special settings: "; + for (@{$arg->{'vals'}}) { + my ($value, $comment, $driverval) = + ($_->{'value'}, $_->{'comment'}, $_->{'driverval'}); + # Retrieve the original string from the prototype + # and the driverval + my $string; + if ($proto) { + my $s = index($proto, '%s'); + my $l = length($driverval) - length($proto) + 2; + if (($s < 0) || ($l < 0)) { + $string = $driverval; + } else { + $string = substr($driverval, $s, $l); + } + } else { + $string = $driverval; + } + if ($value ne $string) { + $legal .= "${value}: \\\"$string\\\""; + } else { + $legal .= "\\\"$value\\\""; + } + if ($comment && ($value ne $comment) && + ($string ne $comment) && + (($value ne 'None') || ($comment ne '(None)'))) { + $legal .= " ($comment)"; + } + $legal .= "; "; + } + $legal =~ s/; $//; + + $arg->{'legal'} = $legal; + + my $defstr = ""; + if ($def) { + $defstr = sprintf(" def_value \"%s\"\n", $def); + } + + push(@driveropts, + " argument {\n", + " var = \"$varn\"\n", + " desc = \"$com\"\n", + $defstr, + " help = \"$legal\"\n", + " }\n\n"); + + } + + } + + + + ## Define the "docs" option to print the driver documentation page + + push(@driveropts, + " option {\n", + " var = \"DRIVERDOCS\"\n", + " desc = \"Print driver usage information\"\n", + " default_choice \"nodocs\"\n", + " choice \"docs\" {\n", + " desc = \"Yes\"\n", + " value = \" -o docs\"\n", + " }\n", + " choice \"nodocs\" {\n", + " desc = \"No\"\n", + " value = \"\"\n", + " }\n", + " }\n\n"); + + + + ## Build the "foomatic-rip" command line + my $commandline = "foomatic-rip --pdq"; + if ($printer) { + $commandline .= " -P $printer"; + } else { + # Make sure that the PPD file is entered with an absolute path + if ($ppdfile !~ m!^/!) { + my $pwd = cwd; + $ppdfile = "$pwd/$ppdfile"; + } + $commandline .= " --ppd=$ppdfile"; + } + for my $arg (@{$dat->{'args'}}) { + if ($arg->{'varname'}) { + $commandline .= "\${$arg->{'varname'}}"; + } + } + $commandline .= "\${DRIVERDOCS} \$INPUT > \$OUTPUT"; + + + + ## Now we generate code to build the command line snippets for the + ## numerical options + + my @psfilter; + for my $arg (@{$dat->{'args'}}) { + + # Only numerical and string options need to be treated here + next if (($arg->{'type'} ne 'int') && + ($arg->{'type'} ne 'float') && + ($arg->{'type'} ne 'string') && + ($arg->{'type'} ne 'password')); + + my $comment = $arg->{'comment'}; + my $name = $arg->{'name'}; + my $varname = $arg->{'varname'}; + + # If the option's variable is non-null, put in the + # argument. Otherwise this option is the empty + # string. Error checking? + + push(@psfilter, + " # $comment\n", + (($arg->{'type'} eq 'int') || ($arg->{'type'} eq 'float') ? + (" # We aren't really checking for max/min,\n", + " # this is done by foomatic-rip\n", + " if [ \"x\${$varname}\" != 'x' ]; then\n ") : ""), + #" $varname=`echo \${$varname} | perl -p -e \"s/'/'\\\\\\\\\\\\\\\\''/g\"`\n", + " $varname=\" -o $name='\${$varname}'\"\n", + (($arg->{'type'} eq 'int') || ($arg->{'type'} eq 'float') ? + " fi\n" : ""), + "\n"); + } + + # Command execution + + push(@psfilter, + " if ! test -e \$INPUT.ok; then\n", + " sh -c \"$commandline\"\n", + " if ! test -e \$OUTPUT; then \n", + " echo 'Error running foomatic-rip; no output!'\n", + " exit 1\n", + " fi\n", + " else\n", + " ln -s \$INPUT \$OUTPUT\n", + " fi\n\n"); + + my $version = time(); + my $name = "$model-$version"; + $name =~ s/\W/\-/g; + $name =~ s/\-+/\-/g; + + my $pname = $model; + + push (@pdqdriver, + "driver \"$name\" {\n\n", + " # This PDQ driver declaration file was generated " . + "automatically by\n", + " # foomatic-rip from information in the file $ppdfile.\n", + " # It allows printing with PDQ on the $pname.\n", + "\n", + " requires \"foomatic-rip\"\n\n", + @driveropts, + " language_driver all {\n", + " # We accept all file types and pass them to foomatic-rip\n", + " # (invoked in \"filter_exec {}\" section) without\n", + " # pre-filtering\n", + " filetype_regx \"\"\n", + " convert_exec {\n", + " ln -s \$INPUT \$OUTPUT\n", + " }\n", + " }\n\n", + " filter_exec {\n", + @setcustompagesize, + @psfilter, + " }\n", + "}\n"); + + return @pdqdriver; + +} + + + +# Emacs tabulator/indentation + +### Local Variables: +### tab-width: 8 +### perl-indent-level: 4 +### End: diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..e9de238 --- /dev/null +++ b/install-sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/makeMan.in b/makeMan.in new file mode 100755 index 0000000..310b8e0 --- /dev/null +++ b/makeMan.in @@ -0,0 +1,49 @@ +#!@PERL@ -w +# +# Generates manpages from manpage.in files by substituting @...@ tags. +# + +use Getopt::Std; + +my (%opt,@files); +getopts( 'v', \%opt); +my $VERBOSE = defined $opt{v} ? $opt{v} : 0; + +if (@ARGV) +{ + @files = @ARGV; +} +else +{ + opendir CWD, "." or die "Ooops! Can't read current dir!"; + @files = readdir CWD; + closedir CWD; +} + +my $append; +FILE: +foreach my $file (@files) +{ + print STDERR "Checking file `$file' ... " if $VERBOSE; + $append = "discard\n"; + next unless -f $file and $file =~ /^(.*\.[1-9])\.in$/; + my ($man) = $1; + $man =~ s,.*/,,; + next unless ((`file $file` =~ m/\b[ntg]roff\b/) or + (`file $file` =~ m/\[nt\]roff/)); + print STDERR "MATCHED\n" if $VERBOSE; + $append = ''; + open IN, "<$file" or (warn "Can't read input file $file!" and next FILE); + unlink $man; + open OUT, ">$man" or (warn "Can't write output file $man!" and next FILE); + while (<IN>) + { + s/@@([^@]*)@@/eval $1/ge; + print OUT; + } + close IN; +} +continue +{ + print STDERR $append if $VERBOSE; +} diff --git a/make_configure b/make_configure new file mode 100755 index 0000000..2664dee --- /dev/null +++ b/make_configure @@ -0,0 +1,3 @@ +aclocal +autoconf +perl -p -i -e "s=\#include <xmlversion.h>=\#include <libxml/xmlversion.h>=g" configure
\ No newline at end of file diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 0000000..f7b21d1 --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman <friedman@prep.ai.mit.edu> +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.1.2.2 2004/01/22 02:47:21 gtaylor Exp $ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here |