blob: da320b108552943b7cc39a06ad10412b5b5f3a15 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "An Internet printing system for Unix"
Brad Bishopf3f93bb2019-10-16 14:33:32 -04002DESCRIPTION = "The Common UNIX Printing System is a printing system and \
3general replacement for lpd and the like. It supports the Internet Printing \
4Protocol (IPP), and has its own filtering driver model for handling various \
5document types."
Brad Bishopd7bf8c12018-02-25 22:55:05 -05006HOMEPAGE = "https://www.cups.org/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05007SECTION = "console/utils"
Andrew Geissler82c905d2020-04-13 13:39:40 -05008LICENSE = "Apache-2.0"
Andrew Geisslerc926e172021-05-07 16:11:35 -05009DEPENDS = "libpng jpeg dbus zlib libusb1"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050010
Andrew Geissler87f5cff2022-09-30 13:13:31 -050011SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/cups-${PV}-source.tar.gz \
Andrew Geissler82c905d2020-04-13 13:39:40 -050012 file://0001-use-echo-only-in-init.patch \
13 file://0002-don-t-try-to-run-generated-binaries.patch \
Andrew Geissler5f350902021-07-23 13:09:54 -040014 file://libexecdir.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050015 file://0004-cups-fix-multilib-install-file-conflicts.patch \
16 file://volatiles.99_cups \
17 file://cups-volatiles.conf \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080018 "
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019
Andrew Geissler87f5cff2022-09-30 13:13:31 -050020GITHUB_BASE_URI = "https://github.com/OpenPrinting/cups/releases"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050021
Andrew Geisslerd1e89492021-02-12 15:35:20 -060022# Issue only applies to MacOS
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000023CVE_CHECK_IGNORE += "CVE-2008-1033"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060024# Issue affects pdfdistiller plugin used with but not part of cups
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000025CVE_CHECK_IGNORE += "CVE-2009-0032"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060026# This is an Ubuntu only issue.
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000027CVE_CHECK_IGNORE += "CVE-2018-6553"
Andrew Geissler615f2f12022-07-15 14:00:58 -050028# This is fixed in 2.4.2 but the cve-check class still reports it
29CVE_CHECK_IGNORE += "CVE-2022-26691"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060030
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031LEAD_SONAME = "libcupsdriver.so"
32
33CLEANBROKEN = "1"
34
Andrew Geissler87f5cff2022-09-30 13:13:31 -050035inherit autotools-brokensep binconfig useradd systemd pkgconfig multilib_script github-releases
Patrick Williamsc124f4f2015-09-15 14:41:29 -050036
37USERADD_PACKAGES = "${PN}"
Patrick Williams213cb262021-08-07 19:21:33 -050038GROUPADD_PARAM:${PN} = "--system lpadmin"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050039
Patrick Williams213cb262021-08-07 19:21:33 -050040SYSTEMD_SERVICE:${PN} = "cups.socket cups.path cups.service cups-lpd.socket"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050041
42PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050043 ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}"
Andrew Geissler595f6302022-01-24 19:11:47 +000044PACKAGECONFIG[avahi] = "--with-dnssd=avahi,--with-dnssd=no,avahi"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"
Andrew Geissler595f6302022-01-24 19:11:47 +000046PACKAGECONFIG[gnutls] = "--with-tls=gnutls,--with-tls=no,gnutls"
Brad Bishop19323692019-04-05 15:28:33 -040047PACKAGECONFIG[pam] = "--enable-pam --with-pam-module=unix, --disable-pam, libpam"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050048PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd"
Patrick Williamsf1e5d692016-03-30 15:21:19 -050049PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd"
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050050PACKAGECONFIG[webif] = "--enable-webif,--disable-webif"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050051
52EXTRA_OECONF = " \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050053 --enable-dbus \
Andrew Geissler9aee5002022-03-30 16:27:02 +000054 --with-dbusdir=${sysconfdir}/dbus-1 \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050055 --enable-browsing \
56 --disable-gssapi \
57 --enable-debug \
58 --disable-relro \
59 --enable-libusb \
Andrew Geissler90fd73c2021-03-05 15:25:55 -060060 --with-system-groups=lpadmin \
61 --with-cups-group=lp \
Andrew Geissler4c19ea12020-10-27 13:52:24 -050062 --with-domainsocket=/run/cups/cups.sock \
Andrew Geissler595f6302022-01-24 19:11:47 +000063 --with-pkgconfpath=${libdir}/pkgconfig \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060064 DSOFLAGS='${LDFLAGS}' \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050065 "
66
67EXTRA_AUTORECONF += "--exclude=autoheader"
68
Patrick Williamsc124f4f2015-09-15 14:41:29 -050069do_install () {
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050070 oe_runmake "BUILDROOT=${D}" install
Patrick Williamsc124f4f2015-09-15 14:41:29 -050071
72 # Remove /var/run from package as cupsd will populate it on startup
73 rm -fr ${D}/${localstatedir}/run
Andrew Geissler82c905d2020-04-13 13:39:40 -050074 rm -fr ${D}/${localstatedir}/log
Brad Bishop79641f22019-09-10 07:20:22 -040075 rmdir ${D}/${libexecdir}/${BPN}/driver
Patrick Williamsc124f4f2015-09-15 14:41:29 -050076
Patrick Williamsf1e5d692016-03-30 15:21:19 -050077 # Fix the pam configuration file permissions
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050078 if ${@bb.utils.contains('PACKAGECONFIG', 'pam', 'true', 'false', d)}; then
Patrick Williamsf1e5d692016-03-30 15:21:19 -050079 chmod 0644 ${D}${sysconfdir}/pam.d/cups
80 fi
81
Patrick Williamsc124f4f2015-09-15 14:41:29 -050082 # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES
83 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then
84 rm -rf ${D}${sysconfdir}/init.d/
85 rm -rf ${D}${sysconfdir}/rc*
Andrew Geissler82c905d2020-04-13 13:39:40 -050086 install -d ${D}${sysconfdir}/tmpfiles.d
87 install -m 0644 ${WORKDIR}/cups-volatiles.conf \
88 ${D}${sysconfdir}/tmpfiles.d/cups.conf
89 else
90 install -d ${D}${sysconfdir}/default/volatiles
91 install -m 0644 ${WORKDIR}/volatiles.99_cups \
92 ${D}${sysconfdir}/default/volatiles/99_cups
Patrick Williamsc124f4f2015-09-15 14:41:29 -050093 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050094}
95
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050096PACKAGES =+ "${PN}-lib ${PN}-libimage ${PN}-webif"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050097
Patrick Williams213cb262021-08-07 19:21:33 -050098RDEPENDS:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}"
99FILES:${PN} += "${libexecdir}/cups/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500100
Patrick Williams213cb262021-08-07 19:21:33 -0500101FILES:${PN}-lib = "${libdir}/libcups.so.*"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500102
Patrick Williams213cb262021-08-07 19:21:33 -0500103FILES:${PN}-libimage = "${libdir}/libcupsimage.so.*"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500104
Andrew Geisslerfc113ea2023-03-31 09:59:46 -0500105# put the html for the web interface into its own PACKAGE
106FILES:${PN}-webif += "${datadir}/doc/cups/ ${datadir}/icons/"
107RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'webif', '${PN}-webif', '', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500108
Patrick Williams213cb262021-08-07 19:21:33 -0500109CONFFILES:${PN} += "${sysconfdir}/cups/cupsd.conf"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500110
Andrew Geissler82c905d2020-04-13 13:39:40 -0500111MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/cups-config"
112
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500113SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess"
114cups_sysroot_preprocess () {
Andrew Geissler82c905d2020-04-13 13:39:40 -0500115 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 Williamsc124f4f2015-09-15 14:41:29 -0500116}
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700117
118# -25317 concerns /var/log/cups having lp ownership. Our /var/log/cups is
119# root:root, so this doesn't apply.
Andrew Geissler7e0e3c02022-02-25 20:34:39 +0000120CVE_CHECK_IGNORE += "CVE-2021-25317"