From b95efca9ce97ea92a078952b5c1a7f7d95fd6462 Mon Sep 17 00:00:00 2001 From: CentOS Buildsys Date: Nov 08 2013 13:19:36 +0000 Subject: import cups-filters-1.0.35-11.el7.src.rpm --- diff --git a/.cups-filters.metadata b/.cups-filters.metadata new file mode 100644 index 0000000..a5a761e --- /dev/null +++ b/.cups-filters.metadata @@ -0,0 +1 @@ +969e4efc14a33816f3d81a4afd3b5b0d52a6f769 SOURCES/cups-filters-1.0.35.tar.xz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/cups-browsed.service b/SOURCES/cups-browsed.service new file mode 100644 index 0000000..144956c --- /dev/null +++ b/SOURCES/cups-browsed.service @@ -0,0 +1,10 @@ +[Unit] +Description=Make remote CUPS printers available locally +After=cups.service avahi-daemon.service +Wants=cups.service avahi-daemon.service + +[Service] +ExecStart=/usr/sbin/cups-browsed + +[Install] +WantedBy=multi-user.target diff --git a/SOURCES/cups-filters-filter-costs.patch b/SOURCES/cups-filters-filter-costs.patch new file mode 100644 index 0000000..750c92c --- /dev/null +++ b/SOURCES/cups-filters-filter-costs.patch @@ -0,0 +1,59 @@ +diff -up cups-filters-1.0.35/mime/cupsfilters.convs.filter-costs cups-filters-1.0.35/mime/cupsfilters.convs +--- cups-filters-1.0.35/mime/cupsfilters.convs.filter-costs 2013-06-25 18:34:40.000000000 +0100 ++++ cups-filters-1.0.35/mime/cupsfilters.convs 2013-08-21 12:47:45.133967497 +0100 +@@ -42,32 +42,32 @@ + # if it comes from an encrypted PDF file, we simply override pstopdf and the + # PDF workflow. + +-application/postscript application/pdf 100 pstopdf ++application/postscript application/pdf 0 pstopdf + application/vnd.adobe-reader-postscript application/vnd.cups-postscript 66 pstops + + application/pdf application/vnd.cups-pdf 66 pdftopdf +-application/x-cshell application/pdf 0 texttopdf +-application/x-csource application/pdf 0 texttopdf +-application/x-perl application/pdf 0 texttopdf +-application/x-shell application/pdf 0 texttopdf +-text/plain application/pdf 0 texttopdf +-text/html application/pdf 0 texttopdf +-image/gif application/vnd.cups-pdf 33 imagetopdf +-image/png application/vnd.cups-pdf 33 imagetopdf +-image/jpeg application/vnd.cups-pdf 33 imagetopdf +-image/tiff application/vnd.cups-pdf 33 imagetopdf +-image/x-bitmap application/vnd.cups-pdf 33 imagetopdf +-image/x-photocd application/vnd.cups-pdf 33 imagetopdf +-image/x-portable-anymap application/vnd.cups-pdf 33 imagetopdf +-image/x-portable-bitmap application/vnd.cups-pdf 33 imagetopdf +-image/x-portable-graymap application/vnd.cups-pdf 33 imagetopdf +-image/x-portable-pixmap application/vnd.cups-pdf 33 imagetopdf +-image/x-sgi-rgb application/vnd.cups-pdf 33 imagetopdf +-image/x-xbitmap application/vnd.cups-pdf 33 imagetopdf +-image/x-xpixmap application/vnd.cups-pdf 33 imagetopdf +-image/x-xwindowdump application/vnd.cups-pdf 33 imagetopdf +-image/x-sun-raster application/vnd.cups-pdf 33 imagetopdf +-application/vnd.cups-pdf-banner application/pdf 33 bannertopdf ++application/x-cshell application/pdf 32 texttopdf ++application/x-csource application/pdf 32 texttopdf ++application/x-perl application/pdf 32 texttopdf ++application/x-shell application/pdf 32 texttopdf ++text/plain application/pdf 32 texttopdf ++text/html application/pdf 32 texttopdf ++image/gif application/vnd.cups-pdf 65 imagetopdf ++image/png application/vnd.cups-pdf 65 imagetopdf ++image/jpeg application/vnd.cups-pdf 65 imagetopdf ++image/tiff application/vnd.cups-pdf 65 imagetopdf ++image/x-bitmap application/vnd.cups-pdf 65 imagetopdf ++image/x-photocd application/vnd.cups-pdf 65 imagetopdf ++image/x-portable-anymap application/vnd.cups-pdf 65 imagetopdf ++image/x-portable-bitmap application/vnd.cups-pdf 65 imagetopdf ++image/x-portable-graymap application/vnd.cups-pdf 65 imagetopdf ++image/x-portable-pixmap application/vnd.cups-pdf 65 imagetopdf ++image/x-sgi-rgb application/vnd.cups-pdf 65 imagetopdf ++image/x-xbitmap application/vnd.cups-pdf 65 imagetopdf ++image/x-xpixmap application/vnd.cups-pdf 65 imagetopdf ++image/x-xwindowdump application/vnd.cups-pdf 65 imagetopdf ++image/x-sun-raster application/vnd.cups-pdf 65 imagetopdf ++application/vnd.cups-pdf-banner application/pdf 32 bannertopdf + image/urf application/pdf 0 urftopdf + + ######################################################################## diff --git a/SOURCES/cups-filters-format-mismatch.patch b/SOURCES/cups-filters-format-mismatch.patch new file mode 100644 index 0000000..ffe0f84 --- /dev/null +++ b/SOURCES/cups-filters-format-mismatch.patch @@ -0,0 +1,71 @@ +diff -up cups-filters-1.0.35/filter/pdfutils.c.format-mismatch cups-filters-1.0.35/filter/pdfutils.c +--- cups-filters-1.0.35/filter/pdfutils.c.format-mismatch 2013-10-01 12:22:16.244383288 +0100 ++++ cups-filters-1.0.35/filter/pdfutils.c 2013-10-01 12:24:05.510864420 +0100 +@@ -242,7 +242,7 @@ void pdfOut_finish_pdf(pdfOut *pdf) // { + "%010d 65535 f \n", + 0,pdf->xrefsize+1,0); + for (iA=0;iAxrefsize;iA++) { +- pdfOut_printf(pdf,"%010d 00000 n \n", ++ pdfOut_printf(pdf,"%010ld 00000 n \n", + pdf->xref[iA]); + } + pdfOut_printf(pdf,"trailer\n" +@@ -347,7 +347,7 @@ int pdfOut_write_font(pdfOut *pdf,EMB_PA + const int l0_obj=pdfOut_add_xref(pdf); + assert(l0_obj==ff_obj+1); + pdfOut_printf(pdf,"%d 0 obj\n" +- "%d\n" ++ "%ld\n" + "endobj\n" + ,l0_obj,streamsize); + +diff -up cups-filters-1.0.35/filter/pdfutils.h.format-mismatch cups-filters-1.0.35/filter/pdfutils.h +--- cups-filters-1.0.35/filter/pdfutils.h.format-mismatch 2012-06-22 17:10:47.000000000 +0100 ++++ cups-filters-1.0.35/filter/pdfutils.h 2013-10-01 12:07:07.393378641 +0100 +@@ -42,7 +42,8 @@ void pdfOut_finish_pdf(pdfOut *pdf); + /* General output routine for our pdf. + * Keeps track of characters actually written out + */ +-void pdfOut_printf(pdfOut *pdf,const char *fmt,...); ++void pdfOut_printf(pdfOut *pdf,const char *fmt,...) ++ __attribute__((format(printf, 2, 3))); + + /* write out an escaped pdf string: e.g. (Text \(Test\)\n) + * >len==-1: use strlen(str) +diff -up cups-filters-1.0.35/filter/texttopdf.c.format-mismatch cups-filters-1.0.35/filter/texttopdf.c +--- cups-filters-1.0.35/filter/texttopdf.c.format-mismatch 2013-10-01 12:24:41.218021702 +0100 ++++ cups-filters-1.0.35/filter/texttopdf.c 2013-10-01 12:24:41.863024579 +0100 +@@ -250,7 +250,7 @@ WritePage(void) + int len_obj=pdfOut_add_xref(pdf); + assert(len_obj==content+1); + pdfOut_printf(pdf,"%d 0 obj\n" +- "%d\n" ++ "%ld\n" + "endobj\n", + len_obj,size); + +diff -up cups-filters-1.0.35/fontembed/dynstring.h.format-mismatch cups-filters-1.0.35/fontembed/dynstring.h +--- cups-filters-1.0.35/fontembed/dynstring.h.format-mismatch 2012-06-22 17:10:47.000000000 +0100 ++++ cups-filters-1.0.35/fontembed/dynstring.h 2013-10-01 12:07:07.393378641 +0100 +@@ -9,7 +9,8 @@ typedef struct { + int dyn_init(DYN_STRING *ds,int reserve_size); // -1 on error + void dyn_free(DYN_STRING *ds); + int dyn_ensure(DYN_STRING *ds,int free_space); +-int dyn_printf(DYN_STRING *ds,const char *fmt,...); // appends ++int dyn_printf(DYN_STRING *ds,const char *fmt,...) // appends ++ __attribute__((format(printf, 2, 3))); + + #endif + +diff -up cups-filters-1.0.35/fontembed/embed_sfnt.c.format-mismatch cups-filters-1.0.35/fontembed/embed_sfnt.c +--- cups-filters-1.0.35/fontembed/embed_sfnt.c.format-mismatch 2013-10-01 12:25:24.164210823 +0100 ++++ cups-filters-1.0.35/fontembed/embed_sfnt.c 2013-10-01 12:25:39.727279359 +0100 +@@ -519,7 +519,7 @@ int emb_otf_ps(OTF_FILE *otf,unsigned sh + free(ds.buf); + return -1; + } +- dyn_printf(&ds,"%!PS-TrueTypeFont-%d-%d\n", ++ dyn_printf(&ds,"%%!PS-TrueTypeFont-%d-%d\n", + otf->version,get_ULONG(head+4)); + const int bbxmin=get_SHORT(head+36)*1000/otf->unitsPerEm, + bbymin=get_SHORT(head+38)*1000/otf->unitsPerEm, diff --git a/SOURCES/cups-filters-lookup.patch b/SOURCES/cups-filters-lookup.patch new file mode 100644 index 0000000..95ed1bd --- /dev/null +++ b/SOURCES/cups-filters-lookup.patch @@ -0,0 +1,27 @@ +diff -up cups-filters-1.0.34/utils/cups-browsed.c.lookup cups-filters-1.0.34/utils/cups-browsed.c +--- cups-filters-1.0.34/utils/cups-browsed.c.lookup 2013-06-26 16:23:38.000000000 +0200 ++++ cups-filters-1.0.34/utils/cups-browsed.c 2013-06-26 16:24:28.491804795 +0200 +@@ -990,23 +990,6 @@ found_cups_printer (const char *remote_h + debug_printf("cups-browsed: browsed queue name is %s\n", + local_resource + 9); + +- /* Does the host need resolving? */ +- if (host[strspn (host, "0123456789.")] == '\0') { +- /* Yes. Resolve it. */ +- struct addrinfo hints, *addr; +- memset(&hints, 0, sizeof(struct addrinfo)); +- hints.ai_family = AF_UNSPEC; +- hints.ai_socktype = SOCK_DGRAM; +- hints.ai_flags = 0; +- hints.ai_protocol = 0; +- if (!getaddrinfo (host, NULL, &hints, &addr)) { +- getnameinfo (addr->ai_addr, addr->ai_addrlen, +- host, sizeof(host), +- NULL, 0, 0); +- freeaddrinfo (addr); +- } +- } +- + generate_local_queue(host, port, local_resource, info ? info : "", "", ""); + } + diff --git a/SOURCES/cups-filters-man.patch b/SOURCES/cups-filters-man.patch new file mode 100644 index 0000000..efc5011 --- /dev/null +++ b/SOURCES/cups-filters-man.patch @@ -0,0 +1,179 @@ +diff -up cups-filters-1.0.35/Makefile.am.man cups-filters-1.0.35/Makefile.am +--- cups-filters-1.0.35/Makefile.am.man 2013-05-15 20:46:22.000000000 +0200 ++++ cups-filters-1.0.35/Makefile.am 2013-07-01 14:03:58.395572035 +0200 +@@ -618,7 +618,6 @@ EXTRA_DIST += \ + # UTILS + # ===== + +-EXTRA_DIST += utils/cups-browsed.in + sbin_PROGRAMS = \ + cups-browsed + cups_browsed_SOURCES = \ +@@ -636,6 +635,11 @@ cups_browsed_LDADD = \ + $(GLIB_LIBS) + initrcdir = $(INITDDIR) + initrc_SCRIPTS = utils/cups-browsed ++man_MANS = \ ++ utils/cups-browsed.8 \ ++ utils/cups-browsed.conf.5 ++EXTRA_DIST += utils/cups-browsed.in \ ++ $(man_MANS) + + # === + # PPD +diff -up cups-filters-1.0.35/utils/cups-browsed.8.man cups-filters-1.0.35/utils/cups-browsed.8 +--- cups-filters-1.0.35/utils/cups-browsed.8.man 2013-07-01 14:03:58.404571910 +0200 ++++ cups-filters-1.0.35/utils/cups-browsed.8 2013-07-01 14:03:58.404571910 +0200 +@@ -0,0 +1,56 @@ ++.\"Text automatically generated by txt2man ++.TH cups-browsed 8 "29 June 2013" "" "" ++.SH NAME ++\fBcups-browsed \fP- A daemon for browsing the Bonjour broadcasts of shared, remote CUPS printers ++\fB ++.SH SYNOPSIS ++.nf ++.fam C ++\fBcups-browsed\fP [\fB-v\fP | \fB-d\fP | \fB--debug\fP] ++ ++.fam T ++.fi ++.fam T ++.fi ++.SH DESCRIPTION ++\fBcups-browsed\fP has three independently switchable functions: ++.IP 1. 4 ++Browse Bonjour broadcasts of remote printers and create/remove local ++raw queues pointing to these printers. ++.IP 2. 4 ++Browse CUPS broadcasts of remote printers and create/remove local raw ++queues pointing to these printers. ++.IP 3. 4 ++Broadcast local queues with the CUPS protocol. ++.SH OPTIONS ++.TP ++.B ++\fB-v\fP, \fB-d\fP, \fB--debug\fP ++Debug mode ++.SH FILES ++/etc/cups/cups-browsed.conf ++.SH NOTES ++Please take references to cups 1.6.x to include newer versions. ++Similarily, cups 1.5.x is intended to encompass older versions too. ++.PP ++In environments with only cups 1.6.x servers and clients (plus ++\fBcups-browsed\fP on either server or client or both) the function described in 1. ++enables the automatic discovery of remote queues and their display in ++printing dialogues of applications and with command line tools. ++.PP ++The facility provided by 3. means that servers running cups 1.6.x plus ++\fBcups-browsed\fP can broadcast their local queues so that clients with cups ++1.5.x get these queues automatically available. The outcome of 2. is ++that clients running cups 1.6.x plus \fBcups-browsed\fP can use the CUPS ++broadcasts from servers with cups 1.5.x. As with browsing of Bonjour ++broadcasts, the created local raw queues are available to applications ++and command line tools. ++.SH SEE ALSO ++ ++\fBcups-browsed.conf\fP(5) ++.PP ++/usr/share/doc/\fBcups-filters\fP/README ++.SH AUTHOR ++The authors of \fBcups-browsed\fP are listed in /usr/share/doc/\fBcups-filters\fP/AUTHORS. ++.PP ++This manual page was written for the Debian Project, but it may be used by others. +diff -up cups-filters-1.0.35/utils/cups-browsed.conf.5.man cups-filters-1.0.35/utils/cups-browsed.conf.5 +--- cups-filters-1.0.35/utils/cups-browsed.conf.5.man 2013-07-01 14:03:58.404571910 +0200 ++++ cups-filters-1.0.35/utils/cups-browsed.conf.5 2013-07-01 14:03:58.404571910 +0200 +@@ -0,0 +1,92 @@ ++.\"Text automatically generated by txt2man ++.TH cups-browsed.conf 5 "29 June 2013" "" "" ++.SH NAME ++\fBcups-browsed.conf \fP- server configuration file for cups-browsed ++\fB ++.SH DESCRIPTION ++The cups-browsed.conf file configures the cups-browsed daemon. It is normally ++located in the /etc/cups directory. Each line in the file can be a ++configuration directive, a blank line, or a comment. Comment lines start ++with the # character. ++.SH DIRECTIVES ++ ++The BrowseAllow directive specifies a system or network to accept ++CUPS browse packets from. The default is to accept browse packets from ++all hosts when BrowseRemoteProtocols uses the CUPS protocol. ++.PP ++.nf ++.fam C ++ BrowseAllow 192.168.7.20 ++ BrowseAllow 192.168.7.0/24 ++ BrowseAllow 192.168.7.0/255.255.255.0 ++ ++ ++.fam T ++.fi ++The BrowsePoll directive polls a server for available printers once ++every 60 seconds. Multiple BrowsePoll directives can be specified ++to poll multiple servers. The default port to connect to is 631. ++BrowsePoll works independently of whether CUPS browsing is activated ++in BrowseRemoteProtocols. ++.PP ++.nf ++.fam C ++ BrowsePoll 192.168.7.20 ++ BrowsePoll 192.168.7.65:631 ++ BrowsePoll host.example.com:631 ++ ++ ++.fam T ++.fi ++The BrowseLocalProtocols directive specifies the protocols to use ++when advertising local shared printers on the network. The default ++is "none". Control of advertising of local shared printers using ++dnssd is done in /etc/cups/cupsd.conf. ++.PP ++.nf ++.fam C ++ BrowseLocalProtocols none ++ BrowseLocalProtocols CUPS ++ ++ ++.fam T ++.fi ++The BrowseRemoteProtocols directive specifies the protocols to use ++when finding remote shared printers on the network. Multiple ++protocols can be specified by separating them with spaces. ++The default is "dnssd cups". ++.PP ++.nf ++.fam C ++ BrowseRemoteProtocols none ++ BrowseRemoteProtocols CUPS dnssd ++ BrowseRemoteProtocols CUPS ++ BrowseRemoteProtocols dnssd ++ ++.fam T ++.fi ++The BrowseProtocols directive specifies the protocols to use when ++finding remote shared printers on the network and advertising local ++shared printers. "dnssd" is ignored for BrowseLocalProtocols. Multiple ++protocols can be specified by separating them with spaces. The ++default is "none" for BrowseLocalProtocols and "dnssd cups" for ++BrowseRemoteProtocols. ++.PP ++.nf ++.fam C ++ BrowseProtocols none ++ BrowseProtocols CUPS dnssd ++ BrowseProtocols CUPS ++ BrowseProtocols dnssd ++ ++.fam T ++.fi ++.SH SEE ALSO ++ ++\fBcups-browsed\fP(8) ++.PP ++/usr/share/doc/cups-filters/README ++.SH AUTHOR ++The authors of cups-browsed are listed in /usr/share/doc/cups-filters/AUTHORS. ++.PP ++This manual page was written for the Debian Project, but it may be used by others. diff --git a/SOURCES/cups-filters-page-label.patch b/SOURCES/cups-filters-page-label.patch new file mode 100644 index 0000000..2008e99 --- /dev/null +++ b/SOURCES/cups-filters-page-label.patch @@ -0,0 +1,229 @@ +diff -up cups-filters-1.0.35/filter/pdftopdf/pdftopdf.cc.page-label cups-filters-1.0.35/filter/pdftopdf/pdftopdf.cc +--- cups-filters-1.0.35/filter/pdftopdf/pdftopdf.cc.page-label 2013-04-09 19:14:42.000000000 +0100 ++++ cups-filters-1.0.35/filter/pdftopdf/pdftopdf.cc 2013-07-24 08:49:23.919081384 +0100 +@@ -9,6 +9,8 @@ + #include + #include + #include ++#include ++#include + #include + + #include "pdftopdf_processor.h" +@@ -402,8 +404,27 @@ void getParameters(ppd_file_t *ppd,int n + param.reverse=ppdDefaultOrder(ppd); + } + +- // TODO: pageLabel (not used) +- // param.pageLabel=cupsGetOption("page-label",num_options,options); // strdup? ++ std::string rawlabel; ++ char *classification = getenv("CLASSIFICATION"); ++ if (classification) ++ rawlabel.append (classification); ++ ++ if ( (val=cupsGetOption("page-label", num_options, options)) != NULL) { ++ if (!rawlabel.empty()) ++ rawlabel.append (" - "); ++ rawlabel.append(cupsGetOption("page-label",num_options,options)); ++ } ++ ++ std::ostringstream cookedlabel; ++ for (std::string::iterator it = rawlabel.begin(); ++ it != rawlabel.end (); ++ ++it) { ++ if (*it < 32 || *it > 126) ++ cookedlabel << "\\" << std::oct << std::setfill('0') << std::setw(3) << (unsigned int) *it; ++ else ++ cookedlabel.put (*it); ++ } ++ param.pageLabel = cookedlabel.str (); + + if ( (val=cupsGetOption("page-set",num_options,options)) != NULL) { + if (strcasecmp(val,"even")==0) { +diff -up cups-filters-1.0.35/filter/pdftopdf/pdftopdf_processor.cc.page-label cups-filters-1.0.35/filter/pdftopdf/pdftopdf_processor.cc +--- cups-filters-1.0.35/filter/pdftopdf/pdftopdf_processor.cc.page-label 2013-02-15 17:37:59.000000000 +0000 ++++ cups-filters-1.0.35/filter/pdftopdf/pdftopdf_processor.cc 2013-07-24 09:50:04.437720618 +0100 +@@ -80,12 +80,8 @@ void ProcessingParameters::dump() const + fprintf(stderr,"evenDuplex: %s\n", + (evenDuplex)?"true":"false"); + +-/* +- // std::string pageLabel; // or NULL? must stay/dup! +- ... +- ... +- +-*/ ++ fprintf(stderr,"pageLabel: %s\n", ++ pageLabel.empty () ? "(none)" : pageLabel.c_str()); + + fprintf(stderr,"bookletMode: "); + BookletMode_dump(booklet); +@@ -206,6 +202,10 @@ bool processPDFTOPDF(PDFTOPDF_Processor + page->mirror(); + } + ++ if (!param.pageLabel.empty()) { ++ page->add_label(param.page, param.pageLabel); ++ } ++ + // place border + if ( (param.border!=BorderType::NONE)&&(iAadd_border_rect(rect,param.border,1.0/pgedit.scale); + } + ++ if (!param.pageLabel.empty()) { ++ page->add_label(param.page, param.pageLabel); ++ } ++ + if (!param.fitplot) { + curpage->add_subpage(page,pgedit.xpos+xpos,pgedit.ypos+ypos,pgedit.scale,&rect); + } else { +diff -up cups-filters-1.0.35/filter/pdftopdf/pdftopdf_processor.h.page-label cups-filters-1.0.35/filter/pdftopdf/pdftopdf_processor.h +--- cups-filters-1.0.35/filter/pdftopdf/pdftopdf_processor.h.page-label 2012-11-15 15:58:39.000000000 +0000 ++++ cups-filters-1.0.35/filter/pdftopdf/pdftopdf_processor.h 2013-07-24 08:49:23.920081389 +0100 +@@ -20,7 +20,7 @@ struct ProcessingParameters { + border(NONE), + reverse(false), + +-// pageLabel(NULL), ++ pageLabel(), + evenPages(true),oddPages(true), + + mirror(false), +@@ -60,7 +60,7 @@ struct ProcessingParameters { + NupParameters nup; + bool reverse; + +- // std::string pageLabel; // or NULL? must stay/dup! ++ std::string pageLabel; + bool evenPages,oddPages; + IntervalSet pageRange; + +@@ -105,6 +105,7 @@ public: + virtual void add_subpage(const std::shared_ptr &sub,float xpos,float ypos,float scale,const PageRect *crop=NULL) =0; + virtual void mirror() =0; + virtual void rotate(Rotation rot) =0; ++ virtual void add_label(const PageRect &rect, const std::string label) =0; + }; + + // TODO: ... error output? +diff -up cups-filters-1.0.35/filter/pdftopdf/qpdf_pdftopdf_processor.cc.page-label cups-filters-1.0.35/filter/pdftopdf/qpdf_pdftopdf_processor.cc +--- cups-filters-1.0.35/filter/pdftopdf/qpdf_pdftopdf_processor.cc.page-label 2013-03-14 20:32:42.000000000 +0000 ++++ cups-filters-1.0.35/filter/pdftopdf/qpdf_pdftopdf_processor.cc 2013-07-24 08:49:23.920081389 +0100 +@@ -257,6 +257,94 @@ void QPDF_PDFTOPDF_PageHandle::rotate(Ro + } + // }}} + ++void QPDF_PDFTOPDF_PageHandle::add_label(const PageRect &_rect, const std::string label) // {{{ ++{ ++ assert(isExisting()); ++ ++ PageRect rect = ungetRect (_rect, *this, rotation, page); ++ ++ assert (rect.left <= rect.right); ++ assert (rect.bottom <= rect.top); ++ ++ // TODO: Only add in the font once, not once per page. ++ QPDFObjectHandle font = page.getOwningQPDF()->makeIndirectObject ( ++ QPDFObjectHandle::parse( ++ "<<" ++ " /Type /Font" ++ " /Subtype /Type1" ++ " /Name /pagelabel-font" ++ " /BaseFont /Helvetica" // TODO: support UTF-8 labels? ++ ">>")); ++ QPDFObjectHandle resources = page.getKey ("/Resources"); ++ QPDFObjectHandle rfont = resources.getKey ("/Font"); ++ rfont.replaceKey ("/pagelabel-font", font); ++ ++ double margin = 2.25; ++ double height = 12; ++ ++ std::string boxcmd = "q\n"; ++ ++ // White filled rectangle (top) ++ boxcmd += " 1 1 1 rg\n"; ++ boxcmd += " " + QUtil::double_to_string(rect.left + margin) + " " + ++ QUtil::double_to_string(rect.top - height - 2 * margin) + " " + ++ QUtil::double_to_string(rect.right - rect.left - 2 * margin) + " " + ++ QUtil::double_to_string(height + 2 * margin) + " re f\n"; ++ ++ // White filled rectangle (bottom) ++ boxcmd += " " + QUtil::double_to_string(rect.left + margin) + " " + ++ QUtil::double_to_string(rect.bottom + height + margin) + " " + ++ QUtil::double_to_string(rect.right - rect.left - 2 * margin) + " " + ++ QUtil::double_to_string(height + 2 * margin) + " re f\n"; ++ ++ // Black outline (top) ++ boxcmd += " 0 0 0 RG\n"; ++ boxcmd += " " + QUtil::double_to_string(rect.left + margin) + " " + ++ QUtil::double_to_string(rect.top - height - 2 * margin) + " " + ++ QUtil::double_to_string(rect.right - rect.left - 2 * margin) + " " + ++ QUtil::double_to_string(height + 2 * margin) + " re S\n"; ++ ++ // Black outline (bottom) ++ boxcmd += " " + QUtil::double_to_string(rect.left + margin) + " " + ++ QUtil::double_to_string(rect.bottom + height + margin) + " " + ++ QUtil::double_to_string(rect.right - rect.left - 2 * margin) + " " + ++ QUtil::double_to_string(height + 2 * margin) + " re S\n"; ++ ++ // Black text (top) ++ boxcmd += " 0 0 0 rg\n"; ++ boxcmd += " BT\n"; ++ boxcmd += " /pagelabel-font 12 Tf\n"; ++ boxcmd += " " + QUtil::double_to_string(rect.left + 2 * margin) + " " + ++ QUtil::double_to_string(rect.top - height - margin) + " Td\n"; ++ boxcmd += " (" + label + ") Tj\n"; ++ boxcmd += " ET\n"; ++ ++ // Black text (bottom) ++ boxcmd += " BT\n"; ++ boxcmd += " /pagelabel-font 12 Tf\n"; ++ boxcmd += " " + QUtil::double_to_string(rect.left + 2 * margin) + " " + ++ QUtil::double_to_string(rect.bottom + height + 2 * margin) + " Td\n"; ++ boxcmd += " (" + label + ") Tj\n"; ++ boxcmd += " ET\n"; ++ ++ boxcmd += "Q\n"; ++ ++ assert(page.getOwningQPDF()); // existing pages are always indirect ++ static const char *pre="%pdftopdf q\n" ++ "q\n", ++ *post="%pdftopdf Q\n" ++ "Q\n"; ++ ++ QPDFObjectHandle stm1=QPDFObjectHandle::newStream(page.getOwningQPDF(), ++ pre), ++ stm2=QPDFObjectHandle::newStream(page.getOwningQPDF(), ++ std::string(post) + boxcmd); ++ ++ page.addPageContents(stm1,true); // before ++ page.addPageContents(stm2,false); // after ++} ++// }}} ++ + void QPDF_PDFTOPDF_PageHandle::debug(const PageRect &rect,float xpos,float ypos) // {{{ + { + assert(!isExisting()); +@@ -264,7 +352,7 @@ void QPDF_PDFTOPDF_PageHandle::debug(con + } + // }}} + +- ++// }}} + void QPDF_PDFTOPDF_Processor::closeFile() // {{{ + { + pdf.reset(); +diff -up cups-filters-1.0.35/filter/pdftopdf/qpdf_pdftopdf_processor.h.page-label cups-filters-1.0.35/filter/pdftopdf/qpdf_pdftopdf_processor.h +--- cups-filters-1.0.35/filter/pdftopdf/qpdf_pdftopdf_processor.h.page-label 2012-11-15 15:58:39.000000000 +0000 ++++ cups-filters-1.0.35/filter/pdftopdf/qpdf_pdftopdf_processor.h 2013-07-24 08:49:23.920081389 +0100 +@@ -11,6 +11,7 @@ public: + virtual void add_subpage(const std::shared_ptr &sub,float xpos,float ypos,float scale,const PageRect *crop=NULL); + virtual void mirror(); + virtual void rotate(Rotation rot); ++ virtual void add_label(const PageRect &rect, const std::string label); + + void debug(const PageRect &rect,float xpos,float ypos); + private: diff --git a/SOURCES/cups-filters-pdf-landscape.patch b/SOURCES/cups-filters-pdf-landscape.patch new file mode 100644 index 0000000..1f4cf3e --- /dev/null +++ b/SOURCES/cups-filters-pdf-landscape.patch @@ -0,0 +1,29 @@ +diff -up cups-filters-1.0.35/filter/pdftops.c.pdf-landscape cups-filters-1.0.35/filter/pdftops.c +--- cups-filters-1.0.35/filter/pdftops.c.pdf-landscape 2013-06-24 22:59:27.000000000 +0100 ++++ cups-filters-1.0.35/filter/pdftops.c 2013-10-16 15:53:51.766917387 +0100 +@@ -626,21 +626,17 @@ main(int argc, /* I - Number of comm + else if ((renderer == PDFTOPS) || (renderer == PDFTOCAIRO)) + { + /* +- * Use the page sizes of the original PDF document, this way documents +- * which contain pages of different sizes can be printed correctly ++ * No options to add. Note: pdftopdf has already rotated pages ++ * for us. + */ +- +- pdf_argv[pdf_argc++] = (char *)"-origpagesizes"; + } + #endif /* HAVE_POPPLER_PDFTOPS_WITH_ORIGPAGESIZES */ + else if (renderer == ACROREAD) + { + /* +- * Use the page sizes of the original PDF document, this way documents +- * which contain pages of different sizes can be printed correctly ++ * No options to add. Note: pdftopdf has already rotated pages ++ * for us. + */ +- +- pdf_argv[pdf_argc++] = (char *)"-choosePaperByPDFPageSize"; + } + + /* diff --git a/SOURCES/cups-filters-pdftoopvp.patch b/SOURCES/cups-filters-pdftoopvp.patch new file mode 100644 index 0000000..66d3dc1 --- /dev/null +++ b/SOURCES/cups-filters-pdftoopvp.patch @@ -0,0 +1,160 @@ +diff -up cups-filters-1.0.35/Makefile.am.pdftoopvp cups-filters-1.0.35/Makefile.am +--- cups-filters-1.0.35/Makefile.am.pdftoopvp 2013-11-08 12:47:26.064965281 +0000 ++++ cups-filters-1.0.35/Makefile.am 2013-11-08 12:48:16.015201539 +0000 +@@ -302,10 +302,7 @@ EXTRA_DIST += \ + # PDF to OPVP + # =========== + pkgfilterdir = $(CUPS_SERVERBIN)/filter +-pkgfilter_PROGRAMS = pdftoopvp +- +-pkgfontconfigdir = $(sysconfdir)/$(FONTDIR) +-pkgfontconfig_DATA = filter/pdftoopvp/99pdftoopvp.conf ++pkgfilter_PROGRAMS = + + pdftoopvp_SOURCES = \ + filter/pdftoopvp/oprs/OPRS.cxx \ +@@ -348,8 +345,6 @@ pdftoopvp_LDADD = \ + $(POPPLER_LIBS) \ + $(DLOPEN_LIBS) + +-EXTRA_DIST += $(pkgfontconfig_DATA) +- + # ========== + # PDF to PDF + # ========== +diff -up cups-filters-1.0.35/Makefile.in.pdftoopvp cups-filters-1.0.35/Makefile.in +--- cups-filters-1.0.35/Makefile.in.pdftoopvp 2013-11-08 12:48:20.032220554 +0000 ++++ cups-filters-1.0.35/Makefile.in 2013-11-08 12:50:28.864829900 +0000 +@@ -62,7 +62,7 @@ check_PROGRAMS = test1284$(EXEEXT) testc + TESTS = testdither$(EXEEXT) test_analyze$(EXEEXT) test_pdf$(EXEEXT) \ + test_ps$(EXEEXT) test_pdf1$(EXEEXT) test_pdf2$(EXEEXT) + bin_PROGRAMS = ttfread$(EXEEXT) +-pkgfilter_PROGRAMS = pdftoopvp$(EXEEXT) pdftopdf$(EXEEXT) \ ++pkgfilter_PROGRAMS = pdftopdf$(EXEEXT) \ + bannertopdf$(EXEEXT) commandtoescpx$(EXEEXT) \ + commandtopclx$(EXEEXT) pdftoijs$(EXEEXT) pdftops$(EXEEXT) \ + pdftoraster$(EXEEXT) rastertoescpx$(EXEEXT) \ +@@ -132,7 +132,6 @@ am__installdirs = "$(DESTDIR)$(libdir)" + "$(DESTDIR)$(pkgcupsserverrootdir)" \ + "$(DESTDIR)$(pkgdriverdir)" \ + "$(DESTDIR)$(pkgfiltersincludedir)" \ +- "$(DESTDIR)$(pkgfontconfigdir)" \ + "$(DESTDIR)$(pkgfontembedincludedir)" \ + "$(DESTDIR)$(pkgmimedir)" "$(DESTDIR)$(pkgppdcdir)" \ + "$(DESTDIR)$(ppddir)" +@@ -448,7 +447,7 @@ am__can_run_installinfo = \ + DATA = $(doc_DATA) $(pkgbanner_DATA) $(pkgcharset_DATA) \ + $(pkgconf_DATA) $(pkgcupsdata_DATA) $(pkgcupsserverroot_DATA) \ + $(pkgdriver_DATA) $(pkgfiltersinclude_DATA) \ +- $(pkgfontconfig_DATA) $(pkgfontembedinclude_DATA) \ ++ $(pkgfontembedinclude_DATA) \ + $(pkgmime_DATA) $(pkgppdc_DATA) $(ppd_DATA) + ETAGS = etags + CTAGS = ctags +@@ -666,7 +665,7 @@ EXTRA_DIST = $(doc_DATA) autogen.sh libc + $(pkgfiltersinclude_DATA) cupsfilters/image.pgm \ + cupsfilters/image.ppm $(pkgcupsdata_DATA) $(pkgdriver_DATA) \ + $(pkgppdc_DATA) $(pkgmime_DATA) $(pkgfontembedinclude_DATA) \ +- fontembed/README $(pkgfontconfig_DATA) $(pkgfilter_SCRIPTS) \ ++ fontembed/README $(pkgfilter_SCRIPTS) \ + filter/test.sh utils/cups-browsed.in $(ppd_DATA) \ + scripting/perl scripting/php/README scripting/php/phpcups.php + +@@ -920,8 +919,6 @@ test_ps_LDADD = libfontembed.la + # PDF to OPVP + # =========== + pkgfilterdir = $(CUPS_SERVERBIN)/filter +-pkgfontconfigdir = $(sysconfdir)/$(FONTDIR) +-pkgfontconfig_DATA = filter/pdftoopvp/99pdftoopvp.conf + pdftoopvp_SOURCES = \ + filter/pdftoopvp/oprs/OPRS.cxx \ + filter/pdftoopvp/oprs/OPRS.h \ +@@ -3191,43 +3188,6 @@ uninstall-pkgfiltersincludeDATA: + @list='$(pkgfiltersinclude_DATA)'; test -n "$(pkgfiltersincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgfiltersincludedir)'; $(am__uninstall_files_from_dir) +-install-pkgfontconfigDATA: $(pkgfontconfig_DATA) +- @$(NORMAL_INSTALL) +- @list='$(pkgfontconfig_DATA)'; test -n "$(pkgfontconfigdir)" || list=; \ +- if test -n "$$list"; then \ +- echo " $(MKDIR_P) '$(DESTDIR)$(pkgfontconfigdir)'"; \ +- $(MKDIR_P) "$(DESTDIR)$(pkgfontconfigdir)" || exit 1; \ +- fi; \ +- for p in $$list; do \ +- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ +- echo "$$d$$p"; \ +- done | $(am__base_list) | \ +- while read files; do \ +- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgfontconfigdir)'"; \ +- $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgfontconfigdir)" || exit $$?; \ +- done +- +-uninstall-pkgfontconfigDATA: +- @$(NORMAL_UNINSTALL) +- @list='$(pkgfontconfig_DATA)'; test -n "$(pkgfontconfigdir)" || list=; \ +- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ +- dir='$(DESTDIR)$(pkgfontconfigdir)'; $(am__uninstall_files_from_dir) +-install-pkgfontembedincludeDATA: $(pkgfontembedinclude_DATA) +- @$(NORMAL_INSTALL) +- @list='$(pkgfontembedinclude_DATA)'; test -n "$(pkgfontembedincludedir)" || list=; \ +- if test -n "$$list"; then \ +- echo " $(MKDIR_P) '$(DESTDIR)$(pkgfontembedincludedir)'"; \ +- $(MKDIR_P) "$(DESTDIR)$(pkgfontembedincludedir)" || exit 1; \ +- fi; \ +- for p in $$list; do \ +- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ +- echo "$$d$$p"; \ +- done | $(am__base_list) | \ +- while read files; do \ +- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgfontembedincludedir)'"; \ +- $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgfontembedincludedir)" || exit $$?; \ +- done +- + uninstall-pkgfontembedincludeDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgfontembedinclude_DATA)'; test -n "$(pkgfontembedincludedir)" || list=; \ +@@ -3613,7 +3573,7 @@ all-am: Makefile $(LTLIBRARIES) $(PROGRA + install-binPROGRAMS: install-libLTLIBRARIES + + installdirs: +- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(phpextensiondir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgbackenddir)" "$(DESTDIR)$(pkgfilterdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(initrcdir)" "$(DESTDIR)$(pkgfilterdir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgbannerdir)" "$(DESTDIR)$(pkgcharsetdir)" "$(DESTDIR)$(pkgconfdir)" "$(DESTDIR)$(pkgcupsdatadir)" "$(DESTDIR)$(pkgcupsserverrootdir)" "$(DESTDIR)$(pkgdriverdir)" "$(DESTDIR)$(pkgfiltersincludedir)" "$(DESTDIR)$(pkgfontconfigdir)" "$(DESTDIR)$(pkgfontembedincludedir)" "$(DESTDIR)$(pkgmimedir)" "$(DESTDIR)$(pkgppdcdir)" "$(DESTDIR)$(ppddir)"; do \ ++ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(phpextensiondir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgbackenddir)" "$(DESTDIR)$(pkgfilterdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(initrcdir)" "$(DESTDIR)$(pkgfilterdir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgbannerdir)" "$(DESTDIR)$(pkgcharsetdir)" "$(DESTDIR)$(pkgconfdir)" "$(DESTDIR)$(pkgcupsdatadir)" "$(DESTDIR)$(pkgcupsserverrootdir)" "$(DESTDIR)$(pkgdriverdir)" "$(DESTDIR)$(pkgfiltersincludedir)" "$(DESTDIR)$(pkgfontembedincludedir)" "$(DESTDIR)$(pkgmimedir)" "$(DESTDIR)$(pkgppdcdir)" "$(DESTDIR)$(ppddir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done + install: install-am +@@ -3678,7 +3638,7 @@ install-data-am: install-docDATA install + install-pkgconfDATA install-pkgcupsdataDATA \ + install-pkgcupsserverrootDATA install-pkgdriverDATA \ + install-pkgfilterPROGRAMS install-pkgfilterSCRIPTS \ +- install-pkgfiltersincludeDATA install-pkgfontconfigDATA \ ++ install-pkgfiltersincludeDATA \ + install-pkgfontembedincludeDATA install-pkgmimeDATA \ + install-pkgppdcDATA install-ppdDATA + @$(NORMAL_INSTALL) +@@ -3737,7 +3697,7 @@ uninstall-am: uninstall-binPROGRAMS unin + uninstall-pkgconfDATA uninstall-pkgcupsdataDATA \ + uninstall-pkgcupsserverrootDATA uninstall-pkgdriverDATA \ + uninstall-pkgfilterPROGRAMS uninstall-pkgfilterSCRIPTS \ +- uninstall-pkgfiltersincludeDATA uninstall-pkgfontconfigDATA \ ++ uninstall-pkgfiltersincludeDATA \ + uninstall-pkgfontembedincludeDATA uninstall-pkgmimeDATA \ + uninstall-pkgppdcDATA uninstall-ppdDATA uninstall-sbinPROGRAMS + @$(NORMAL_INSTALL) +@@ -3766,7 +3726,7 @@ uninstall-am: uninstall-binPROGRAMS unin + install-pkgcupsdataDATA install-pkgcupsserverrootDATA \ + install-pkgdriverDATA install-pkgfilterPROGRAMS \ + install-pkgfilterSCRIPTS install-pkgfiltersincludeDATA \ +- install-pkgfontconfigDATA install-pkgfontembedincludeDATA \ ++ install-pkgfontembedincludeDATA \ + install-pkgmimeDATA install-pkgppdcDATA install-ppdDATA \ + install-ps install-ps-am install-sbinPROGRAMS install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ +@@ -3780,7 +3740,7 @@ uninstall-am: uninstall-binPROGRAMS unin + uninstall-pkgcupsdataDATA uninstall-pkgcupsserverrootDATA \ + uninstall-pkgdriverDATA uninstall-pkgfilterPROGRAMS \ + uninstall-pkgfilterSCRIPTS uninstall-pkgfiltersincludeDATA \ +- uninstall-pkgfontconfigDATA uninstall-pkgfontembedincludeDATA \ ++ uninstall-pkgfontembedincludeDATA \ + uninstall-pkgmimeDATA uninstall-pkgppdcDATA uninstall-ppdDATA \ + uninstall-sbinPROGRAMS + diff --git a/SOURCES/cups-filters-urftopdf.patch b/SOURCES/cups-filters-urftopdf.patch new file mode 100644 index 0000000..5b6c2fa --- /dev/null +++ b/SOURCES/cups-filters-urftopdf.patch @@ -0,0 +1,38 @@ +diff -up cups-filters-1.0.35/Makefile.am.urftopdf cups-filters-1.0.35/Makefile.am +--- cups-filters-1.0.35/Makefile.am.urftopdf 2013-08-30 11:16:08.166987338 +0100 ++++ cups-filters-1.0.35/Makefile.am 2013-08-30 11:16:09.181993633 +0100 +@@ -402,8 +402,8 @@ pkgfilter_PROGRAMS += \ + pdftoraster \ + rastertoescpx \ + rastertopclx \ +- texttopdf \ +- urftopdf ++ texttopdf ++ + if ENABLE_IMAGEFILTERS + pkgfilter_PROGRAMS += \ + imagetopdf \ +diff -up cups-filters-1.0.35/Makefile.in.urftopdf cups-filters-1.0.35/Makefile.in +--- cups-filters-1.0.35/Makefile.in.urftopdf 2013-08-30 11:16:14.880027661 +0100 ++++ cups-filters-1.0.35/Makefile.in 2013-08-30 11:17:44.440432004 +0100 +@@ -66,7 +66,7 @@ pkgfilter_PROGRAMS = pdftoopvp$(EXEEXT) + bannertopdf$(EXEEXT) commandtoescpx$(EXEEXT) \ + commandtopclx$(EXEEXT) pdftoijs$(EXEEXT) pdftops$(EXEEXT) \ + pdftoraster$(EXEEXT) rastertoescpx$(EXEEXT) \ +- rastertopclx$(EXEEXT) texttopdf$(EXEEXT) urftopdf$(EXEEXT) \ ++ rastertopclx$(EXEEXT) texttopdf$(EXEEXT) \ + $(am__EXEEXT_1) + @ENABLE_IMAGEFILTERS_TRUE@am__append_1 = \ + @ENABLE_IMAGEFILTERS_TRUE@ imagetopdf \ +diff -up cups-filters-1.0.35/mime/cupsfilters.convs.urftopdf cups-filters-1.0.35/mime/cupsfilters.convs +--- cups-filters-1.0.35/mime/cupsfilters.convs.urftopdf 2013-08-30 11:11:24.693868551 +0100 ++++ cups-filters-1.0.35/mime/cupsfilters.convs 2013-08-30 11:11:44.149958234 +0100 +@@ -68,7 +68,6 @@ image/x-xpixmap application/vnd.cups-pd + image/x-xwindowdump application/vnd.cups-pdf 65 imagetopdf + image/x-sun-raster application/vnd.cups-pdf 65 imagetopdf + application/vnd.cups-pdf-banner application/pdf 32 bannertopdf +-image/urf application/pdf 0 urftopdf + + ######################################################################## + # +diff -up cups-filters-1.0.35/mime/cupsfilters.types.urftopdf cups-filters-1.0.35/mime/cupsfilters.types diff --git a/SPECS/cups-filters.spec b/SPECS/cups-filters.spec new file mode 100644 index 0000000..13f9d66 --- /dev/null +++ b/SPECS/cups-filters.spec @@ -0,0 +1,373 @@ +# we build CUPS also with relro +%global _hardened_build 1 + +Summary: OpenPrinting CUPS filters and backends +Name: cups-filters +Version: 1.0.35 +Release: 11%{?dist} + +# For a breakdown of the licensing, see COPYING file +# GPLv2: filters: commandto*, imagetoraster, pdftops, rasterto*, +# imagetopdf, pstopdf, texttopdf +# backends: parallel, serial +# GPLv2+: filters: textonly, texttops, imagetops +# GPLv3: filters: bannertopdf +# GPLv3+: filters: urftopdf +# LGPLv2+: utils: cups-browsed +# MIT: filters: pdftoijs, pdftoopvp, pdftopdf, pdftoraster +License: GPLv2 and GPLv2+ and GPLv3 and GPLv3+ and LGPLv2+ and MIT + +Group: System Environment/Base +Url: http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups-filters +Source0: http://www.openprinting.org/download/cups-filters/cups-filters-%{version}.tar.xz +Source1: cups-browsed.service + +Patch1: cups-filters-man.patch +Patch2: cups-filters-lookup.patch +Patch3: cups-filters-page-label.patch +Patch4: cups-filters-filter-costs.patch +Patch5: cups-filters-urftopdf.patch +Patch6: cups-filters-format-mismatch.patch +Patch7: cups-filters-pdf-landscape.patch +Patch8: cups-filters-pdftoopvp.patch + +Requires: cups-filters-libs%{?_isa} = %{version}-%{release} + +# Obsolete cups-php (bug #971741) +Obsoletes: cups-php < 1:1.6.0-1 +# Don't Provide it because we don't build the php module +#Provides: cups-php = 1:1.6.0-1 + +BuildRequires: cups-devel +# pdftopdf +BuildRequires: qpdf-devel +# pdftops +BuildRequires: poppler-utils +# pdftoijs, pdftoopvp, pdftoraster +BuildRequires: poppler-devel poppler-cpp-devel +BuildRequires: libjpeg-devel +BuildRequires: libpng-devel +BuildRequires: libtiff-devel +BuildRequires: zlib-devel +# libijs +BuildRequires: ghostscript-devel +BuildRequires: freetype-devel +BuildRequires: fontconfig-devel +BuildRequires: lcms2-devel +# cups-browsed +BuildRequires: avahi-devel avahi-glib-devel +BuildRequires: systemd + +# Make sure we get postscriptdriver tags. +BuildRequires: python-cups + +# autogen.sh +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool + +Requires: cups-filesystem +Requires: poppler-utils +# pstopdf +Requires: bc grep sed + +# cups-browsed +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd + +%package libs +Summary: OpenPrinting CUPS filters and backends - cupsfilters and fontembed libraries +Group: System Environment/Libraries +# LGPLv2: libcupsfilters +# MIT: libfontembed +License: LGPLv2 and MIT + +%package devel +Summary: OpenPrinting CUPS filters and backends - development environment +Group: Development/Libraries +License: LGPLv2 and MIT +Requires: cups-filters-libs%{?_isa} = %{version}-%{release} + +%description +Contains backends, filters, and other software that was +once part of the core CUPS distribution but is no longer maintained by +Apple Inc. In addition it contains additional filters developed +independently of Apple, especially filters for the PDF-centric printing +workflow introduced by OpenPrinting. + +%description libs +This package provides cupsfilters and fontembed libraries. + +%description devel +This is the development package for OpenPrinting CUPS filters and backends. + +%prep +%setup -q +%patch1 -p1 -b .man +%patch2 -p1 -b .lookup + +# Added support for page-label (bug #987515). +%patch3 -p1 -b .page-label + +# Upstream patch to re-work filter costs (bug #998981). +%patch4 -p1 -b .filter-costs + +# Don't ship urftopdf for now (bug #1002947). +%patch5 -p1 -b .urftopdf + +# Fixes for some printf-type format mismatches (bug #1003035). +%patch6 -p1 -b .format-mismatch + +# Fix PDF landscape printing (bug #1018313). +%patch7 -p1 -b .pdf-landscape + +# Don't ship pdftoopvp for now (bug #1027557). +%patch8 -p1 -b .pdftoopvp + +%build +# work-around Rpath +./autogen.sh + +# --with-pdftops=pdftops - use Poppler instead of Ghostscript (see README) +# --with-rcdir=no - don't install SysV init script +%configure --disable-static \ + --disable-silent-rules \ + --with-pdftops=pdftops \ + --with-rcdir=no + +make %{?_smp_mflags} + +%install +make install DESTDIR=%{buildroot} + +# https://fedoraproject.org/wiki/Packaging_tricks#With_.25doc +mkdir __doc +mv %{buildroot}%{_datadir}/doc/cups-filters/* __doc +rm -rf %{buildroot}%{_datadir}/doc/cups-filters + +# Don't ship libtool la files. +rm -f %{buildroot}%{_libdir}/lib*.la + +# Not sure what is this good for. +rm -f %{buildroot}%{_bindir}/ttfread + +# systemd unit file +mkdir -p %{buildroot}%{_unitdir} +install -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir} + +%post +%systemd_post cups-browsed.service + +# Initial installation +if [ $1 -eq 1 ] ; then + IN=%{_sysconfdir}/cups/cupsd.conf + OUT=%{_sysconfdir}/cups/cups-browsed.conf + keyword=BrowsePoll + + # We can remove this after few releases, it's just for the introduction of cups-browsed. + if [ -f "$OUT" ]; then + echo -e "\n# NOTE: This file is not part of CUPS. You need to start & enable cups-browsed service." >> "$OUT" + fi + + # move BrowsePoll from cupsd.conf to cups-browsed.conf + if [ -f "$IN" ] && grep -iq ^$keyword "$IN"; then + if ! grep -iq ^$keyword "$OUT"; then + (cat >> "$OUT" <> "$OUT") || : + #systemctl enable cups-browsed.service >/dev/null 2>&1 || : + fi + sed -i -e "s,^$keyword,#$keyword directive moved to cups-browsed.conf\n#$keyword,i" "$IN" || : + fi +fi + +%preun +%systemd_preun cups-browsed.service + +%postun +%systemd_postun_with_restart cups-browsed.service + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + + +%files +%doc __doc/README __doc/AUTHORS __doc/NEWS +%config(noreplace) %{_sysconfdir}/cups/cups-browsed.conf +%attr(0755,root,root) %{_cups_serverbin}/filter/* +%attr(0755,root,root) %{_cups_serverbin}/backend/parallel +# Serial backend needs to run as root (bug #212577#c4). +%attr(0700,root,root) %{_cups_serverbin}/backend/serial +%{_datadir}/cups/banners +%{_datadir}/cups/charsets +%{_datadir}/cups/data/* +# this needs to be in the main package because of cupsfilters.drv +%{_datadir}/cups/ppdc/pcl.h +%{_datadir}/cups/drv/cupsfilters.drv +%{_datadir}/cups/mime/cupsfilters.types +%{_datadir}/cups/mime/cupsfilters.convs +%{_datadir}/ppd/cupsfilters +%{_sbindir}/cups-browsed +%{_unitdir}/cups-browsed.service +%{_mandir}/man8/cups-browsed.8.gz +%{_mandir}/man5/cups-browsed.conf.5.gz + +%files libs +%doc __doc/COPYING fontembed/README +%attr(0755,root,root) %{_libdir}/libcupsfilters.so.* +%attr(0755,root,root) %{_libdir}/libfontembed.so.* + +%files devel +%{_includedir}/cupsfilters +%{_includedir}/fontembed +%{_libdir}/pkgconfig/libcupsfilters.pc +%{_libdir}/pkgconfig/libfontembed.pc +%{_libdir}/libcupsfilters.so +%{_libdir}/libfontembed.so + +%changelog +* Fri Nov 8 2013 Tim Waugh - 1.0.35-11 +- Don't ship pdftoopvp for now (bug #1027557). + +* Wed Oct 16 2013 Tim Waugh - 1.0.35-10 +- Fix PDF landscape printing (bug #1018313). + +* Tue Oct 1 2013 Tim Waugh - 1.0.35-9 +- Fixes for some printf-type format mismatches (bug #1003035). + +* Fri Aug 30 2013 Tim Waugh - 1.0.35-8 +- Don't ship urftopdf for now (bug #1002947). + +* Wed Aug 21 2013 Tim Waugh - 1.0.35-7 +- Upstream patch to re-work filter costs (bug #998981). No longer need + text filter costs patch as paps gets used by default now if + installed. + +* Tue Jul 30 2013 Tim Waugh - 1.0.35-6 +- Set cost for text filters to 200 so that the paps filter gets + preference for the time being (bug #988909). + +* Wed Jul 24 2013 Tim Waugh - 1.0.35-5 +- Handle page-label when printing n-up as well. + +* Tue Jul 23 2013 Tim Waugh - 1.0.35-4 +- Added support for page-label (bug #987515). + +* Thu Jul 11 2013 Jiri Popelka - 1.0.35-3 +- Rebuild (qpdf-5.0.0) + +* Mon Jul 01 2013 Jiri Popelka - 1.0.35-2 +- add cups-browsed(8) and cups-browsed.conf(5) +- don't reverse lookup IP address in URI (#975822) + +* Wed Jun 26 2013 Jiri Popelka - 1.0.35-1 +- 1.0.35 + +* Mon Jun 24 2013 Marek Kasik - 1.0.34-9 +- Rebuild (poppler-0.22.5) + +* Wed Jun 19 2013 Jiri Popelka - 1.0.34-8 +- fix the note we add in cups-browsed.conf + +* Wed Jun 12 2013 Jiri Popelka - 1.0.34-7 +- Obsolete cups-php (#971741) + +* Wed Jun 05 2013 Jiri Popelka - 1.0.34-6 +- one more cups-browsed leak fixed (#959682) + +* Wed Jun 05 2013 Jiri Popelka - 1.0.34-5 +- perl is actually not required by pstopdf, because the calling is in dead code + +* Mon Jun 03 2013 Jiri Popelka - 1.0.34-4 +- fix resource leaks and other problems found by Coverity & Valgrind (#959682) + +* Wed May 15 2013 Jiri Popelka - 1.0.34-3 +- ship ppdc/pcl.h because of cupsfilters.drv + +* Tue May 07 2013 Jiri Popelka - 1.0.34-2 +- pstopdf requires bc (#960315) + +* Thu Apr 11 2013 Jiri Popelka - 1.0.34-1 +- 1.0.34 + +* Fri Apr 05 2013 Fridolin Pokorny - 1.0.33-1 +- 1.0.33 +- removed cups-filters-1.0.32-null-info.patch, accepted by upstream + +* Thu Apr 04 2013 Fridolin Pokorny - 1.0.32-2 +- fixed segfault when info is NULL + +* Thu Apr 04 2013 Fridolin Pokorny - 1.0.32-1 +- 1.0.32 + +* Fri Mar 29 2013 Jiri Popelka - 1.0.31-3 +- add note to cups-browsed.conf + +* Thu Mar 28 2013 Jiri Popelka - 1.0.31-2 +- check cupsd.conf existence prior to grepping it (#928816) + +* Fri Mar 22 2013 Jiri Popelka - 1.0.31-1 +- 1.0.31 + +* Tue Mar 19 2013 Jiri Popelka - 1.0.30-4 +- revert previous change + +* Wed Mar 13 2013 Jiri Popelka - 1.0.30-3 +- don't ship banners for now (#919489) + +* Tue Mar 12 2013 Jiri Popelka - 1.0.30-2 +- move BrowsePoll from cupsd.conf to cups-browsed.conf in %%post + +* Fri Mar 08 2013 Jiri Popelka - 1.0.30-1 +- 1.0.30: CUPS browsing and broadcasting in cups-browsed + +* Wed Feb 13 2013 Fedora Release Engineering - 1.0.29-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Sat Jan 19 2013 Rex Dieter 1.0.29-3 +- backport upstream buildfix for poppler-0.22.x + +* Fri Jan 18 2013 Adam Tkac - 1.0.29-2 +- rebuild due to "jpeg8-ABI" feature drop + +* Thu Jan 03 2013 Jiri Popelka 1.0.29-1 +- 1.0.29 + +* Wed Jan 02 2013 Jiri Popelka 1.0.28-1 +- 1.0.28: cups-browsed daemon and service + +* Thu Nov 29 2012 Jiri Popelka 1.0.25-1 +- 1.0.25 + +* Fri Sep 07 2012 Jiri Popelka 1.0.24-1 +- 1.0.24 + +* Wed Aug 22 2012 Jiri Popelka 1.0.23-1 +- 1.0.23: old pdftopdf removed + +* Tue Aug 21 2012 Jiri Popelka 1.0.22-1 +- 1.0.22: new pdftopdf (uses qpdf instead of poppler) + +* Wed Aug 08 2012 Jiri Popelka 1.0.20-4 +- rebuild + +* Thu Aug 02 2012 Jiri Popelka 1.0.20-3 +- commented multiple licensing breakdown (#832130) +- verbose build output + +* Thu Aug 02 2012 Jiri Popelka 1.0.20-2 +- BuildRequires: poppler-cpp-devel (to build against poppler-0.20) + +* Mon Jul 23 2012 Jiri Popelka 1.0.20-1 +- 1.0.20 + +* Tue Jul 17 2012 Jiri Popelka 1.0.19-1 +- 1.0.19 + +* Wed May 30 2012 Jiri Popelka 1.0.18-1 +- initial spec file