summaryrefslogtreecommitdiff
path: root/net-print
diff options
context:
space:
mode:
Diffstat (limited to 'net-print')
-rw-r--r--net-print/Manifest.gzbin5751 -> 5753 bytes
-rw-r--r--net-print/cups-filters/Manifest7
-rw-r--r--net-print/cups-filters/cups-filters-1.28.15-r1.ebuild130
-rw-r--r--net-print/cups-filters/cups-filters-1.28.16-r3.ebuild144
-rw-r--r--net-print/cups-filters/cups-filters-1.28.17-r2.ebuild (renamed from net-print/cups-filters/cups-filters-1.28.17-r1.ebuild)3
-rw-r--r--net-print/cups-filters/files/cups-filters-1.28.17-CVE-2023-24805.patch225
-rw-r--r--net-print/cups/Manifest3
-rw-r--r--net-print/cups/cups-2.4.2-r4.ebuild319
-rw-r--r--net-print/cups/cups-2.4.2-r5.ebuild320
-rw-r--r--net-print/cups/cups-2.4.2-r6.ebuild321
10 files changed, 229 insertions, 1243 deletions
diff --git a/net-print/Manifest.gz b/net-print/Manifest.gz
index fe8cd79fc29a..8157a20b8505 100644
--- a/net-print/Manifest.gz
+++ b/net-print/Manifest.gz
Binary files differ
diff --git a/net-print/cups-filters/Manifest b/net-print/cups-filters/Manifest
index 5cd3bcd4f35f..b29b5d973909 100644
--- a/net-print/cups-filters/Manifest
+++ b/net-print/cups-filters/Manifest
@@ -1,10 +1,7 @@
AUX cups-browsed.init.d-r2 150 BLAKE2B c2098766ae08b38dead0a5bab2e30e1728ab93aa98e74edb6e20f8a885b62189f1368a041c4430ad24a1b92f0ae9cb317ac3390767db0a54ca1532022d44b0bd SHA512 c8a74ad0e5cfd3b565c12eeca50a55b7a6aa3ac92c689fc6632e2a6df5033e6fa7f16ce6c9c2cbf607ad4bd09453ab7d47448cdd04ad8c7e35f0e584b6d96d38
+AUX cups-filters-1.28.17-CVE-2023-24805.patch 7284 BLAKE2B fb7a6ec5a872381e2319a836e2bbb7f31d3635fd5fd38b44db28616cd18d0332d2ca8af36028a8ba8b0f405f144065779bffb15c1f07dbb6ee6118e01583185a SHA512 108282a8414591187789d87d8da22d261fda0e2cb0dae2e6fcbde320cee0b6fb79c2f616947ee297a58237f3c630b593d4f5b668cf8df2d5cb5c755cb0470211
AUX cups-filters-1.28.17-c++17.patch 1066 BLAKE2B 149001a37c5799210a7cbc6c79ab1b87917f937c4f9d61c1955d18588e0b6c27e17430613f4c35e50cabf485ad381bc8e1f4c6f8a4afa14a7e9ab5e1f9acf291 SHA512 f78038c6e173490a9096ae1c7e22476e33187317738db680c43333738c7dad29d441d7c78ed2d8adc389444ef5c4694002e403f5e54855216d4000ac791752b0
-DIST cups-filters-1.28.15.tar.xz 1511452 BLAKE2B 2ed495f063197955456c07c6c06747093997afce53c15e19d081f2e53e6af9a76a41094d2356a1cd7533c3bb63bfb6257792b71ee14121a0daf5863b3b5cd76f SHA512 cc8d43bba6edb2b839f3be5fcbcdeb7633ed0f0f0c2737bcc6957cf95fb4ded8ee412358cc95fdbf289ae897dd0b7f32e689f02d191a8f15930eb4d2deefd74c
-DIST cups-filters-1.28.16.tar.xz 1512496 BLAKE2B a75a9e09688670332a9fd9a8e4d9004650c6b0fb571a1f48a02e8e4af56d08b7d312d65fdbd66caf82907005dd336de90e2c8bbb46b1ba13d86d8715340f8ce6 SHA512 0369f96a8ae5e33bf75c8765947d5ad7285b3532e9d9b0ded7e206798834c9ade3a2ac3f1d16e0fdd43346f2bc7852c541130e935cbb20f9c1239a53118d1239
DIST cups-filters-1.28.17.tar.xz 1516052 BLAKE2B 87258391901d55d9e59b06d54603d014e54d224a373529bd70fcd38cded9dc96c88ca73bcea63d7633c065caea3f9e3274cd450aec5f1bd90130d9a88c0d3421 SHA512 320544a48206165581adafb28dbef58f39c66bebd3641be3d180a692605349d9e6af6d464044db9f7bda17a67f4a079370d8cc880cd7873d684b2209882deb35
-EBUILD cups-filters-1.28.15-r1.ebuild 3287 BLAKE2B bcc2f0b85f735c1a7c10c1e32a9bd3c6fb975c22e00a33bb082188f9136cb77319d461dc40706b61b601376469b4a16be7826f05fe86f6092330fe8c5bf26f2b SHA512 d0d2117ea64feacc1eb3e6683099f8f79dbe47b060de4dce9e31f784db6b9668d1d993c641747c8ce52d03fcf757f7999e1344aeb636ca725a1e342436c008e8
-EBUILD cups-filters-1.28.16-r3.ebuild 3572 BLAKE2B 79f2d5c3416a3e7057babe51899bf91590cda9e860593d9c6cc0b4d3ee60a01451a8198e501df620de9a25c5d6b523a4ac6013905700dbfe55c0ac5c0e7bad39 SHA512 fd03ca153effb3abaa814a9fcefc0d1f53fb9d0f8bb829076bd88452a35b9d968c4c31f9519e4004a3d38d6c8c204d3294ff7aadf10eded3f9932f5ef194aef9
-EBUILD cups-filters-1.28.17-r1.ebuild 3630 BLAKE2B 5813fd8521b41a4508cc446b1baeebe78d11c776cafb7ac56e3b7a27e7e03f3135e36870ee1ff9335543fec95c521215da7eb8b122f36c7ca84f7964958b3a3a SHA512 3d954324a6be3a955ef15835eba6e52e7c33771e62ef8be7bfda79e5d6464dd0e48f451c9262c737d689dc1b8e89ee25f9a0495b8ebd964667b2237886640a53
+EBUILD cups-filters-1.28.17-r2.ebuild 3679 BLAKE2B 37eae257260279789ec287fc09addef1c1cd61493d50dbed6cef872cdf7e7dd6c2a607ba6fece4333f3795ac2f0e75ba4dc46e5db42f970b2050f7cd03fc5a29 SHA512 3804388f561003ab80ee280bed04ccbd6e8febae84132d8311d9d7016d58618f9ced7860781531156e305da52efc8e57df9ec08965e04d63425307f08e7f6aca
EBUILD cups-filters-1.28.17.ebuild 3657 BLAKE2B ab7d43196ae1fa0c19f945cd5cd5858b9fd956270f8fb02fedc514c451ed6beb8be5181dbcda7a5038aef863eaf7b88b1f5d18744c014c7b09383c17e2dba61b SHA512 a511251105363682cbc5caf7699ca1fe3930f972212eb8342c398e224eaa898a5fe122fcd5ab1f2aafa3339e3fd0637542a44c2881621a791c04e164055e6cec
MISC metadata.xml 513 BLAKE2B b265a1645fe0da46a309086d9495564020ea15b7546237dc040589cba2e5d79540860301f8f72484081b726066414ad0414963b7c7c2ce3f08af898502c32521 SHA512 b9234992f05d59bffafb31f3d035e554389f250d8f3b951bb507e300f7cd3a6806406df60b1cae038ab330b3513934ec1250dcf0c9bfdba1bb033e6545727597
diff --git a/net-print/cups-filters/cups-filters-1.28.15-r1.ebuild b/net-print/cups-filters/cups-filters-1.28.15-r1.ebuild
deleted file mode 100644
index b39191e35f49..000000000000
--- a/net-print/cups-filters/cups-filters-1.28.15-r1.ebuild
+++ /dev/null
@@ -1,130 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-GENTOO_DEPEND_ON_PERL=no
-inherit perl-module systemd flag-o-matic
-
-DESCRIPTION="Cups filters"
-HOMEPAGE="https://wiki.linuxfoundation.org/openprinting/cups-filters"
-SRC_URI="https://www.openprinting.org/download/${PN}/${P}.tar.xz"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
-
-LICENSE="MIT GPL-2"
-SLOT="0"
-IUSE="dbus +foomatic jpeg ldap pclm pdf perl png +postscript test tiff zeroconf"
-
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- >=app-text/poppler-0.32[cxx,jpeg?,lcms,tiff?,utils]
- >=app-text/qpdf-8.3.0:=
- dev-libs/glib:2
- media-libs/fontconfig
- media-libs/freetype:2
- media-libs/lcms:2
- >=net-print/cups-1.7.3
- !<=net-print/cups-1.5.9999
- sys-devel/bc
- sys-libs/zlib
- dbus? ( sys-apps/dbus )
- foomatic? ( !net-print/foomatic-filters )
- jpeg? ( media-libs/libjpeg-turbo:= )
- ldap? ( net-nds/openldap:= )
- pdf? ( app-text/mupdf:= )
- perl? ( dev-lang/perl:= )
- png? ( media-libs/libpng:= )
- postscript? ( >=app-text/ghostscript-gpl-9.09[cups] )
- tiff? ( media-libs/tiff:= )
- zeroconf? ( net-dns/avahi[dbus] )
-"
-DEPEND="${RDEPEND}"
-BDEPEND="
- dev-util/gdbus-codegen
- >=sys-devel/gettext-0.18.3
- virtual/pkgconfig
- test? ( media-fonts/dejavu )
-"
-
-src_configure() {
- # (As of 1.28.15, still defaults upstream to c++0x, so it's still needed,
- # probably.)
- # Bug #626800
- append-cxxflags -std=c++11
-
- local myeconfargs=(
- --enable-imagefilters
- --localstatedir="${EPREFIX}"/var
- --with-browseremoteprotocols=DNSSD,CUPS
- --with-cups-rundir="${EPREFIX}"/run/cups
- --with-fontdir="fonts/conf.avail"
- --with-pdftops=pdftops
- --with-rcdir=no
- --without-php
- --disable-static
- $(use_enable dbus)
- $(use_enable foomatic)
- $(use_enable ldap)
- $(use_enable pclm)
- $(use_enable pdf mutool)
- $(use_enable postscript ghostscript)
- $(use_enable zeroconf avahi)
- $(use_with jpeg)
- $(use_with png)
- $(use_with tiff)
- )
-
- econf "${myeconfargs[@]}"
-}
-
-src_compile() {
- default
-
- if use perl; then
- pushd "${S}/scripting/perl" > /dev/null || die
- perl-module_src_configure
- perl-module_src_compile
- popd > /dev/null || die
- fi
-}
-
-src_test() {
- emake check
-}
-
-src_install() {
- default
-
- if use perl; then
- pushd "${S}/scripting/perl" > /dev/null || die
- perl-module_src_install
- perl_delete_localpod
- popd > /dev/null || die
- fi
-
- if use postscript; then
- # workaround: some printer drivers still require pstoraster and pstopxl, bug #383831
- dosym gstoraster /usr/libexec/cups/filter/pstoraster
- dosym gstopxl /usr/libexec/cups/filter/pstopxl
- fi
-
- find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
-
- cp "${FILESDIR}"/cups-browsed.init.d-r2 "${T}"/cups-browsed || die
-
- if ! use zeroconf ; then
- sed -i -e 's:need cupsd avahi-daemon:need cupsd:g' "${T}"/cups-browsed || die
- sed -i -e 's:cups\.service avahi-daemon\.service:cups.service:g' "${S}"/utils/cups-browsed.service || die
- fi
-
- doinitd "${T}"/cups-browsed
- systemd_dounit "${S}"/utils/cups-browsed.service
-}
-
-pkg_postinst() {
- if ! use foomatic ; then
- ewarn "You are disabling the foomatic code in cups-filters. Please do that ONLY if absolutely"
- ewarn "necessary. net-print/foomatic-filters as a replacement is deprecated and unmaintained."
- fi
-}
diff --git a/net-print/cups-filters/cups-filters-1.28.16-r3.ebuild b/net-print/cups-filters/cups-filters-1.28.16-r3.ebuild
deleted file mode 100644
index 9092975eb895..000000000000
--- a/net-print/cups-filters/cups-filters-1.28.16-r3.ebuild
+++ /dev/null
@@ -1,144 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-GENTOO_DEPEND_ON_PERL=no
-inherit perl-module systemd flag-o-matic
-
-DESCRIPTION="Cups filters"
-HOMEPAGE="https://wiki.linuxfoundation.org/openprinting/cups-filters"
-SRC_URI="https://www.openprinting.org/download/${PN}/${P}.tar.xz"
-
-LICENSE="MIT GPL-2"
-SLOT="0"
-IUSE="dbus exif +foomatic jpeg ldap pclm pdf perl png +postscript test tiff zeroconf"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
-
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- >=app-text/poppler-0.32[cxx,jpeg?,lcms,tiff?,utils]
- >=app-text/qpdf-8.3.0:=
- dev-libs/glib:2
- media-libs/fontconfig
- media-libs/freetype:2
- media-libs/lcms:2
- >=net-print/cups-1.7.3
- !<=net-print/cups-1.5.9999
- sys-devel/bc
- sys-libs/zlib
- exif? ( media-libs/libexif )
- dbus? ( sys-apps/dbus )
- foomatic? ( !net-print/foomatic-filters )
- jpeg? ( media-libs/libjpeg-turbo:= )
- ldap? ( net-nds/openldap:= )
- pdf? ( app-text/mupdf:= )
- perl? ( dev-lang/perl:= )
- png? ( media-libs/libpng:= )
- postscript? ( >=app-text/ghostscript-gpl-9.09[cups] )
- tiff? ( media-libs/tiff:= )
- zeroconf? ( net-dns/avahi[dbus] )
-"
-DEPEND="${RDEPEND}"
-BDEPEND="
- dev-util/gdbus-codegen
- >=sys-devel/gettext-0.18.3
- virtual/pkgconfig
- test? ( media-fonts/dejavu )
-"
-
-src_configure() {
- # (As of 1.28.15, still defaults upstream to c++0x, so it's still needed,
- # probably.)
- # Bug #626800
- append-cxxflags -std=c++11
-
- local myeconfargs=(
- --enable-imagefilters
- --localstatedir="${EPREFIX}"/var
- --with-browseremoteprotocols=DNSSD,CUPS
- --with-cups-rundir="${EPREFIX}"/run/cups
- --with-fontdir="fonts/conf.avail"
- --with-pdftops=pdftops
- --with-rcdir=no
- --without-php
-
- $(use_enable exif)
- $(use_enable dbus)
- $(use_enable foomatic)
- $(use_enable ldap)
- $(use_enable pclm)
- $(use_enable pdf mutool)
- $(use_enable postscript ghostscript)
- $(use_enable zeroconf avahi)
- $(use_with jpeg)
- $(use_with png)
- $(use_with tiff)
- )
-
- econf "${myeconfargs[@]}"
-
- if use perl; then
- pushd "${S}"/scripting/perl > /dev/null || die
- perl-module_src_configure
- popd > /dev/null || die
- fi
-}
-
-src_compile() {
- default
-
- if use perl; then
- pushd "${S}"/scripting/perl > /dev/null || die
- perl-module_src_compile
- popd > /dev/null || die
- fi
-}
-
-src_test() {
- # Avoid perl-module_src_test
- default
-
- if use perl; then
- pushd "${S}/scripting/perl" > /dev/null || die
- perl-module_src_test
- popd > /dev/null || die
- fi
-}
-
-src_install() {
- default
-
- if use perl; then
- pushd "${S}"/scripting/perl > /dev/null || die
- perl-module_src_install
- perl_delete_localpod
- popd > /dev/null || die
- fi
-
- if use postscript; then
- # workaround: some printer drivers still require pstoraster and pstopxl, bug #383831
- dosym gstoraster /usr/libexec/cups/filter/pstoraster
- dosym gstopxl /usr/libexec/cups/filter/pstopxl
- fi
-
- find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
-
- cp "${FILESDIR}"/cups-browsed.init.d-r2 "${T}"/cups-browsed || die
-
- if ! use zeroconf ; then
- sed -i -e 's:need cupsd avahi-daemon:need cupsd:g' "${T}"/cups-browsed || die
- sed -i -e 's:cups\.service avahi-daemon\.service:cups.service:g' "${S}"/utils/cups-browsed.service || die
- fi
-
- doinitd "${T}"/cups-browsed
- systemd_dounit "${S}"/utils/cups-browsed.service
-}
-
-pkg_postinst() {
- if ! use foomatic ; then
- ewarn "You are disabling the foomatic code in cups-filters. Please do that ONLY if absolutely"
- ewarn "necessary. net-print/foomatic-filters as a replacement is deprecated and unmaintained."
- fi
-}
diff --git a/net-print/cups-filters/cups-filters-1.28.17-r1.ebuild b/net-print/cups-filters/cups-filters-1.28.17-r2.ebuild
index 13b7dac3fc7b..7c81cc28cae0 100644
--- a/net-print/cups-filters/cups-filters-1.28.17-r1.ebuild
+++ b/net-print/cups-filters/cups-filters-1.28.17-r2.ebuild
@@ -16,7 +16,7 @@ SRC_URI="
LICENSE="MIT GPL-2"
SLOT="0"
IUSE="dbus exif +foomatic jpeg ldap pclm pdf perl png +postscript test tiff zeroconf"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+KEYWORDS="~alpha ~amd64 arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
RESTRICT="!test? ( test )"
@@ -53,6 +53,7 @@ BDEPEND="
PATCHES=(
"${FILESDIR}"/${PN}-1.28.17-c++17.patch
+ "${FILESDIR}"/${PN}-1.28.17-CVE-2023-24805.patch
)
src_configure() {
diff --git a/net-print/cups-filters/files/cups-filters-1.28.17-CVE-2023-24805.patch b/net-print/cups-filters/files/cups-filters-1.28.17-CVE-2023-24805.patch
new file mode 100644
index 000000000000..58b562504d0d
--- /dev/null
+++ b/net-print/cups-filters/files/cups-filters-1.28.17-CVE-2023-24805.patch
@@ -0,0 +1,225 @@
+Modified version from:
+
+ https://packages.debian.org/de/sid/cups-filters
+
+ From: Thorsten Alteholz <debian@alteholz.de>
+ Date: Fri, 19 May 2023 10:49:35 +0200
+ Subject: fix CVE-2023-24805
+
+Original patch:
+
+https://github.com/OpenPrinting/cups-filters/commit/8f274035756c04efeb77eb654e9d4c4447287d65
+
+From 8f274035756c04efeb77eb654e9d4c4447287d65 Mon Sep 17 00:00:00 2001
+From: Till Kamppeter <till.kamppeter@gmail.com>
+Date: Wed, 17 May 2023 11:12:37 +0200
+Subject: [PATCH] Merge pull request from GHSA-gpxc-v2m8-fr3x
+
+* beh backend: Use execv() instead of system() - CVE-2023-24805
+
+With execv() command line arguments are passed as separate strings and
+not the full command line in a single string. This prevents arbitrary
+command execution by escaping the quoting of the arguments in a job
+with forged job title.
+
+* beh backend: Extra checks against odd/forged input - CVE-2023-24805
+
+- Do not allow '/' in the scheme of the URI (= backend executable
+ name), to assure that only backends inside /usr/lib/cups/backend/
+ are used.
+
+- Pre-define scheme buffer to empty string, to be defined for case of
+ uri being NULL.
+
+- URI must have ':', to split off scheme, otherwise error.
+
+- Check return value of snprintf() to create call path for backend, to
+ error out on truncation of a too long scheme or on complete failure
+ due to a completely odd scheme.
+
+* beh backend: Further improvements - CVE-2023-24805
+
+- Use strncat() instead of strncpy() for getting scheme from URI, the latter
+ does not require setting terminating zero byte in case of truncation.
+
+- Also exclude "." or ".." as scheme, as directories are not valid CUPS
+ backends.
+
+- Do not use fprintf() in sigterm_handler(), to not interfere with a
+ fprintf() which could be running in the main process when
+ sigterm_handler() is triggered.
+
+- Use "static volatile int" for global variable job_canceled.
+
+---
+ backend/beh.c | 107 +++++++++++++++++++++++++++++++++++++++++++++-------------
+ 1 file changed, 84 insertions(+), 23 deletions(-)
+
+diff --git a/backend/beh.c b/backend/beh.c
+index 225fd27..8d51235 100644
+--- a/backend/beh.c
++++ b/backend/beh.c
+@@ -22,12 +22,13 @@
+ #include "backend-private.h"
+ #include <cups/array.h>
+ #include <ctype.h>
++#include <sys/wait.h>
+
+ /*
+ * Local globals...
+ */
+
+-static int job_canceled = 0; /* Set to 1 on SIGTERM */
++static volatile int job_canceled = 0; /* Set to 1 on SIGTERM */
+
+ /*
+ * Local functions...
+@@ -213,21 +214,40 @@ call_backend(char *uri, /* I - URI of final destination */
+ char **argv, /* I - Command-line arguments */
+ char *filename) { /* I - File name of input data */
+ const char *cups_serverbin; /* Location of programs */
++ char *backend_argv[8]; /* Arguments for backend */
+ char scheme[1024], /* Scheme from URI */
+ *ptr, /* Pointer into scheme */
+- cmdline[65536]; /* Backend command line */
+- int retval;
++ backend_path[2048]; /* Backend path */
++ int pid = 0, /* Process ID of backend */
++ wait_pid, /* Process ID from wait() */
++ wait_status, /* Status from child */
++ retval = 0;
++ int bytes;
+
+ /*
+ * Build the backend command line...
+ */
+
+- strncpy(scheme, uri, sizeof(scheme) - 1);
+- if (strlen(uri) > 1023)
+- scheme[1023] = '\0';
++ scheme[0] = '\0';
++ strncat(scheme, uri, sizeof(scheme) - 1);
+ if ((ptr = strchr(scheme, ':')) != NULL)
+ *ptr = '\0';
+-
++ else {
++ fprintf(stderr,
++ "ERROR: beh: Invalid URI, no colon (':') to mark end of scheme part.\n");
++ exit (CUPS_BACKEND_FAILED);
++ }
++ if (strchr(scheme, '/')) {
++ fprintf(stderr,
++ "ERROR: beh: Invalid URI, scheme contains a slash ('/').\n");
++ exit (CUPS_BACKEND_FAILED);
++ }
++ if (!strcmp(scheme, ".") || !strcmp(scheme, "..")) {
++ fprintf(stderr,
++ "ERROR: beh: Invalid URI, scheme (\"%s\") is a directory.\n",
++ scheme);
++ exit (CUPS_BACKEND_FAILED);
++ }
+ if ((cups_serverbin = getenv("CUPS_SERVERBIN")) == NULL)
+ cups_serverbin = CUPS_SERVERBIN;
+
+@@ -235,16 +255,29 @@ call_backend(char *uri, /* I - URI of final destination */
+ fprintf(stderr,
+ "ERROR: beh: Direct output into a file not supported.\n");
+ exit (CUPS_BACKEND_FAILED);
+- } else
+- snprintf(cmdline, sizeof(cmdline),
+- "%s/backend/%s '%s' '%s' '%s' '%s' '%s' %s",
+- cups_serverbin, scheme, argv[1], argv[2], argv[3],
+- /* Apply number of copies only if beh was called with a
+- file name and not with the print data in stdin, as
+- backends should handle copies only if they are called
+- with a file name */
+- (argc == 6 ? "1" : argv[4]),
+- argv[5], filename);
++ }
++
++ backend_argv[0] = uri;
++ backend_argv[1] = argv[1];
++ backend_argv[2] = argv[2];
++ backend_argv[3] = argv[3];
++ /* Apply number of copies only if beh was called with a file name
++ and not with the print data in stdin, as backends should handle
++ copies only if they are called with a file name */
++ backend_argv[4] = (argc == 6 ? "1" : argv[4]);
++ backend_argv[5] = argv[5];
++ backend_argv[6] = filename;
++ backend_argv[7] = NULL;
++
++ bytes = snprintf(backend_path, sizeof(backend_path),
++ "%s/backend/%s", cups_serverbin, scheme);
++ if (bytes < 0 || bytes >= sizeof(backend_path))
++ {
++ fprintf(stderr,
++ "ERROR: beh: Invalid scheme (\"%s\"), could not determing backend path.\n",
++ scheme);
++ return (CUPS_BACKEND_FAILED);
++ }
+
+ /*
+ * Overwrite the device URI and run the actual backend...
+@@ -253,18 +286,44 @@ call_backend(char *uri, /* I - URI of final destination */
+ setenv("DEVICE_URI", uri, 1);
+
+ fprintf(stderr,
+- "DEBUG: beh: Executing backend command line \"%s\"...\n",
+- cmdline);
++ "DEBUG: beh: Executing backend command line \"%s '%s' '%s' '%s' '%s' '%s' %s\"...\n",
++ backend_path, backend_argv[1], backend_argv[2], backend_argv[3],
++ backend_argv[4], backend_argv[5], backend_argv[6]);
+ fprintf(stderr,
+ "DEBUG: beh: Using device URI: %s\n",
+ uri);
+
+- retval = system(cmdline) >> 8;
++ if ((pid = fork()) == 0) {
++ /*
++ * Child comes here...
++ */
++
++ /* Run the backend */
++ execv(backend_path, backend_argv);
+
+- if (retval == -1)
+ fprintf(stderr, "ERROR: Unable to execute backend command line: %s\n",
+ strerror(errno));
+
++ exit(1);
++ } else if (pid < 0) {
++ /*
++ * Unable to fork!
++ */
++
++ return (CUPS_BACKEND_FAILED);
++ }
++
++ while ((wait_pid = wait(&wait_status)) < 0 && errno == EINTR);
++
++ if (wait_pid >= 0 && wait_status) {
++ if (WIFEXITED(wait_status))
++ retval = WEXITSTATUS(wait_status);
++ else if (WTERMSIG(wait_status) != SIGTERM)
++ retval = WTERMSIG(wait_status);
++ else
++ retval = 0;
++ }
++
+ return (retval);
+ }
+
+@@ -277,8 +336,10 @@ static void
+ sigterm_handler(int sig) { /* I - Signal number (unused) */
+ (void)sig;
+
+- fprintf(stderr,
+- "DEBUG: beh: Job canceled.\n");
++ const char * const msg = "DEBUG: beh: Job canceled.\n";
++ /* The if() is to eliminate the return value and silence the warning
++ about an unused return value. */
++ if (write(2, msg, strlen(msg)));
+
+ if (job_canceled)
+ _exit(CUPS_BACKEND_OK);
diff --git a/net-print/cups/Manifest b/net-print/cups/Manifest
index 23f4f1ac57ad..bcc72d22de83 100644
--- a/net-print/cups/Manifest
+++ b/net-print/cups/Manifest
@@ -6,9 +6,6 @@ AUX cups-2.4.2-scheduler-ipp.patch 1285 BLAKE2B 384f730217b5dd19809ec48b5df12c20
AUX cups-resolve-local.patch 3212 BLAKE2B a87bca062bac1b067580706407569df327477c1e186bf149b0d11b4c40b2b599e11125022c29c3bf26473c14342c053a2cde1f47ab0f075afa89af07492f183a SHA512 512d1901cef5ca626b5dbd9f9c32257ebf89887af0e05491f4d3c3cfea1b1f4aa9b028f8acb3321ccc0694e176095072f65215d6d5549a77ffdb5c6dcd9eca7e
AUX cupsd.init.d-r4 577 BLAKE2B 48508b10a13ee73e905b3d061275f5cb12ebdc2175ce46affb2007d4a5d007719a147f490e7c17a3e9a5211b82d9b89be7111921b1c9d991a6fc4c457f63eae0 SHA512 23ec5714764f2bac4105130efe6f79a508a352ecb45ab3f6e08042b156af05065330b2ac85615d0ce792a4dcd8f5230302dba9d1a96fca84c11d8bf2573ccc0e
DIST cups-2.4.2-source.tar.gz 8128785 BLAKE2B 97053feb502d4fdc28810b806000b6c84a6795d5adcec0789e73e5477d5802d46a99381366d16219f627166df088f6decde5c144bd0c38b5745815dc1e426bc5 SHA512 07474643bffe11c79b3226b70d28f1bb803dc19daa10711938cea303feacdcce3945ba8ff0334d94fdd5922ea7d6bf37a28c1ea62cce8ce946c2f90a0faf002f
-EBUILD cups-2.4.2-r4.ebuild 9565 BLAKE2B 6f0d1515121e17b1aaa51b63d13d6e5179e549b10150aaf17a327bf81c72eb04a351824217c9ca68caf57647a5706e212a165fcce6714bcb0d2b42b3721ed228 SHA512 621b343f64cc21f4080ebe30e291fead821c0a2b22a4ae7419b27383a0d99fab557c89156620fcafc17780518fa11eea5c3d474199632483f3228a44ee7b689d
-EBUILD cups-2.4.2-r5.ebuild 9608 BLAKE2B d6209822fc9dd2547155a03e1d18878145513ce660e4f0e7f48e56ac2c4c3ba9c113e44cd62ac57fa9daf0938cfc6cdd199137322cc6ac26cd6511e53ec765dd SHA512 65f9f3bc8e9f995a7b3c1180ae54714874cdc4fdd612945917016ab35154723162009d76895be076d30ba28d726fc935bea8a35e038ab70d6b03c7ae93de3d01
-EBUILD cups-2.4.2-r6.ebuild 9661 BLAKE2B 9119c3b4b54cc866e1c9b5fd2ec51cdff3fde93fd0f7a91d0c6d6424cf5d2bea376c27230ece6c8d96bb67f75d6e02a200b5fb37677fd96f878786c627ff4e30 SHA512 e8cabe54e2719eef34c10855ec5f5d81d137fb6a1b3c464d94db6ab3e7051c9530ab6cab0c2064255ee6942c7a694b7361a9fc39e516e7787516cc191f6b3a5f
EBUILD cups-2.4.2-r7.ebuild 9765 BLAKE2B bab5aaa86a5ef65a7f15678ff716279ef580a9b79b6c160ec1b60ee913a146d20756699fb0d721f5e118691c0696a234c781b0d7aae0bb0f22c976f5efa556b9 SHA512 e0e4a3426f08858fc3f6006e1db3cff31b347404089d465efe379d1b0ddf313990346c81d915f3e82d4ebdcabd11bd2edd196cca987be7fb475d4e45aac7f8b7
EBUILD cups-9999.ebuild 9486 BLAKE2B cd5ffbf3615df20ebe62536c0a8e4d49cee67104fe9b265ea4a46ec8624545317be37dfef18e54e0b4350f1fcc5cbb7aedce15905978e396b9db9a18ffc1263a SHA512 50ce41c2012ff045f4ced0f0b7052bae28650693e03351882fe609648675cbf4f51bb7f43d86d210bf9b39232a674f563f91281fb22f4d92fe45665b1dd5b2d7
MISC metadata.xml 527 BLAKE2B 04a32175e666165226eaa97785a6b9e4b779644e352c503a4653870631f28089dddbaaa3db3143f09a1d97c7f57952e4d760d64005eafacb379c23035fe9ad19 SHA512 136c81a99b501ffcedfd71f4425ba556292b79abc0ac819d336d2c845401775955b8cd72e6194f02f4c48d0cd26bc93ee7c94c7438228b49410daca80a159523
diff --git a/net-print/cups/cups-2.4.2-r4.ebuild b/net-print/cups/cups-2.4.2-r4.ebuild
deleted file mode 100644
index ba66dc72a90a..000000000000
--- a/net-print/cups/cups-2.4.2-r4.ebuild
+++ /dev/null
@@ -1,319 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit autotools linux-info xdg multilib-minimal optfeature pam toolchain-funcs
-
-MY_PV="${PV/_beta/b}"
-MY_PV="${MY_PV/_rc/rc}"
-MY_PV="${MY_PV/_p/op}"
-MY_P="${PN}-${MY_PV}"
-
-if [[ ${PV} == *9999 ]] ; then
- inherit git-r3
- EGIT_REPO_URI="https://github.com/OpenPrinting/cups.git"
- [[ ${PV} != 9999 ]] && EGIT_BRANCH=branch-${PV/.9999}
-else
- SRC_URI="https://github.com/OpenPrinting/cups/releases/download/v${MY_PV}/cups-${MY_PV}-source.tar.gz"
- if [[ ${PV} != *_beta* ]] && [[ ${PV} != *_rc* ]] ; then
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
- fi
-fi
-
-DESCRIPTION="The Common Unix Printing System"
-HOMEPAGE="https://www.cups.org/ https://github.com/OpenPrinting/cups"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-IUSE="acl dbus debug kerberos openssl pam selinux +ssl static-libs systemd test usb X xinetd zeroconf"
-
-# As of 2.4.2, they don't actually seem to be interactive (they pass some flags
-# by default to input for us), but they fail on some greyscale issue w/ poppler?
-RESTRICT="!test? ( test ) test"
-
-BDEPEND="
- acct-group/lp
- acct-group/lpadmin
- virtual/pkgconfig
-"
-DEPEND="
- app-text/libpaper:=
- sys-libs/zlib
- acl? (
- kernel_linux? (
- sys-apps/acl
- sys-apps/attr
- )
- )
- dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
- kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
- pam? ( sys-libs/pam )
- !pam? ( virtual/libcrypt:= )
- ssl? (
- !openssl? ( >=net-libs/gnutls-2.12.23-r6:0=[${MULTILIB_USEDEP}] )
- openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )
- )
- systemd? ( sys-apps/systemd )
- usb? ( virtual/libusb:1 )
- X? ( x11-misc/xdg-utils )
- xinetd? ( sys-apps/xinetd )
- zeroconf? ( >=net-dns/avahi-0.6.31-r2[dbus,${MULTILIB_USEDEP}] )
-"
-RDEPEND="${DEPEND}
- acct-group/lp
- acct-group/lpadmin
- selinux? ( sec-policy/selinux-cups )
-"
-PDEPEND=">=net-print/cups-filters-1.0.43"
-
-PATCHES=(
- "${FILESDIR}/${PN}-2.4.1-nostrip.patch"
- "${FILESDIR}/${PN}-2.4.1-user-AR.patch"
- "${FILESDIR}/${PN}-2.4.2-no-fortify-override.patch"
-)
-
-MULTILIB_CHOST_TOOLS=(
- /usr/bin/cups-config
-)
-
-S="${WORKDIR}/${MY_P}"
-
-pkg_setup() {
- if use kernel_linux; then
- linux-info_pkg_setup
- if ! linux_config_exists; then
- ewarn "Can't check the linux kernel configuration."
- ewarn "You might have some incompatible options enabled."
- else
- # Recheck that we don't have usblp to collide with libusb; this should now work in most cases (bug #501122)
- if use usb; then
- if linux_chkconfig_present USB_PRINTER; then
- elog "Your USB printers will be managed via libusb. In case you run into problems, "
- elog "please try disabling USB_PRINTER support in your kernel or blacklisting the"
- elog "usblp kernel module."
- elog "Alternatively, just disable the usb useflag for cups (your printer will still work)."
- fi
- else
- if ! linux_chkconfig_present USB_PRINTER; then
- ewarn "If you plan to use USB printers you should enable the USB_PRINTER"
- ewarn "support in your kernel."
- ewarn "Please enable it:"
- ewarn " CONFIG_USB_PRINTER=y"
- ewarn "in /usr/src/linux/.config or"
- ewarn " Device Drivers --->"
- ewarn " USB support --->"
- ewarn " [*] USB Printer support"
- ewarn "Alternatively, enable the usb useflag for cups and use the libusb code."
- fi
- fi
- fi
- fi
-}
-
-src_prepare() {
- default
-
- # Remove ".SILENT" rule for verbose output (bug #524338).
- sed 's#^.SILENT:##g' -i Makedefs.in || die
-
- AT_M4DIR="config-scripts" eautoreconf
-
- # Custom Makefiles
- multilib_copy_sources
-}
-
-multilib_src_configure() {
- export DSOFLAGS="${LDFLAGS}"
-
- # Explicitly specify compiler wrt bug #524340
- #
- # Need to override KRB5CONFIG for proper flags
- # https://github.com/apple/cups/issues/4423
- local myeconfargs=(
- CC="$(tc-getCC)"
- CXX="$(tc-getCXX)"
- KRB5CONFIG="${EPREFIX}"/usr/bin/${CHOST}-krb5-config
- --libdir="${EPREFIX}"/usr/$(get_libdir)
- --localstatedir="${EPREFIX}"/var
- # Follow Fedora permission setting
- --with-cupsd-file-perm=0755
- --with-exe-file-perm=755
- --with-log-file-perm=0640
- # Used by Debian, also prevents printers from getting
- # disabled and users not knowing how to re-enable them
- --with-error-policy=retry-job
- # Used in Debian and Fedora
- --enable-sync-on-close
- #
- --with-rundir="${EPREFIX}"/run/cups
- --with-pkgconfpath="${EPREFIX}"/usr/$(get_libdir)/pkgconfig
- --with-cups-user=lp
- --with-cups-group=lp
- --with-docdir="${EPREFIX}"/usr/share/cups/html
- --with-system-groups=lpadmin
- --with-xinetd="${EPREFIX}"/etc/xinetd.d
- $(multilib_native_use_enable acl)
- $(use_enable dbus)
- $(use_enable debug)
- $(use_enable debug debug-guards)
- $(use_enable debug debug-printfs)
- $(use_enable kerberos gssapi)
- $(multilib_native_use_enable pam)
- $(use_enable static-libs static)
- $(use_enable test unit-tests)
- # USE="ssl" => gnutls
- # USE="ssl openssl" => openssl
- $(use_with ssl tls $(usex openssl openssl gnutls))
- $(use_with systemd ondemand systemd)
- $(multilib_native_use_enable usb libusb)
- $(use_with zeroconf dnssd avahi)
- $(multilib_is_native_abi && echo --enable-libpaper || echo --disable-libpaper)
- )
-
- # Handle empty LINGUAS properly, bug #771162
- if [[ -n "${LINGUAS+x}" ]] ; then
- myeconfargs+=(
- --with-languages="${LINGUAS}"
- )
- fi
-
- if tc-is-static-only; then
- myeconfargs+=(
- --disable-shared
- )
- fi
-
- # Install in /usr/libexec always, instead of using /usr/lib/cups, as that
- # makes more sense when facing multilib support.
- sed -i -e 's:CUPS_SERVERBIN="$exec_prefix/lib/cups":CUPS_SERVERBIN="$exec_prefix/libexec/cups":g' configure ||die
-
- # Don't use the libtool build
- # https://bugs.gentoo.org/843638
- # https://github.com/OpenPrinting/cups/pull/394
- unset LIBTOOL
-
- econf "${myeconfargs[@]}"
-
- sed -i -e "s:SERVERBIN.*:SERVERBIN = \"\$\(BUILDROOT\)${EPREFIX}/usr/libexec/cups\":" Makedefs || die
- sed -i -e "s:#define CUPS_SERVERBIN.*:#define CUPS_SERVERBIN \"${EPREFIX}/usr/libexec/cups\":" config.h || die
- sed -i -e "s:cups_serverbin=.*:cups_serverbin=\"${EPREFIX}/usr/libexec/cups\":" cups-config || die
-
- # Additional path corrections needed for prefix, see bug #597728
- sed \
- -e "s:ICONDIR.*:ICONDIR = ${EPREFIX}/usr/share/icons:" \
- -e "s:INITDIR.*:INITDIR = ${EPREFIX}/etc:" \
- -e "s:DBUSDIR.*:DBUSDIR = ${EPREFIX}/etc/dbus-1:" \
- -e "s:MENUDIR.*:MENUDIR = ${EPREFIX}/usr/share/applications:" \
- -i Makedefs || die
-}
-
-multilib_src_compile() {
- if multilib_is_native_abi; then
- default
- else
- emake libs
- fi
-}
-
-multilib_src_test() {
- # Avoid using /tmp
- export CUPS_TESTBASE="${T}"/cups-tests
-
- mkdir "${T}"/cups-tests || die
-
- # We only build some of CUPS for multilib, so can't run the tests.
- multilib_is_native_abi && default
-}
-
-multilib_src_install() {
- if multilib_is_native_abi; then
- emake BUILDROOT="${D}" install
- else
- emake BUILDROOT="${D}" install-libs install-headers
- dobin cups-config
- fi
-}
-
-multilib_src_install_all() {
- dodoc {CHANGES,CREDITS,README}.md
-
- # Move the default config file to docs
- dodoc "${ED}"/etc/cups/cupsd.conf.default
- rm "${ED}"/etc/cups/cupsd.conf.default || die
-
- # Clean out cups init scripts
- rm -r "${ED}"/etc/{init.d/cups,rc*} || die
-
- # Install our init script
- local neededservices=(
- $(usex zeroconf avahi-daemon '')
- $(usex dbus dbus '')
- )
- [[ -n ${neededservices[@]} ]] && neededservices="need ${neededservices[@]}"
- cp "${FILESDIR}"/cupsd.init.d-r4 "${T}"/cupsd || die
- sed -i -e "s/@neededservices@/${neededservices}/" "${T}"/cupsd || die
- doinitd "${T}"/cupsd
-
- if use pam ; then
- rm "${ED}"/etc/pam.d/${PN} || die
- pamd_mimic_system cups auth account
- fi
-
- if use xinetd ; then
- # Correct path
- sed -i -e "s:server = .*:server = /usr/libexec/cups/daemon/cups-lpd:" \
- "${ED}"/etc/xinetd.d/cups-lpd || die
- # It is safer to disable this by default, bug #137130
- grep -w 'disable' "${ED}"/etc/xinetd.d/cups-lpd || \
- { sed -i -e "s:}:\tdisable = yes\n}:" "${ED}"/etc/xinetd.d/cups-lpd || die ; }
- # Write permission for file owner (root), bug #296221
- fperms u+w /etc/xinetd.d/cups-lpd
- else
- # Always configure with --with-xinetd= and clean up later,
- # bug #525604
- rm -r "${ED}"/etc/xinetd.d || die
- fi
-
- keepdir /etc/cups/{interfaces,ppd,ssl}
-
- if ! use X ; then
- rm -r "${ED}"/usr/share/applications || die
- fi
-
- # Create /etc/cups/client.conf, bug #196967 and bug #266678
- echo "ServerName ${EPREFIX}/run/cups/cups.sock" >> "${ED}"/etc/cups/client.conf
-
- # The following file is now provided by cups-filter:
- rm -r "${ED}"/usr/share/cups/banners || die
-
- # The following are created by the init script
- rm -r "${ED}"/var/cache || die
- rm -r "${ED}"/run || die
-
- keepdir /usr/libexec/cups/driver /usr/share/cups/{model,profiles} /var/log/cups /var/spool/cups/tmp
-}
-
-pkg_postinst() {
- xdg_pkg_postinst
- local v
-
- for v in ${REPLACING_VERSIONS}; do
- if ! ver_test ${v} -ge 2.2.2-r2 ; then
- ewarn "The cupsd init script switched to using pidfiles. Shutting down"
- ewarn "cupsd will fail the next time. To fix this, please run once as root"
- ewarn " killall cupsd ; /etc/init.d/cupsd zap ; /etc/init.d/cupsd start"
- break
- fi
- done
-
- for v in ${REPLACING_VERSIONS}; do
- elog
- elog "For information about installing a printer and general cups setup"
- elog "take a look at: https://wiki.gentoo.org/wiki/Printing"
- break
- done
-
- optfeature_header "CUPS may need installing the following for certain features to work:"
- use zeroconf && optfeature "local hostname resolution using a hostname.local naming scheme" sys-auth/nss-mdns
-}
diff --git a/net-print/cups/cups-2.4.2-r5.ebuild b/net-print/cups/cups-2.4.2-r5.ebuild
deleted file mode 100644
index f79804831192..000000000000
--- a/net-print/cups/cups-2.4.2-r5.ebuild
+++ /dev/null
@@ -1,320 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit autotools linux-info xdg multilib-minimal optfeature pam toolchain-funcs
-
-MY_PV="${PV/_beta/b}"
-MY_PV="${MY_PV/_rc/rc}"
-MY_PV="${MY_PV/_p/op}"
-MY_P="${PN}-${MY_PV}"
-
-if [[ ${PV} == *9999 ]] ; then
- inherit git-r3
- EGIT_REPO_URI="https://github.com/OpenPrinting/cups.git"
- [[ ${PV} != 9999 ]] && EGIT_BRANCH=branch-${PV/.9999}
-else
- SRC_URI="https://github.com/OpenPrinting/cups/releases/download/v${MY_PV}/cups-${MY_PV}-source.tar.gz"
- if [[ ${PV} != *_beta* ]] && [[ ${PV} != *_rc* ]] ; then
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
- fi
-fi
-
-DESCRIPTION="The Common Unix Printing System"
-HOMEPAGE="https://www.cups.org/ https://github.com/OpenPrinting/cups"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-IUSE="acl dbus debug kerberos openssl pam selinux +ssl static-libs systemd test usb X xinetd zeroconf"
-
-# As of 2.4.2, they don't actually seem to be interactive (they pass some flags
-# by default to input for us), but they fail on some greyscale issue w/ poppler?
-RESTRICT="!test? ( test ) test"
-
-BDEPEND="
- acct-group/lp
- acct-group/lpadmin
- virtual/pkgconfig
-"
-DEPEND="
- app-text/libpaper:=
- sys-libs/zlib
- acl? (
- kernel_linux? (
- sys-apps/acl
- sys-apps/attr
- )
- )
- dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
- kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
- pam? ( sys-libs/pam )
- !pam? ( virtual/libcrypt:= )
- ssl? (
- !openssl? ( >=net-libs/gnutls-2.12.23-r6:0=[${MULTILIB_USEDEP}] )
- openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )
- )
- systemd? ( sys-apps/systemd )
- usb? ( virtual/libusb:1 )
- X? ( x11-misc/xdg-utils )
- xinetd? ( sys-apps/xinetd )
- zeroconf? ( >=net-dns/avahi-0.6.31-r2[dbus,${MULTILIB_USEDEP}] )
-"
-RDEPEND="${DEPEND}
- acct-group/lp
- acct-group/lpadmin
- selinux? ( sec-policy/selinux-cups )
-"
-PDEPEND=">=net-print/cups-filters-1.0.43"
-
-PATCHES=(
- "${FILESDIR}/${PN}-2.4.1-nostrip.patch"
- "${FILESDIR}/${PN}-2.4.1-user-AR.patch"
- "${FILESDIR}/${PN}-2.4.2-no-fortify-override.patch"
-)
-
-MULTILIB_CHOST_TOOLS=(
- /usr/bin/cups-config
-)
-
-S="${WORKDIR}/${MY_P}"
-
-pkg_setup() {
- if use kernel_linux; then
- linux-info_pkg_setup
- if ! linux_config_exists; then
- ewarn "Can't check the linux kernel configuration."
- ewarn "You might have some incompatible options enabled."
- else
- # Recheck that we don't have usblp to collide with libusb; this should now work in most cases (bug #501122)
- if use usb; then
- if linux_chkconfig_present USB_PRINTER; then
- elog "Your USB printers will be managed via libusb. In case you run into problems, "
- elog "please try disabling USB_PRINTER support in your kernel or blacklisting the"
- elog "usblp kernel module."
- elog "Alternatively, just disable the usb useflag for cups (your printer will still work)."
- fi
- else
- if ! linux_chkconfig_present USB_PRINTER; then
- ewarn "If you plan to use USB printers you should enable the USB_PRINTER"
- ewarn "support in your kernel."
- ewarn "Please enable it:"
- ewarn " CONFIG_USB_PRINTER=y"
- ewarn "in /usr/src/linux/.config or"
- ewarn " Device Drivers --->"
- ewarn " USB support --->"
- ewarn " [*] USB Printer support"
- ewarn "Alternatively, enable the usb useflag for cups and use the libusb code."
- fi
- fi
- fi
- fi
-}
-
-src_prepare() {
- default
-
- # Remove ".SILENT" rule for verbose output (bug #524338).
- sed 's#^.SILENT:##g' -i Makedefs.in || die
-
- AT_M4DIR="config-scripts" eautoreconf
-
- # Custom Makefiles
- multilib_copy_sources
-}
-
-multilib_src_configure() {
- export DSOFLAGS="${LDFLAGS}"
-
- # Explicitly specify compiler wrt bug #524340
- #
- # Need to override KRB5CONFIG for proper flags
- # https://github.com/apple/cups/issues/4423
- local myeconfargs=(
- CC="$(tc-getCC)"
- CXX="$(tc-getCXX)"
- KRB5CONFIG="${EPREFIX}"/usr/bin/${CHOST}-krb5-config
- --libdir="${EPREFIX}"/usr/$(get_libdir)
- --localstatedir="${EPREFIX}"/var
- # Follow Fedora permission setting
- --with-cupsd-file-perm=0755
- --with-exe-file-perm=755
- --with-log-file-perm=0640
- # Used by Debian, also prevents printers from getting
- # disabled and users not knowing how to re-enable them
- --with-error-policy=retry-job
- # Used in Debian and Fedora
- --enable-sync-on-close
- #
- --with-rundir="${EPREFIX}"/run/cups
- --with-pkgconfpath="${EPREFIX}"/usr/$(get_libdir)/pkgconfig
- --with-cups-user=lp
- --with-cups-group=lp
- --with-docdir="${EPREFIX}"/usr/share/cups/html
- # See bug #863221 for adding root
- --with-system-groups="root lpadmin"
- --with-xinetd="${EPREFIX}"/etc/xinetd.d
- $(multilib_native_use_enable acl)
- $(use_enable dbus)
- $(use_enable debug)
- $(use_enable debug debug-guards)
- $(use_enable debug debug-printfs)
- $(use_enable kerberos gssapi)
- $(multilib_native_use_enable pam)
- $(use_enable static-libs static)
- $(use_enable test unit-tests)
- # USE="ssl" => gnutls
- # USE="ssl openssl" => openssl
- $(use_with ssl tls $(usex openssl openssl gnutls))
- $(use_with systemd ondemand systemd)
- $(multilib_native_use_enable usb libusb)
- $(use_with zeroconf dnssd avahi)
- $(multilib_is_native_abi && echo --enable-libpaper || echo --disable-libpaper)
- )
-
- # Handle empty LINGUAS properly, bug #771162
- if [[ -n "${LINGUAS+x}" ]] ; then
- myeconfargs+=(
- --with-languages="${LINGUAS}"
- )
- fi
-
- if tc-is-static-only; then
- myeconfargs+=(
- --disable-shared
- )
- fi
-
- # Install in /usr/libexec always, instead of using /usr/lib/cups, as that
- # makes more sense when facing multilib support.
- sed -i -e 's:CUPS_SERVERBIN="$exec_prefix/lib/cups":CUPS_SERVERBIN="$exec_prefix/libexec/cups":g' configure ||die
-
- # Don't use the libtool build
- # https://bugs.gentoo.org/843638
- # https://github.com/OpenPrinting/cups/pull/394
- unset LIBTOOL
-
- econf "${myeconfargs[@]}"
-
- sed -i -e "s:SERVERBIN.*:SERVERBIN = \"\$\(BUILDROOT\)${EPREFIX}/usr/libexec/cups\":" Makedefs || die
- sed -i -e "s:#define CUPS_SERVERBIN.*:#define CUPS_SERVERBIN \"${EPREFIX}/usr/libexec/cups\":" config.h || die
- sed -i -e "s:cups_serverbin=.*:cups_serverbin=\"${EPREFIX}/usr/libexec/cups\":" cups-config || die
-
- # Additional path corrections needed for prefix, see bug #597728
- sed \
- -e "s:ICONDIR.*:ICONDIR = ${EPREFIX}/usr/share/icons:" \
- -e "s:INITDIR.*:INITDIR = ${EPREFIX}/etc:" \
- -e "s:DBUSDIR.*:DBUSDIR = ${EPREFIX}/etc/dbus-1:" \
- -e "s:MENUDIR.*:MENUDIR = ${EPREFIX}/usr/share/applications:" \
- -i Makedefs || die
-}
-
-multilib_src_compile() {
- if multilib_is_native_abi; then
- default
- else
- emake libs
- fi
-}
-
-multilib_src_test() {
- # Avoid using /tmp
- export CUPS_TESTBASE="${T}"/cups-tests
-
- mkdir "${T}"/cups-tests || die
-
- # We only build some of CUPS for multilib, so can't run the tests.
- multilib_is_native_abi && default
-}
-
-multilib_src_install() {
- if multilib_is_native_abi; then
- emake BUILDROOT="${D}" install
- else
- emake BUILDROOT="${D}" install-libs install-headers
- dobin cups-config
- fi
-}
-
-multilib_src_install_all() {
- dodoc {CHANGES,CREDITS,README}.md
-
- # Move the default config file to docs
- dodoc "${ED}"/etc/cups/cupsd.conf.default
- rm "${ED}"/etc/cups/cupsd.conf.default || die
-
- # Clean out cups init scripts
- rm -r "${ED}"/etc/{init.d/cups,rc*} || die
-
- # Install our init script
- local neededservices=(
- $(usex zeroconf avahi-daemon '')
- $(usex dbus dbus '')
- )
- [[ -n ${neededservices[@]} ]] && neededservices="need ${neededservices[@]}"
- cp "${FILESDIR}"/cupsd.init.d-r4 "${T}"/cupsd || die
- sed -i -e "s/@neededservices@/${neededservices}/" "${T}"/cupsd || die
- doinitd "${T}"/cupsd
-
- if use pam ; then
- rm "${ED}"/etc/pam.d/${PN} || die
- pamd_mimic_system cups auth account
- fi
-
- if use xinetd ; then
- # Correct path
- sed -i -e "s:server = .*:server = /usr/libexec/cups/daemon/cups-lpd:" \
- "${ED}"/etc/xinetd.d/cups-lpd || die
- # It is safer to disable this by default, bug #137130
- grep -w 'disable' "${ED}"/etc/xinetd.d/cups-lpd || \
- { sed -i -e "s:}:\tdisable = yes\n}:" "${ED}"/etc/xinetd.d/cups-lpd || die ; }
- # Write permission for file owner (root), bug #296221
- fperms u+w /etc/xinetd.d/cups-lpd
- else
- # Always configure with --with-xinetd= and clean up later,
- # bug #525604
- rm -r "${ED}"/etc/xinetd.d || die
- fi
-
- keepdir /etc/cups/{interfaces,ppd,ssl}
-
- if ! use X ; then
- rm -r "${ED}"/usr/share/applications || die
- fi
-
- # Create /etc/cups/client.conf, bug #196967 and bug #266678
- echo "ServerName ${EPREFIX}/run/cups/cups.sock" >> "${ED}"/etc/cups/client.conf
-
- # The following file is now provided by cups-filter:
- rm -r "${ED}"/usr/share/cups/banners || die
-
- # The following are created by the init script
- rm -r "${ED}"/var/cache || die
- rm -r "${ED}"/run || die
-
- keepdir /usr/libexec/cups/driver /usr/share/cups/{model,profiles} /var/log/cups /var/spool/cups/tmp
-}
-
-pkg_postinst() {
- xdg_pkg_postinst
- local v
-
- for v in ${REPLACING_VERSIONS}; do
- if ! ver_test ${v} -ge 2.2.2-r2 ; then
- ewarn "The cupsd init script switched to using pidfiles. Shutting down"
- ewarn "cupsd will fail the next time. To fix this, please run once as root"
- ewarn " killall cupsd ; /etc/init.d/cupsd zap ; /etc/init.d/cupsd start"
- break
- fi
- done
-
- for v in ${REPLACING_VERSIONS}; do
- elog
- elog "For information about installing a printer and general cups setup"
- elog "take a look at: https://wiki.gentoo.org/wiki/Printing"
- break
- done
-
- optfeature_header "CUPS may need installing the following for certain features to work:"
- use zeroconf && optfeature "local hostname resolution using a hostname.local naming scheme" sys-auth/nss-mdns
-}
diff --git a/net-print/cups/cups-2.4.2-r6.ebuild b/net-print/cups/cups-2.4.2-r6.ebuild
deleted file mode 100644
index cca046d335e0..000000000000
--- a/net-print/cups/cups-2.4.2-r6.ebuild
+++ /dev/null
@@ -1,321 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit autotools linux-info xdg multilib-minimal optfeature pam toolchain-funcs
-
-MY_PV="${PV/_beta/b}"
-MY_PV="${MY_PV/_rc/rc}"
-MY_PV="${MY_PV/_p/op}"
-MY_P="${PN}-${MY_PV}"
-
-if [[ ${PV} == *9999 ]] ; then
- inherit git-r3
- EGIT_REPO_URI="https://github.com/OpenPrinting/cups.git"
- [[ ${PV} != 9999 ]] && EGIT_BRANCH=branch-${PV/.9999}
-else
- SRC_URI="https://github.com/OpenPrinting/cups/releases/download/v${MY_PV}/cups-${MY_PV}-source.tar.gz"
- if [[ ${PV} != *_beta* ]] && [[ ${PV} != *_rc* ]] ; then
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
- fi
-fi
-
-DESCRIPTION="The Common Unix Printing System"
-HOMEPAGE="https://www.cups.org/ https://github.com/OpenPrinting/cups"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-IUSE="acl dbus debug kerberos openssl pam selinux +ssl static-libs systemd test usb X xinetd zeroconf"
-
-# As of 2.4.2, they don't actually seem to be interactive (they pass some flags
-# by default to input for us), but they fail on some greyscale issue w/ poppler?
-RESTRICT="!test? ( test ) test"
-
-BDEPEND="
- acct-group/lp
- acct-group/lpadmin
- virtual/pkgconfig
-"
-DEPEND="
- app-text/libpaper:=
- sys-libs/zlib
- acl? (
- kernel_linux? (
- sys-apps/acl
- sys-apps/attr
- )
- )
- dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
- kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
- pam? ( sys-libs/pam )
- !pam? ( virtual/libcrypt:= )
- ssl? (
- !openssl? ( >=net-libs/gnutls-2.12.23-r6:0=[${MULTILIB_USEDEP}] )
- openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )
- )
- systemd? ( sys-apps/systemd )
- usb? ( virtual/libusb:1 )
- X? ( x11-misc/xdg-utils )
- xinetd? ( sys-apps/xinetd )
- zeroconf? ( >=net-dns/avahi-0.6.31-r2[dbus,${MULTILIB_USEDEP}] )
-"
-RDEPEND="${DEPEND}
- acct-group/lp
- acct-group/lpadmin
- selinux? ( sec-policy/selinux-cups )
-"
-PDEPEND=">=net-print/cups-filters-1.0.43"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-2.4.1-nostrip.patch
- "${FILESDIR}"/${PN}-2.4.1-user-AR.patch
- "${FILESDIR}"/${PN}-2.4.2-no-fortify-override.patch
- "${FILESDIR}"/${P}-openssl-intermediate-certs.patch
-)
-
-MULTILIB_CHOST_TOOLS=(
- /usr/bin/cups-config
-)
-
-S="${WORKDIR}/${MY_P}"
-
-pkg_setup() {
- if use kernel_linux; then
- linux-info_pkg_setup
- if ! linux_config_exists; then
- ewarn "Can't check the linux kernel configuration."
- ewarn "You might have some incompatible options enabled."
- else
- # Recheck that we don't have usblp to collide with libusb; this should now work in most cases (bug #501122)
- if use usb; then
- if linux_chkconfig_present USB_PRINTER; then
- elog "Your USB printers will be managed via libusb. In case you run into problems, "
- elog "please try disabling USB_PRINTER support in your kernel or blacklisting the"
- elog "usblp kernel module."
- elog "Alternatively, just disable the usb useflag for cups (your printer will still work)."
- fi
- else
- if ! linux_chkconfig_present USB_PRINTER; then
- ewarn "If you plan to use USB printers you should enable the USB_PRINTER"
- ewarn "support in your kernel."
- ewarn "Please enable it:"
- ewarn " CONFIG_USB_PRINTER=y"
- ewarn "in /usr/src/linux/.config or"
- ewarn " Device Drivers --->"
- ewarn " USB support --->"
- ewarn " [*] USB Printer support"
- ewarn "Alternatively, enable the usb useflag for cups and use the libusb code."
- fi
- fi
- fi
- fi
-}
-
-src_prepare() {
- default
-
- # Remove ".SILENT" rule for verbose output (bug #524338).
- sed 's#^.SILENT:##g' -i Makedefs.in || die
-
- AT_M4DIR="config-scripts" eautoreconf
-
- # Custom Makefiles
- multilib_copy_sources
-}
-
-multilib_src_configure() {
- export DSOFLAGS="${LDFLAGS}"
-
- # Explicitly specify compiler wrt bug #524340
- #
- # Need to override KRB5CONFIG for proper flags
- # https://github.com/apple/cups/issues/4423
- local myeconfargs=(
- CC="$(tc-getCC)"
- CXX="$(tc-getCXX)"
- KRB5CONFIG="${EPREFIX}"/usr/bin/${CHOST}-krb5-config
- --libdir="${EPREFIX}"/usr/$(get_libdir)
- --localstatedir="${EPREFIX}"/var
- # Follow Fedora permission setting
- --with-cupsd-file-perm=0755
- --with-exe-file-perm=755
- --with-log-file-perm=0640
- # Used by Debian, also prevents printers from getting
- # disabled and users not knowing how to re-enable them
- --with-error-policy=retry-job
- # Used in Debian and Fedora
- --enable-sync-on-close
- #
- --with-rundir="${EPREFIX}"/run/cups
- --with-pkgconfpath="${EPREFIX}"/usr/$(get_libdir)/pkgconfig
- --with-cups-user=lp
- --with-cups-group=lp
- --with-docdir="${EPREFIX}"/usr/share/cups/html
- # See bug #863221 for adding root
- --with-system-groups="root lpadmin"
- --with-xinetd="${EPREFIX}"/etc/xinetd.d
- $(multilib_native_use_enable acl)
- $(use_enable dbus)
- $(use_enable debug)
- $(use_enable debug debug-guards)
- $(use_enable debug debug-printfs)
- $(use_enable kerberos gssapi)
- $(multilib_native_use_enable pam)
- $(use_enable static-libs static)
- $(use_enable test unit-tests)
- # USE="ssl" => gnutls
- # USE="ssl openssl" => openssl
- $(use_with ssl tls $(usex openssl openssl gnutls))
- $(use_with systemd ondemand systemd)
- $(multilib_native_use_enable usb libusb)
- $(use_with zeroconf dnssd avahi)
- $(multilib_is_native_abi && echo --enable-libpaper || echo --disable-libpaper)
- )
-
- # Handle empty LINGUAS properly, bug #771162
- if [[ -n "${LINGUAS+x}" ]] ; then
- myeconfargs+=(
- --with-languages="${LINGUAS}"
- )
- fi
-
- if tc-is-static-only; then
- myeconfargs+=(
- --disable-shared
- )
- fi
-
- # Install in /usr/libexec always, instead of using /usr/lib/cups, as that
- # makes more sense when facing multilib support.
- sed -i -e 's:CUPS_SERVERBIN="$exec_prefix/lib/cups":CUPS_SERVERBIN="$exec_prefix/libexec/cups":g' configure ||die
-
- # Don't use the libtool build
- # https://bugs.gentoo.org/843638
- # https://github.com/OpenPrinting/cups/pull/394
- unset LIBTOOL
-
- econf "${myeconfargs[@]}"
-
- sed -i -e "s:SERVERBIN.*:SERVERBIN = \"\$\(BUILDROOT\)${EPREFIX}/usr/libexec/cups\":" Makedefs || die
- sed -i -e "s:#define CUPS_SERVERBIN.*:#define CUPS_SERVERBIN \"${EPREFIX}/usr/libexec/cups\":" config.h || die
- sed -i -e "s:cups_serverbin=.*:cups_serverbin=\"${EPREFIX}/usr/libexec/cups\":" cups-config || die
-
- # Additional path corrections needed for prefix, see bug #597728
- sed \
- -e "s:ICONDIR.*:ICONDIR = ${EPREFIX}/usr/share/icons:" \
- -e "s:INITDIR.*:INITDIR = ${EPREFIX}/etc:" \
- -e "s:DBUSDIR.*:DBUSDIR = ${EPREFIX}/etc/dbus-1:" \
- -e "s:MENUDIR.*:MENUDIR = ${EPREFIX}/usr/share/applications:" \
- -i Makedefs || die
-}
-
-multilib_src_compile() {
- if multilib_is_native_abi; then
- default
- else
- emake libs
- fi
-}
-
-multilib_src_test() {
- # Avoid using /tmp
- export CUPS_TESTBASE="${T}"/cups-tests
-
- mkdir "${T}"/cups-tests || die
-
- # We only build some of CUPS for multilib, so can't run the tests.
- multilib_is_native_abi && default
-}
-
-multilib_src_install() {
- if multilib_is_native_abi; then
- emake BUILDROOT="${D}" install
- else
- emake BUILDROOT="${D}" install-libs install-headers
- dobin cups-config
- fi
-}
-
-multilib_src_install_all() {
- dodoc {CHANGES,CREDITS,README}.md
-
- # Move the default config file to docs
- dodoc "${ED}"/etc/cups/cupsd.conf.default
- rm "${ED}"/etc/cups/cupsd.conf.default || die
-
- # Clean out cups init scripts
- rm -r "${ED}"/etc/{init.d/cups,rc*} || die
-
- # Install our init script
- local neededservices=(
- $(usex zeroconf avahi-daemon '')
- $(usex dbus dbus '')
- )
- [[ -n ${neededservices[@]} ]] && neededservices="need ${neededservices[@]}"
- cp "${FILESDIR}"/cupsd.init.d-r4 "${T}"/cupsd || die
- sed -i -e "s/@neededservices@/${neededservices}/" "${T}"/cupsd || die
- doinitd "${T}"/cupsd
-
- if use pam ; then
- rm "${ED}"/etc/pam.d/${PN} || die
- pamd_mimic_system cups auth account
- fi
-
- if use xinetd ; then
- # Correct path
- sed -i -e "s:server = .*:server = /usr/libexec/cups/daemon/cups-lpd:" \
- "${ED}"/etc/xinetd.d/cups-lpd || die
- # It is safer to disable this by default, bug #137130
- grep -w 'disable' "${ED}"/etc/xinetd.d/cups-lpd || \
- { sed -i -e "s:}:\tdisable = yes\n}:" "${ED}"/etc/xinetd.d/cups-lpd || die ; }
- # Write permission for file owner (root), bug #296221
- fperms u+w /etc/xinetd.d/cups-lpd
- else
- # Always configure with --with-xinetd= and clean up later,
- # bug #525604
- rm -r "${ED}"/etc/xinetd.d || die
- fi
-
- keepdir /etc/cups/{interfaces,ppd,ssl}
-
- if ! use X ; then
- rm -r "${ED}"/usr/share/applications || die
- fi
-
- # Create /etc/cups/client.conf, bug #196967 and bug #266678
- echo "ServerName ${EPREFIX}/run/cups/cups.sock" >> "${ED}"/etc/cups/client.conf
-
- # The following file is now provided by cups-filter:
- rm -r "${ED}"/usr/share/cups/banners || die
-
- # The following are created by the init script
- rm -r "${ED}"/var/cache || die
- rm -r "${ED}"/run || die
-
- keepdir /usr/libexec/cups/driver /usr/share/cups/{model,profiles} /var/log/cups /var/spool/cups/tmp
-}
-
-pkg_postinst() {
- xdg_pkg_postinst
- local v
-
- for v in ${REPLACING_VERSIONS}; do
- if ! ver_test ${v} -ge 2.2.2-r2 ; then
- ewarn "The cupsd init script switched to using pidfiles. Shutting down"
- ewarn "cupsd will fail the next time. To fix this, please run once as root"
- ewarn " killall cupsd ; /etc/init.d/cupsd zap ; /etc/init.d/cupsd start"
- break
- fi
- done
-
- for v in ${REPLACING_VERSIONS}; do
- elog
- elog "For information about installing a printer and general cups setup"
- elog "take a look at: https://wiki.gentoo.org/wiki/Printing"
- break
- done
-
- optfeature_header "CUPS may need installing the following for certain features to work:"
- use zeroconf && optfeature "local hostname resolution using a hostname.local naming scheme" sys-auth/nss-mdns
-}