blob: f6f8637a431503f27f0e6ce6d0775ad9de267ac6 [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 Geissler5f350902021-07-23 13:09:54 -040011SRC_URI = "https://github.com/OpenPrinting/cups/releases/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 Geissler5f350902021-07-23 13:09:54 -040020UPSTREAM_CHECK_URI = "https://github.com/OpenPrinting/cups/releases"
21UPSTREAM_CHECK_REGEX = "cups-(?P<pver>.+)-source.tar"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050022
Andrew Geisslerd1e89492021-02-12 15:35:20 -060023# Issue only applies to MacOS
24CVE_CHECK_WHITELIST += "CVE-2008-1033"
25# Issue affects pdfdistiller plugin used with but not part of cups
26CVE_CHECK_WHITELIST += "CVE-2009-0032"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060027# This is an Ubuntu only issue.
28CVE_CHECK_WHITELIST += "CVE-2018-6553"
29
Patrick Williamsc124f4f2015-09-15 14:41:29 -050030LEAD_SONAME = "libcupsdriver.so"
31
32CLEANBROKEN = "1"
33
Andrew Geissler82c905d2020-04-13 13:39:40 -050034inherit autotools-brokensep binconfig useradd systemd pkgconfig multilib_script
Patrick Williamsc124f4f2015-09-15 14:41:29 -050035
36USERADD_PACKAGES = "${PN}"
Patrick Williams213cb262021-08-07 19:21:33 -050037GROUPADD_PARAM:${PN} = "--system lpadmin"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050038
Patrick Williams213cb262021-08-07 19:21:33 -050039SYSTEMD_SERVICE:${PN} = "cups.socket cups.path cups.service cups-lpd.socket"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050040
41PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050042 ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050043PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
44PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"
Andrew Geisslerc926e172021-05-07 16:11:35 -050045PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls"
Brad Bishop19323692019-04-05 15:28:33 -040046PACKAGECONFIG[pam] = "--enable-pam --with-pam-module=unix, --disable-pam, libpam"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050047PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd"
Patrick Williamsf1e5d692016-03-30 15:21:19 -050048PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050049
50EXTRA_OECONF = " \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050051 --enable-dbus \
52 --enable-browsing \
53 --disable-gssapi \
54 --enable-debug \
55 --disable-relro \
56 --enable-libusb \
Andrew Geissler90fd73c2021-03-05 15:25:55 -060057 --with-system-groups=lpadmin \
58 --with-cups-group=lp \
Andrew Geissler4c19ea12020-10-27 13:52:24 -050059 --with-domainsocket=/run/cups/cups.sock \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060060 DSOFLAGS='${LDFLAGS}' \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050061 "
62
63EXTRA_AUTORECONF += "--exclude=autoheader"
64
Patrick Williamsc124f4f2015-09-15 14:41:29 -050065do_install () {
Andrew Geissler5f350902021-07-23 13:09:54 -040066 oe_runmake "DESTDIR=${D}" install
Patrick Williamsc124f4f2015-09-15 14:41:29 -050067
68 # Remove /var/run from package as cupsd will populate it on startup
69 rm -fr ${D}/${localstatedir}/run
Andrew Geissler82c905d2020-04-13 13:39:40 -050070 rm -fr ${D}/${localstatedir}/log
Brad Bishop79641f22019-09-10 07:20:22 -040071 rmdir ${D}/${libexecdir}/${BPN}/driver
Patrick Williamsc124f4f2015-09-15 14:41:29 -050072
Patrick Williamsf1e5d692016-03-30 15:21:19 -050073 # Fix the pam configuration file permissions
74 if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
75 chmod 0644 ${D}${sysconfdir}/pam.d/cups
76 fi
77
Patrick Williamsc124f4f2015-09-15 14:41:29 -050078 # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES
79 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then
80 rm -rf ${D}${sysconfdir}/init.d/
81 rm -rf ${D}${sysconfdir}/rc*
Andrew Geissler82c905d2020-04-13 13:39:40 -050082 install -d ${D}${sysconfdir}/tmpfiles.d
83 install -m 0644 ${WORKDIR}/cups-volatiles.conf \
84 ${D}${sysconfdir}/tmpfiles.d/cups.conf
85 else
86 install -d ${D}${sysconfdir}/default/volatiles
87 install -m 0644 ${WORKDIR}/volatiles.99_cups \
88 ${D}${sysconfdir}/default/volatiles/99_cups
Patrick Williamsc124f4f2015-09-15 14:41:29 -050089 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050090}
91
Patrick Williamsc124f4f2015-09-15 14:41:29 -050092PACKAGES =+ "${PN}-lib ${PN}-libimage"
93
Patrick Williams213cb262021-08-07 19:21:33 -050094RDEPENDS:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}"
95FILES:${PN} += "${libexecdir}/cups/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050096
Patrick Williams213cb262021-08-07 19:21:33 -050097FILES:${PN}-lib = "${libdir}/libcups.so.*"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050098
Patrick Williams213cb262021-08-07 19:21:33 -050099FILES:${PN}-libimage = "${libdir}/libcupsimage.so.*"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500100
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500101#package the html for the webgui inside the main packages (~1MB uncompressed)
102
Patrick Williams213cb262021-08-07 19:21:33 -0500103FILES:${PN} += "${datadir}/doc/cups/images \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500104 ${datadir}/doc/cups/*html \
105 ${datadir}/doc/cups/*.css \
106 ${datadir}/icons/ \
107 "
Patrick Williams213cb262021-08-07 19:21:33 -0500108CONFFILES:${PN} += "${sysconfdir}/cups/cupsd.conf"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500109
Andrew Geissler82c905d2020-04-13 13:39:40 -0500110MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/cups-config"
111
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500112SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess"
113cups_sysroot_preprocess () {
Andrew Geissler82c905d2020-04-13 13:39:40 -0500114 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 -0500115}
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700116
117# -25317 concerns /var/log/cups having lp ownership. Our /var/log/cups is
118# root:root, so this doesn't apply.
119CVE_CHECK_WHITELIST += "CVE-2021-25317"