commit bb0de51ae107b11ed47c575d47604c5b6aec02b9 Author: MSVSphere Packaging Team Date: Fri Oct 25 17:32:40 2024 +0300 import pappl-1.4.6-3.el10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2111c25 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/pappl-1.4.6.tar.gz diff --git a/.pappl.metadata b/.pappl.metadata new file mode 100644 index 0000000..a288374 --- /dev/null +++ b/.pappl.metadata @@ -0,0 +1 @@ +f5da2621d95ae9cd6ef6743e202a5bdaef1e0f5e SOURCES/pappl-1.4.6.tar.gz diff --git a/SOURCES/0001-Fix-port-number-user-input-when-adding-a-printer-Iss.patch b/SOURCES/0001-Fix-port-number-user-input-when-adding-a-printer-Iss.patch new file mode 100644 index 0000000..b830f16 --- /dev/null +++ b/SOURCES/0001-Fix-port-number-user-input-when-adding-a-printer-Iss.patch @@ -0,0 +1,59 @@ +From 3f1c329fddc0490e2fc5b97925268db5875e4dfe Mon Sep 17 00:00:00 2001 +From: Michael R Sweet +Date: Thu, 2 May 2024 16:42:15 -0400 +Subject: [PATCH] Fix port number user input when adding a printer (Issue #360) + +--- + CHANGES.md | 2 ++ + pappl/system-webif.c | 16 ++++++++++++---- + 2 files changed, 14 insertions(+), 4 deletions(-) + +diff --git a/pappl/system-webif.c b/pappl/system-webif.c +index 0b8bf6f..93de51a 100644 +--- a/pappl/system-webif.c ++++ b/pappl/system-webif.c +@@ -365,18 +365,21 @@ _papplSystemWebAddPrinter( + device_uri[1024] = "", // Device URI + *device_id = NULL, // Device ID + hostname[256] = "", // Hostname ++ hostvalue[256], // Hostname[:port] + *ptr; // Pointer into string + int port = 0; // Default port for Socket printing + _pappl_system_dev_t devdata; // Device callback data + static const char *hostname_pattern = // IP address or hostname pattern + // Hostname per RFC 1123 +- "(^\\s*((?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|\\b-){0,61}[0-9A-Za-z])?(?:\\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|\\b-){0,61}[0-9A-Za-z])?)*\\.?)\\s*$)" ++ "^((\\s*((?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|\\b-){0,61}[0-9A-Za-z])?(?:\\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|\\b-){0,61}[0-9A-Za-z])?)*\\.?)\\s*)" + "|" + // IPv4 address +- "(^\\s*((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))\\s*$)" ++ "(\\s*((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))\\s*)" + "|" + // IPv6 address +- "(^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,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d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*)" ++ // Optional port number ++ ")(|:[0-9]+)$"; + + + if (!papplClientHTMLAuthorize(client)) +@@ -523,10 +526,15 @@ _papplSystemWebAddPrinter( + + papplDeviceList(PAPPL_DEVTYPE_ALL, system_device_cb, &devdata, papplLogDevice, system); + ++ if (port) ++ snprintf(hostvalue, sizeof(hostvalue), "%s:%d", hostname, port); ++ else ++ papplCopyString(hostvalue, hostname, sizeof(hostvalue)); ++ + papplClientHTMLPrintf(client, + "\n" + " \n" +- " ", papplClientGetLocString(client, _PAPPL_LOC("Network Printer")), papplClientGetLocString(client, _PAPPL_LOC("Hostname/IP Address")), papplClientGetLocString(client, _PAPPL_LOC("IP address or hostname")), hostname_pattern, hostvalue, papplClientGetLocString(client, _PAPPL_LOC("Driver Name"))); + + if (system->autoadd_cb) + papplClientHTMLPrintf(client, "", papplClientGetLocString(client, _PAPPL_LOC("Auto-Detect Driver"))); +-- +2.45.2 + diff --git a/SOURCES/0001-List-raw-sockets-during-printers-subcommand-if-avail.patch b/SOURCES/0001-List-raw-sockets-during-printers-subcommand-if-avail.patch new file mode 100644 index 0000000..2000580 --- /dev/null +++ b/SOURCES/0001-List-raw-sockets-during-printers-subcommand-if-avail.patch @@ -0,0 +1,102 @@ +From 539d471a9a484fa8f6bc894064704adae7829d34 Mon Sep 17 00:00:00 2001 +From: Zdenek Dohnal +Date: Tue, 13 Feb 2024 17:52:27 +0100 +Subject: [PATCH] List raw sockets during `printers` subcommand if available + +Provide a way how to show path to raw socket via CLI without 3rd part +tools. +--- + pappl/mainloop-subcommands.c | 47 ++++++++++++++++++++++++++++++++++-- + pappl/printer-ipp.c | 11 +++++++++ + 2 files changed, 56 insertions(+), 2 deletions(-) + +diff --git a/pappl/mainloop-subcommands.c b/pappl/mainloop-subcommands.c +index 9df19b8..ee581b7 100644 +--- a/pappl/mainloop-subcommands.c ++++ b/pappl/mainloop-subcommands.c +@@ -1198,6 +1198,11 @@ _papplMainloopShowPrinters( + ipp_t *request, // IPP request + *response; // IPP response + ipp_attribute_t *attr; // Current attribute ++ ipp_tag_t value_tag; // Value tag of IPP attribute ++ const char *printer_name, // Printer name ++ *printer_uri, // Printer URI ++ *attr_name, // Attribute name ++ *socket_uri; // Socket URI + + + (void)num_options; +@@ -1213,8 +1218,46 @@ _papplMainloopShowPrinters( + + response = cupsDoRequest(http, request, "/ipp/system"); + +- for (attr = ippFindAttribute(response, "printer-name", IPP_TAG_NAME); attr; attr = ippFindNextAttribute(response, "printer-name", IPP_TAG_NAME)) +- puts(ippGetString(attr, 0, NULL)); ++ for (attr = ippFirstAttribute(response); attr; attr = ippNextAttribute(response)) ++ { ++ while (attr != NULL && ippGetGroupTag(attr) != IPP_TAG_PRINTER) ++ attr = ippNextAttribute(response); ++ ++ if (attr == NULL) ++ break; ++ ++ value_tag = IPP_TAG_CUPS_INVALID; ++ printer_name = NULL; ++ printer_uri = NULL; ++ attr_name = NULL; ++ socket_uri = NULL; ++ ++ for (; attr && ippGetGroupTag(attr) == IPP_TAG_PRINTER; attr = ippNextAttribute(response)) ++ { ++ value_tag = ippGetValueTag(attr); ++ ++ if (value_tag != IPP_TAG_NAME && ++ value_tag != IPP_TAG_URI) ++ continue; ++ ++ attr_name = ippGetName(attr); ++ ++ if (value_tag == IPP_TAG_NAME && !strcmp(attr_name, "printer-name")) ++ printer_name = ippGetString(attr, 0, NULL); ++ ++ if (value_tag == IPP_TAG_URI && !strcmp(attr_name, "smi55357-printer-socket-uri-supported")) ++ socket_uri = ippGetString(attr, 0, NULL); ++ ++ if (value_tag == IPP_TAG_URI && !strcmp(attr_name, "printer-uri-supported")) ++ printer_uri = ippGetString(attr, 0, NULL); ++ } ++ ++ if (printer_name && printer_uri) ++ printf("%s - printer - %s\n", printer_name, printer_uri); ++ ++ if (printer_name && socket_uri) ++ printf("%s - raw socket - %s\n", printer_name, socket_uri); ++ } + + ippDelete(response); + httpClose(http); +diff --git a/pappl/printer-ipp.c b/pappl/printer-ipp.c +index 551eddc..0d473aa 100644 +--- a/pappl/printer-ipp.c ++++ b/pappl/printer-ipp.c +@@ -626,6 +626,17 @@ _papplPrinterCopyAttributesNoLock( + ippAddStrings(client->response, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "uri-authentication-supported", 2, NULL, uri_authentication_none); + } + } ++ ++ if (printer->raw_active) ++ { ++ if (!ra || cupsArrayFind(ra, "smi55357-printer-socket-uri-supported")) ++ { ++ char socket_uri[1024]; // Buffer for socket URI ++ ++ httpAssembleURI(HTTP_URI_CODING_ALL, socket_uri, sizeof(socket_uri), "socket", NULL, client->host_field, 9099 + printer->printer_id, NULL); ++ ippAddString(client->response, IPP_TAG_PRINTER, IPP_TAG_URI, "smi55357-printer-socket-uri-supported", NULL, socket_uri); ++ } ++ } + } + + +-- +2.43.0 + diff --git a/SOURCES/pappl-max-vendors.patch b/SOURCES/pappl-max-vendors.patch new file mode 100644 index 0000000..0a5211d --- /dev/null +++ b/SOURCES/pappl-max-vendors.patch @@ -0,0 +1,13 @@ +diff --git a/pappl/printer.h b/pappl/printer.h +index c261f5f..860cae0 100644 +--- a/pappl/printer.h ++++ b/pappl/printer.h +@@ -27,7 +27,7 @@ extern "C" { + # define PAPPL_MAX_SOURCE 16 // Maximum number of sources/rolls + # define PAPPL_MAX_SUPPLY 32 // Maximum number of supplies + # define PAPPL_MAX_TYPE 32 // Maximum number of media types +-# define PAPPL_MAX_VENDOR 32 // Maximum number of vendor extension attributes ++# define PAPPL_MAX_VENDOR 256 // Maximum number of vendor extension attributes + + + // diff --git a/SPECS/pappl.spec b/SPECS/pappl.spec new file mode 100644 index 0000000..2cb4151 --- /dev/null +++ b/SPECS/pappl.spec @@ -0,0 +1,195 @@ +# +# RPM spec file for the Printer Application Framework +# +# Copyright © 2020-2021 by Michael R Sweet +# +# Licensed under Apache License v2.0. See the file "LICENSE" for more +# information. +# + +Summary: Printer Application Framework (PAPPL) +Name: pappl +Version: 1.4.6 +Release: 3%{?dist} +License: Apache-2.0 WITH LLVM-exception +Source: https://github.com/michaelrsweet/pappl/releases/download/v%{version}/pappl-%{version}.tar.gz +Url: https://www.msweet.org/pappl + +# Add listing raw sockets +# https://github.com/michaelrsweet/pappl/pull/341 +Patch001: 0001-List-raw-sockets-during-printers-subcommand-if-avail.patch +# https://github.com/michaelrsweet/pappl/commit/3f1c329fdd +Patch002: 0001-Fix-port-number-user-input-when-adding-a-printer-Iss.patch +# raise MAX_VENDOR https://sourceforge.net/p/gimp-print/mailman/gimp-print-devel/thread/e24b2385-6576-a949-a40d-3786c8067520%40gmail.com/#msg37353830 +# downstream only, Mike does not want to merge the change +Patch003: pappl-max-vendors.patch + + +BuildRequires: avahi-devel +BuildRequires: cups-devel +BuildRequires: gcc +BuildRequires: git-core +BuildRequires: glibc-devel +BuildRequires: gnutls-devel +BuildRequires: libjpeg-turbo-devel +BuildRequires: libpng-devel +BuildRequires: libusbx-devel +BuildRequires: make +BuildRequires: pkgconfig +BuildRequires: pam-devel +BuildRequires: zlib-devel + +%description +PAPPL is a simple C-based framework/library for developing CUPS Printer +Applications, which are the recommended replacement for printer drivers. + +PAPPL supports JPEG, PNG, PWG Raster, Apple Raster, and "raw" printing to +printers connected via USB and network (AppSocket/JetDirect) connections. +PAPPL provides access to the printer via its embedded IPP Everywhere™ service, +either local to the computer or on your whole network, which can then be +discovered and used by any application. + +PAPPL is licensed under the Apache License Version 2.0 with an exception +to allow linking against GPL2/LGPL2 software (like older versions of CUPS), +so it can be used freely in any project you'd like. + +%package devel +Summary: PAPPL - development environment +Requires: %{name}%{?_isa} = %{version}-%{release} + +BuildRequires: avahi-devel + +%description devel +This package provides the PAPPL headers and development environment. + +%prep +%autosetup -S git + +%build +#need this to enable build with '-D_TIME_BITS=64' flag +export CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" +%configure --enable-libjpeg\ + --enable-libpng\ + --enable-libusb\ + --disable-static\ + --with-dnssd=avahi\ + --with-tls=gnutls\ + --with-dsoflags="$DSOFLAGS -Wl,-z,now,--as-needed" +# add --enable-libpam once there is a new version - cosmetic issue, libpam is used when +# found in buildroot, which is taken care of by BuilrRequires for pam-devel +%make_build + +%install +%make_install BUILDROOT=%{buildroot} + +%check +make test + +%files +%{_libdir}/libpappl.so.* +%doc *.md +%license LICENSE NOTICE + +%files devel +%doc %{_docdir}/pappl/* +%dir %{_datadir}/pappl +%dir %{_docdir}/pappl +%dir %{_includedir}/pappl +%{_bindir}/pappl-makeresheader +%{_datadir}/pappl/* +%{_includedir}/pappl/*.h +%{_libdir}/libpappl.so +%{_libdir}/pkgconfig/pappl.pc +%{_mandir}/man1/pappl.1.gz +%{_mandir}/man1/pappl-makeresheader.1.gz +%{_mandir}/man3/pappl-client.3.gz +%{_mandir}/man3/pappl-device.3.gz +%{_mandir}/man3/pappl-job.3.gz +%{_mandir}/man3/pappl-log.3.gz +%{_mandir}/man3/pappl-mainloop.3.gz +%{_mandir}/man3/pappl-printer.3.gz +%{_mandir}/man3/pappl-resource.3.gz +%{_mandir}/man3/pappl-system.3.gz + +%changelog +* Thu Aug 08 2024 Zdenek Dohnal - 1.4.6-3 +- the last change changes ABI - lprint has to be rebuilt + +* Mon Jul 29 2024 Zdenek Dohnal - 1.4.6-2 +- RHEL-50774 enlarge array for vendor specific attributtes + +* Wed Jul 17 2024 Zdenek Dohnal - 1.4.6-1 +- RHEL-25805 [pappl] rebase pappl to 1.4.6 + +* Mon Jun 24 2024 Troy Dawson - 1.4.4-4 +- Bump release for June 2024 mass rebuild + +* Thu Jan 25 2024 Fedora Release Engineering - 1.4.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 1.4.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Jan 11 2024 Zdenek Dohnal - 1.4.4-1 +- 2255704 - pappl-1.4.4 is available + +* Mon Dec 18 2023 Richard Lescak - 1.4.3-1 +- rebase to version 1.4.3 (#2250222) + +* Wed Oct 18 2023 Richard Lescak - 1.4.2-1 +- rebase to version 1.4.2 (#2238033) + +* Fri Oct 13 2023 Richard Lescak - 1.4.1-1 +- rebase to version 1.4.1 (#2238033) + +* Thu Jul 20 2023 Fedora Release Engineering - 1.3.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu May 11 2023 Richard Lescak - 1.3.2-1 +- rebase to version 1.3.2 (#2195988) + +* Thu Apr 13 2023 Zdenek Dohnal - 1.3.1-3 +- fix crash due invalid buffer size in `write_log()` +- use the correct license tag + +* Thu Feb 16 2023 Richard Lescak - 1.3.1-2 +- SPDX migration + +* Thu Jan 19 2023 Richard Lescak - 1.3.1-1 +- Rebase to version 1.3.1 (#2157744) + +* Fri Dec 16 2022 Richard Lescak - 1.3.0-1 +- Rebase to version 1.3.0 (#2150441) + +* Fri Oct 21 2022 Richard Lescak - 1.2.3-1 +- Rebase to version 1.2.3 (#2133319) + +* Tue Sep 27 2022 Richard Lescak - 1.2.2-1 +- Rebase to version 1.2.2 (#2129391) + +* Fri Jul 22 2022 Fedora Release Engineering - 1.2.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Tue Jun 21 2022 Richard Lescak - 1.2.1-2 +- link libpappl with -Wl,-z,now + +* Tue Jun 21 2022 Richard Lescak - 1.2.1-1 +- Rebase to version 1.2.1 (#2078148) + +* Thu Jan 20 2022 Fedora Release Engineering - 1.1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Dec 17 2021 Richard Lescak - 1.1.0-1 +- Rebase to version 1.1.0 (#2020646) + +* Thu Jul 22 2021 Fedora Release Engineering - 1.0.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue May 25 2021 Richard Lescak - 1.0.3-1 +- Update to version 1.0.3 (#1962959) + +* Tue Apr 13 2021 Richard Lescak - 1.0.2-2 +- Added patch to fix tests, added DSOFLAGS in build, made changes according to review. + +* Fri Mar 26 2021 Richard Lescak - 1.0.2-1 +- Initial version of package