Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "An Internet printing system for Unix" |
Brad Bishop | f3f93bb | 2019-10-16 14:33:32 -0400 | [diff] [blame] | 2 | DESCRIPTION = "The Common UNIX Printing System is a printing system and \ |
| 3 | general replacement for lpd and the like. It supports the Internet Printing \ |
| 4 | Protocol (IPP), and has its own filtering driver model for handling various \ |
| 5 | document types." |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 6 | HOMEPAGE = "https://www.cups.org/" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 7 | SECTION = "console/utils" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 8 | LICENSE = "Apache-2.0" |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 9 | DEPENDS = "libpng jpeg dbus zlib libusb1" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 10 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 11 | SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/cups-${PV}-source.tar.gz \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 12 | file://0001-use-echo-only-in-init.patch \ |
| 13 | file://0002-don-t-try-to-run-generated-binaries.patch \ |
Andrew Geissler | 5f35090 | 2021-07-23 13:09:54 -0400 | [diff] [blame] | 14 | file://libexecdir.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 15 | file://0004-cups-fix-multilib-install-file-conflicts.patch \ |
| 16 | file://volatiles.99_cups \ |
| 17 | file://cups-volatiles.conf \ |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 18 | file://CVE-2023-32324.patch \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 19 | " |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 20 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 21 | GITHUB_BASE_URI = "https://github.com/OpenPrinting/cups/releases" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 22 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 23 | # Issue only applies to MacOS |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 24 | CVE_CHECK_IGNORE += "CVE-2008-1033" |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 25 | # Issue affects pdfdistiller plugin used with but not part of cups |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 26 | CVE_CHECK_IGNORE += "CVE-2009-0032" |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 27 | # This is an Ubuntu only issue. |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 28 | CVE_CHECK_IGNORE += "CVE-2018-6553" |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 29 | # This is fixed in 2.4.2 but the cve-check class still reports it |
| 30 | CVE_CHECK_IGNORE += "CVE-2022-26691" |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 31 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 32 | LEAD_SONAME = "libcupsdriver.so" |
| 33 | |
| 34 | CLEANBROKEN = "1" |
| 35 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 36 | inherit autotools-brokensep binconfig useradd systemd pkgconfig multilib_script github-releases |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 37 | |
| 38 | USERADD_PACKAGES = "${PN}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 39 | GROUPADD_PARAM:${PN} = "--system lpadmin" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 40 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 41 | SYSTEMD_SERVICE:${PN} = "cups.socket cups.path cups.service cups-lpd.socket" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 42 | |
| 43 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 44 | ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 45 | PACKAGECONFIG[avahi] = "--with-dnssd=avahi,--with-dnssd=no,avahi" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 46 | PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 47 | PACKAGECONFIG[gnutls] = "--with-tls=gnutls,--with-tls=no,gnutls" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 48 | PACKAGECONFIG[pam] = "--enable-pam --with-pam-module=unix, --disable-pam, libpam" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 49 | PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd" |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 50 | PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd" |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 51 | PACKAGECONFIG[webif] = "--enable-webif,--disable-webif" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 52 | |
| 53 | EXTRA_OECONF = " \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 54 | --enable-dbus \ |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 55 | --with-dbusdir=${sysconfdir}/dbus-1 \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 56 | --enable-browsing \ |
| 57 | --disable-gssapi \ |
| 58 | --enable-debug \ |
| 59 | --disable-relro \ |
| 60 | --enable-libusb \ |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 61 | --with-system-groups=lpadmin \ |
| 62 | --with-cups-group=lp \ |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 63 | --with-domainsocket=/run/cups/cups.sock \ |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 64 | --with-pkgconfpath=${libdir}/pkgconfig \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 65 | DSOFLAGS='${LDFLAGS}' \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 66 | " |
| 67 | |
| 68 | EXTRA_AUTORECONF += "--exclude=autoheader" |
| 69 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 70 | do_install () { |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 71 | oe_runmake "BUILDROOT=${D}" install |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 72 | |
| 73 | # Remove /var/run from package as cupsd will populate it on startup |
| 74 | rm -fr ${D}/${localstatedir}/run |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 75 | rm -fr ${D}/${localstatedir}/log |
Brad Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 76 | rmdir ${D}/${libexecdir}/${BPN}/driver |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 77 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 78 | # Fix the pam configuration file permissions |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 79 | if ${@bb.utils.contains('PACKAGECONFIG', 'pam', 'true', 'false', d)}; then |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 80 | chmod 0644 ${D}${sysconfdir}/pam.d/cups |
| 81 | fi |
| 82 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 83 | # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES |
| 84 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then |
| 85 | rm -rf ${D}${sysconfdir}/init.d/ |
| 86 | rm -rf ${D}${sysconfdir}/rc* |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 87 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 88 | install -m 0644 ${WORKDIR}/cups-volatiles.conf \ |
| 89 | ${D}${sysconfdir}/tmpfiles.d/cups.conf |
| 90 | else |
| 91 | install -d ${D}${sysconfdir}/default/volatiles |
| 92 | install -m 0644 ${WORKDIR}/volatiles.99_cups \ |
| 93 | ${D}${sysconfdir}/default/volatiles/99_cups |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 94 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 95 | } |
| 96 | |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 97 | PACKAGES =+ "${PN}-lib ${PN}-libimage ${PN}-webif" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 98 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 99 | RDEPENDS:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}" |
| 100 | FILES:${PN} += "${libexecdir}/cups/" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 101 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 102 | FILES:${PN}-lib = "${libdir}/libcups.so.*" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 103 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 104 | FILES:${PN}-libimage = "${libdir}/libcupsimage.so.*" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 105 | |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 106 | # put the html for the web interface into its own PACKAGE |
| 107 | FILES:${PN}-webif += "${datadir}/doc/cups/ ${datadir}/icons/" |
| 108 | RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'webif', '${PN}-webif', '', d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 109 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 110 | CONFFILES:${PN} += "${sysconfdir}/cups/cupsd.conf" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 111 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 112 | MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/cups-config" |
| 113 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 114 | SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess" |
| 115 | cups_sysroot_preprocess () { |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 116 | sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libexecdir}/cups:' |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 117 | } |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 118 | |
| 119 | # -25317 concerns /var/log/cups having lp ownership. Our /var/log/cups is |
| 120 | # root:root, so this doesn't apply. |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 121 | CVE_CHECK_IGNORE += "CVE-2021-25317" |