This software users manual describes how to use the Common UNIX Printing SystemTM ("CUPSTM") Version 1.1.23.
CUPS provides a portable printing layer for UNIX®-based operating systems. It has been developed by Easy Software Products to promote a standard printing solution for all UNIX vendors and users. CUPS provides the System V and Berkeley command-line interfaces.
CUPS uses the Internet Printing Protocol ("IPP") as the basis for managing print jobs and queues. The Line Printer Daemon ("LPD") Server Message Block ("SMB"), and AppSocket (a.k.a. JetDirect) protocols are also supported with reduced functionality. CUPS adds network printer browsing and PostScript Printer Description ("PPD") based printing options to support real-world printing under UNIX.
CUPS includes an image file RIP that supports printing of image files to non-PostScript printers. A customized version of GNU Ghostscript 7.05 for CUPS called ESP Ghostscript is available separately to support printing of PostScript files within the CUPS driver framework. Sample drivers for Dymo, EPSON, HP, and OKIDATA printers are included that use these filters.
Drivers for thousands of printers are provided with our ESP Print Pro software, available at:
http://www.easysw.com/printpro/
CUPS is licensed under the GNU General Public License and GNU Library General Public License. Please contact Easy Software Products for commercial support and "binary distribution" rights.
This software users manual is organized into the following sections:
Various font and syntax conventions are used in this guide. Examples and their meanings and uses are explained below:
Example | Description | |
---|---|---|
lpstat
lpstat(1) | The names of commands; the first mention of a command or function in a chapter is followed by a manual page section number. | |
/var
/usr/share/cups/data/testprint.ps | File and directory names. | |
Request ID is Printer-123 | Screen output. | |
lp -d printer filename ENTER | Literal user input; special keys like ENTER are in ALL CAPS. | |
12.3 | Numbers in the text are written using the period (.) to indicate the decimal point. |
This chapter provides an overview of how the Common UNIX Printing System works.
For years the printing problem has plagued UNIX. Unlike Microsoft® Windows® or Mac OS, UNIX has no standard interface or system in place for supporting printers. Among the solutions currently available, the Berkeley and System V printing systems are the most prevalent.
These printing systems support line printers (text only) or PostScript printers (text and graphics), and with some coaxing they can be made to support a full range of printers and file formats. However, because each varient of the UNIX operating system uses a different printing system than the next developing printer drivers for a wide range of printers and operating systems is extremely difficult. That combined with the limited volume of customers for each UNIX varient has forced most printer vendors to give up supporting UNIX entirely.
CUPS is designed to eliminate the printing problem. One common printing system can be used by all UNIX varients to support the printing needs of users. Printer vendors can use its modular filter interface to develop a single driver program that supports a wide range of file formats with little or no effort. Since CUPS provides both the System V and Berkeley printing commands, users (and applications) can reap the benefits of this new technology with no changes.
CUPS is based upon an emerging Internet standard called the Internet Printing Protocol. IPP has been embraced by dozens of printer and printer server manufacturers and is supported by Microsoft Windows 2000.
IPP defines a standard protocol for printing as well as managing print jobs and printer options like media size, resolution, and so forth. Like all IP-based protocols, IPP can be used locally or over the Internet to printers hundreds or thousands of miles away. Unlike other protocols, however, IPP also supports access control, authentication, and encryption, making it a much more capable and secure printing solution than older ones.
IPP is layered on top of the Hyper-Text Transport Protocol ("HTTP") which is the basis of web servers on the Internet. This allows users to view documentation, check status information on a printer or server, and manage their printers, classes, and jobs using their web browser.
CUPS provides a complete IPP/1.1 based printing system that provides Basic, Digest, and local certificate authentication and user, domain, or IP-based access control. TLS encryption will be available in future versions of CUPS.
Each file or set of files that is submitted for printing is called a job. Jobs are identified by a unique number starting at 1 and are assigned to a particular destination, usually a printer. Jobs can also have options associated with them such as media size, number of copies, and priority.
CUPS supports collections of printers known as classes. Jobs sent to a class are forwarded to the first available printer in the class.
Filters allow a user or application to print many types of files without extra effort. Print jobs sent to a CUPS server are filtered before sending them to a printer. Some filters convert job files to different formats that the printer can understand. Others perform page selection and ordering tasks.
CUPS provides filters for printing many types of image files, HP-GL/2 files, PDF files, and text files. CUPS also supplies PostScript and image file Raster Image Processor ("RIP") filters that convert PostScript or image files into bitmaps that can be sent to a raster printer.
Backends perform the most important task of all - they send the filtered print data to the printer.
CUPS provides backends for printing over parallel, serial, and USB ports, and over the network via the IPP, JetDirect (AppSocket), and Line Printer Daemon ("LPD") protocols. Additional backends are available in network service packages such as the SMB backend included with the popular SAMBA software.
Backends are also used to determine the available devices. On startup each backend is asked for a list of devices it supports, and any information that is available. This allows the parallel backend to tell CUPS that an EPSON Stylus Color 600 printer is attached to parallel port 1, for example.
Printer drivers in CUPS consist of one of more filters specific to a printer. CUPS includes sample printer drivers for Hewlett-Packard LaserJet and DeskJet printers and EPSON 9-pin, 24-pin, Stylus Color, and Stylus Photo printers. While these drivers do not generate optimal output for the different printer models, they do provide basic printing and demonstrate how you can write your own printer drivers and incorporate them into CUPS.
Printers and classes on the local system are automatically shared with other systems on the network. This allows you to setup one system to print to a printer and use this system as a printer server or spool host for all of the others. Users may then select a local printer by name or a remote printer using "name@server".
CUPS also provides implicit classes, which are collections of printers and/or classes with the same name. This allows you to setup multiple servers pointing to the same physical network printer, for example, so that you aren't relying on a single system for printing. Because this also works with printer classes, you can setup multiple servers and printers and never worry about a single point of failure unless all of the printers and servers go down!
This chapter shows you how to submit, query, and cancel print jobs to different printers.
CUPS provides both the System V (lp(1)
) and Berkeley (
lpr(1)
) printing commands. Type the following command to print a
file to the default (or only) printer on the system:
lp filename ENTER
or:
lpr filename ENTER
CUPS understands many different types of files directly, including PostScript and image files. This allows you to print from inside your applications or at the command-line, whichever is most convenient!
Many systems will have more than one printer available to the user. These printers can be attached to the local system via a parallel, serial, or USB port, or available over the network.
Use the lpstat(1)
command to see a list of available
printers:
lpstat -p -d ENTER
The -p
option specifies that you want to see a list of
printers, and the -d
option reports the current default
printer or class.
Use the -d
option with the lp
command to
print to a specific printer:
lp -d printer filename ENTER
or the -P
option with the lpr
command:
lpr -P printer filename ENTER
For many types of files, the default printer options may be sufficient for your needs. However, there may be times when you need to change the options for a particular file you are printing.
The lp
and lpr
commands allow you to pass
printer options using the -o
option:
lp -o landscape -o scaling=75 -o media=A4 filename.jpg ENTER lpr -o landscape -o scaling=75 -o media=A4 filename.jpg ENTER
The available printer options vary depending on the printer. The standard options are described in Chapter 3, "Standard Printing Options".
Both the lp
and lpr
commands have options
for printing more than one copy of a file:
lp -n num-copies filename ENTER lpr -#num-copies filename ENTER
Copies are normally not collated for you. Use the -o
Collate=True
option to get collated copies :
lp -n num-copies -o Collate=True filename ENTER lpr -#num-copies -o Collate=True filename ENTER
The lpstat
command can be used to check for jobs that
you have submitted for printing:
lpstat ENTER Printer-1 johndoe 4427776 Printer-2 johndoe 15786 Printer-3 johndoe 372842
The jobs are listed in the order they will be printed. Use the
-p
option to see which files and printers are active:
lpstat -p ENTER printer DeskJet now printing DeskJet-1.
Use the -o
and -p
options together to show
the jobs and the printers:
lpstat -o -p ENTER Printer-1 johndoe 4427776 Printer-2 johndoe 15786 Printer-3 johndoe 372842 printer DeskJet now printing DeskJet-1.
Since CUPS uses the Internet Printing Protocol, it is also a fully-functional web server. To use your web browser to monitor the printers on your system, open the URL:
http://localhost:631
From there you can view the status of classes, jobs, and printers with the click of a button!
The cancel(1)
and lprm(1)
commands cancel a
print job:
cancel job-id ENTER lprm job-id ENTER
The job-id
is the number that was reported to you by the
lp
or lpstat
commands.
This chapter describes the standard printer options that are
available when printing with the lp
and lpr
commands.
The following options apply when printing all types of files.
The -o media=xyz
option sets the media size, type,
and/or source:
lp -o media=Letter filename ENTER lp -o media=Letter,MultiPurpose filename ENTER lpr -o media=Letter,Transparency filename ENTER lpr -o media=Letter,MultiPurpose,Transparency filename ENTER
The available media sizes, types, and sources depend on the printer, but most support the following options (case is not significant):
Letter
- US Letter (8.5x11 inches, or 216x279mm)Legal
- US Legal (8.5x14 inches, or 216x356mm)A4
- ISO A4 (8.27x11.69 inches, or 210x297mm)COM10
- US #10 Envelope (9.5x4.125 inches, or
241x105mm)DL
- ISO DL Envelope (8.66x4.33 inches, or 220x110mm)Transparency
- Transparency media type or sourceUpper
- Upper paper trayLower
- Lower paper trayMultiPurpose
- Multi-purpose paper trayLargeCapacity
- Large capacity paper trayThe actual options supported are defined in the printer's PPD file in
the PageSize
, InputSlot
, and MediaType
options.
The -o landscape
option will rotate the page 90 degrees
to print in landscape orientation:
lp -o landscape filename ENTER lpr -o landscape filename ENTER
The -o sides=two-sided-short-edge
and -o
sides=two-sided-long-edge
options will enable duplexing on the
printer, if the printer supports it. The -o
sides=two-sided-short-edge
option is suitable for landscape
pages, while the -o sides=two-sided-long-edge
option is
suitable for portrait pages:
lp -o sides=two-sided-short-edge filename ENTER lp -o sides=two-sided-long-edge filename ENTER lpr -o sides=two-sided-long-edge filename ENTER
The default is to print single-sided:
lp -o sides=one-sided filename ENTER lpr -o sides=one-sided filename ENTER
The following options apply when printing all types of files.
The -o jobsheets=start,end
option sets the banner
page(s) to use for a job:
lp -o job-sheets=none filename ENTER lp -o job-sheets=standard filename ENTER lpr -o job-sheets=classified,classified filename ENTER
If only one banner file is specified, it will be printed before the files in the job. If a second banner file is specified, it is printed after the files in the job.
The available banner pages depend on the local system configuration; CUPS includes the following banner files:
none
- Do not produce a banner page.classified
- A banner page with a "classified" label at
the top and bottom.confidential
- A banner page with a "confidential"
label at the top and bottom.secret
- A banner page with a "secret" label at the top
and bottom.standard
- A banner page with no label at the top and
bottom.topsecret
- A banner page with a "top secret" label at
the top and bottom.unclassified
- A banner page with an "unclassified"
label at the top and bottom.The following options apply when printing all types of files.
The -o page-ranges=pages
option selects a range of pages
for printing:
lp -o page-ranges=1 filename ENTER lp -o page-ranges=1-4 filename ENTER lp -o page-ranges=1-4,7,9-12 filename ENTER lpr -o page-ranges=1-4,7,9-12 filename ENTER
As shown above, the pages
value can be a single page, a
range of pages, or a collection of page numbers and ranges separated by
commas. The pages will always be printed in ascending order, regardless
of the order of the pages in the page-ranges
option.
The default is to print all pages.
Use the -o page-set=set
option to select the even or odd
pages:
lp -o page-set=odd filename ENTER lp -o page-set=even filename ENTER lpr -o page-set=even filename ENTER
The default is to print all pages.
The the -o outputorder=order
option to set the output
order of all pages:
lp -o outputorder=normal filename ENTER lp -o outputorder=reverse filename ENTER lpr -o outputorder=reverse filename ENTER
The -o number-up=value
option selects N-Up printing.
N-Up printing places multiple document pages on a single printed page.
CUPS supports 1, 2, 4, 6, 9, and 16-Up formats; the default format is
1-Up:
lp -o number-up=1 filename ENTER lp -o number-up=2 filename ENTER lp -o number-up=4 filename ENTER lpr -o number-up=16 filename ENTER
The -o page-border=value
option chooses the border to
draw around each page:
-o page-border=double
; draw two hairline borders around
each page-o page-border=double-thick
; draw two 1pt borders
around each page-o page-border=none
; do not draw a border (default)-o page-border=single
; draw one hairline border around
each page-o page-border=single-thick
; draw one 1pt border around
each pageThe -o number-up-layout=value
option chooses the layout
of the pages on each output page:
-o number-up-layout=btlr
; Bottom to top, left to right-o number-up-layout=btrl
; Bottom to top, right to left-o number-up-layout=lrbt
; Left to right, bottom to top-o number-up-layout=lrtb
; Left to right, top to bottom
(default)-o number-up-layout=rlbt
; Right to left, bottom to top-o number-up-layout=rltb
; Right to left, top to bottom-o number-up-layout=tblr
; Top to bottom, left to right-o number-up-layout=tbrl
; Top to bottom, right to leftYou can mirror a print using the -o mirror
option:
lp -o mirror filename ENTER lpr -o mirror filename ENTER
This is useful for printing mirrored pages on transfer paper, for T shirts, mugs, etc.
You can control the overall brightness of the printed output using
the -o brightness=percent
option:
lp -o brightness=120 filename ENTER lpr -o brightness=120 filename ENTER
Values greater than 100 will lighten the print, while values less than 100 will darken it.
You can control the overall gamma correction of the printed output
using the -o gamma=value
option:
lp -o gamma=1700 filename ENTER lpr -o gamma=1700 filename ENTER
Values greater than 1000 will lighten the print, while values less than 1000 will darken it. The default gamma is 1000.
The following options apply when printing text files.
The -o cpi=value
option sets the number of characters
per inch:
lp -o cpi=10 filename ENTER lp -o cpi=12 filename ENTER lpr -o cpi=17 filename ENTER
The default characters per inch is 10.
The -o lpi=value
option sets the number of lines per
inch:
lp -o lpi=6 filename ENTER lpr -o lpi=8 filename ENTER
The default lines per inch is 6.
The -o columns=value
option sets the number of text
columns:
lp -o columns=2 filename ENTER lpr -o columns=3 filename ENTER
The default number of columns is 1.
Normally the page margins are set to the hard limits of the printer.
Use the -o page-left=value
, -o page-right=value
, -o page-top=value
, and -o page-bottom=value
options to adjust the page margins:
lp -o page-left=value filename ENTER lp -o page-right=value filename ENTER lp -o page-top=value filename ENTER lp -o page-bottom=value filename ENTER lpr -o page-bottom=value filename ENTER
The value
argument is the margin in points; each point
is 1/72 inch or 0.35mm.
The -o prettyprint
option puts a header at the top of
each page with the page number, job title (usually the filename), and
the date. Also, C and C++ keywords are highlighted, and comment lines
are italicized:
lp -o prettyprint filename ENTER lpr -o prettyprint filename ENTER
The following options apply when printing image files.
The -o position=name
option specifies the position of
the image on the page:
center
- Center the image on the page (default)top
- Print the image centered at the top of the pageleft
- Print the image centered on the left of pageright
- Print the image centered on the right of the
pagetop-left
- Print the image at the top left corner of
the pagetop-right
- Print the image at the top right corner of
the pagebottom
- Print the image centered at the bottom of the
pagebottom-left
- Print the image at the bottom left corner
of the pagebottom-right
- Print the image at the bottom right
corner of the pageThe -o scaling=percent
, -o ppi=value
, and
-o natural-scaling=percent
options change the size of a printed
image:
lp -o scaling=percent filename ENTER lp -o ppi=value filename ENTER lpr -o natural-scaling=percent filename ENTER
The scaling=percent
value is a number from 1 to 800
specifying the size in relation to the page (not the image.) A
scaling of 100 percent will fill the page as completely as the image
aspect ratio allows. A scaling of 200 percent will print on up to 4
pages.
The ppi=value
value is a number from 1 to 1200
specifying the resolution of the image in pixels per inch. An image
that is 3000x2400 pixels will print 10x8 inches at 300 pixels per inch,
for example. If the specified resolution makes the image larger than
the page, multiple pages will be printed to satisfy the request.
The natural-scaling=percent
value is a number from 1 to
800 specifying the size in relation to the natural image size. A
scaling of 100 percent will print the image at its natural size, while
a scaling of 50 percent will print the image at half its natural size.
If the specified scaling makes the image larger than the page, multiple
pages will be printed to satisfy the request.
The -o hue=value
option will adjust the hue of the
printed image, much like the tint control on your television:
lp -o hue=value filename ENTER lpr -o hue=value filename ENTER
The value
argument is a number from -360 to 360 and
represents the color hue rotation. The following table summarizes the
change you'll see with different colors:
Original | hue=-45 | hue=45 |
---|---|---|
Red | Purple | Yellow-orange |
Green | Yellow-green | Blue-green |
Yellow | Orange | Green-yellow |
Blue | Sky-blue | Purple |
Magenta | Indigo | Crimson |
Cyan | Blue-green | Light-navy-blue |
The default hue adjustment is 0.
The -o saturation=percent
option adjusts the saturation
of the colors in an image, much like the color knob on your television:
lp -o saturation=percent filename ENTER lpr -o saturation=percent filename ENTER
The percent
argument specifies the color saturation from
0 to 200. A color saturation of 0 produces a black-and-white print,
while a value of 200 will make the colors extremely intense.
The default saturation is 100.
The following options apply to HP-GL/2 files.
The -o blackplot
option specifies that all pens should
plot in black:
lp -o blackplot filename ENTER lpr -o blackplot filename ENTER
The default is to use the colors defined in the plot file or the standard pen colors defined in the HP-GL/2 reference manual from Hewlett Packard.
The -o fitplot
option specifies that the plot should be
scaled to fit on the page:
lp -o fitplot filename ENTER lpr -o fitplot filename ENTER
The default is to use the absolute distances specified in the plot file.
NOTE:
This feature depends upon an accurate plot size ( |
The -o penwidth=value
option specifies the default pen
width for HP-GL/2 files:
lp -o penwidth=value filename ENTER lpr -o penwidth=value filename ENTER
The pen width value
specifies the pen width in
micrometers. The default value of 1000 produces lines that are 1
millimeter in width. Specifying a pen width of 0 produces lines that
are exactly 1 pixel wide.
NOTE:
This option is ignored when the pen widths are set in the plot file. |
The -o raw
option allows you to send files directly to a
printer without filtering. This is sometimes required when printing
from applications that provide their own "printer drivers" for your
printer:
lp -o raw filename ENTER lpr -o raw filename ENTER
The -l
option can also be used with the lpr
command to send files directly to a printer:
lpr -l filename ENTER
This chapter describes how to save printer options for your printer and set your own default printer.
Each printer supports a large number of options, which you learned about in Chapter 3, "Standard Printer Options". Rather than specifying these options each time you print a file, CUPS allows you to save them as "default" options for the printer.
The lpoptions(1)
command saves the options for your
printers. Like the lp
and lpr
commands, it
accepts printer options using the -o
argument:
lpoptions -o prettyprint ENTER lpoptions -o media=A4 -o sides=two-sided-long-edge ENTER lpoptions -o media=Legal -o scaling=100 ENTER
Once saved, any lp
or lpr
command will use
them when you print.
Note:
Running the |
The previous example shows how to set the options for the default
printer. The -p printer
option specifies the options are
for another printer:
lpoptions -p laserjet -o prettyprint ENTER lpoptions -p laserjet -o media=A4 -o sides=two-sided-long-edge ENTER lpoptions -p deskjet -o media=Legal -o scaling=100 ENTER
The previous two examples shows how to set options for the default
and a specific printer. Below, shows you how to remove the saved option
using the -r
argument:
lpoptions -r prettyprint ENTER lpoptions -p laserjet -r prettyprint ENTER
The lpoptions
command can also be used to show the
current options by not specifying any new options on the command-line:
lpoptions ENTER media=A4 sides=two-sided-long-edge lpoptions -p deskjet ENTER media=Legal scaling=100
You can display the supported options using the lpoptions
command with the -l
option, as follows:
lpoptions -p laserjet -l ENTER
The administrator normally will set a system-wide default printer
that is normally used as the default printer by everyone. Use the
-d printer
option to set your own default printer:
lpoptions -d deskjet ENTER
The printer can be local (deskjet
) or remote (
deskjet@server
).
Besides setting options for each print queue, CUPS supports
printer instances which allow you to define several different sets
of options for each printer. You specify a printer instance using the
slash (/
) character:
lpoptions -p laserjet/duplex -o sides=two-sided-long-edge ENTER lpoptions -p laserjet/legal -o media=Legal ENTER
The lp
and lpr
commands also understand
this notation:
lp -d laserjet/duplex filename ENTER lpr -P laserjet/legal filename ENTER
Use the -x printer/instance
option to remove a printer
instance that you no longer need:
lpoptions -x laserjet ENTER lpoptions -x laserjet/duplex ENTER lpoptions -x laserjet/legal ENTER
The -x
option only removes the default options for that
printer and instance; the original print queue will remain until
deleted with the lpadmin(8)
command by the administrator.
Copyright 1997-2005 by Easy Software Products
44141 AIRPORT VIEW DR STE 204
HOLLYWOOD, MARYLAND 20636 USA
Voice: +1.301.373.9600
Email: cups-info@cups.org
WWW: http://www.cups.org
The Common UNIX Printing SystemTM, ("CUPSTM"), is provided under the GNU General Public License ("GPL") and GNU Library General Public License ("LGPL"), Version 2, with exceptions for Apple operating systems and the OpenSSL toolkit. A copy of the exceptions and licenses follow this introduction.
The GNU LGPL applies to the CUPS API library, located in the "cups" subdirectory of the CUPS source distribution and in the "cups" include directory and library files in the binary distributions. The GNU GPL applies to the remainder of the CUPS distribution, including the "pdftops" filter which is based upon Xpdf and the CUPS imaging library.
For those not familiar with the GNU GPL, the license basically allows you to:
What this license does not allow you to do is make changes or add features to CUPS and then sell a binary distribution without source code. You must provide source for any new drivers, changes, or additions to the software, and all code must be provided under the GPL or LGPL as appropriate. The only exceptions to this are the portions of the CUPS software covered by the Apple operating system license exceptions outlined later in this license agreement.
The GNU LGPL relaxes the "link-to" restriction, allowing you to develop applications that use the CUPS API library under other licenses and/or conditions as appropriate for your application.
In addition, as the copyright holder of CUPS, Easy Software Products grants the following special exceptions:
This file is subject to the Apple OS-Developed Software exception.
No developer is required to provide these exceptions in a derived work.
Easy Software Products has trademarked the Common UNIX Printing System, CUPS, and CUPS logo. You may use these names and logos in any direct port or binary distribution of CUPS. Please contact Easy Software Products for written permission to use them in derivative products. Our intention is to protect the value of these trademarks and ensure that any derivative product meets the same high-quality standards as the original.
Easy Software Products also sells rights to the CUPS source code under a binary distribution license for vendors that are unable to release source code for their drivers, additions, and modifications to CUPS under the GNU GPL and LGPL. For information please contact us at the address shown above.
The Common UNIX Printing System provides a "pdftops" filter that is based on the Xpdf software. For binary distribution licensing of this software, please contact:
Derek B. Noonburg
Email: derekn@foolabs.com
WWW: http://www.foolabs.com/xpdf/
Easy Software Products sells software support for CUPS as well as a commercial printing product based on CUPS called ESP Print Pro. You can find out more at our web site:
http://www.easysw.com/
Version 2, June 1991
Copyright 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.
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.
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.
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.
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.
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.
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.
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.
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 an idea of what it does. Copyright (C) yyyy 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
Version 2, June 1991
Copyright (C) 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. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.]
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 library, or if you modify it.
For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license.
The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such.
Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library.
Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one.
0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library.
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library.
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 Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library.
In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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.
If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. 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.
It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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.
9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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.
11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library.
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.
12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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.
13. The Free Software Foundation may publish revised and/or new versions of the Library 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).
To apply these terms, attach the following notices to the library. 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 library's name and an idea of what it does. Copyright (C) year name of author This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; 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.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. signature of Ty Coon, 1 April 1990 Ty Coon, President of Vice
That's all there is to it!