blob: 244c87001fef4a9c90a08332dfcccd4578d80532 [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"
Brad Bishop96ff1982019-08-19 13:50:42 -04009DEPENDS = "gnutls libpng jpeg dbus zlib libusb1"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050010
Brad Bishop6e60e8b2018-02-01 10:27:11 -050011SRC_URI = "https://github.com/apple/cups/releases/download/v${PV}/${BP}-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 \
14 file://0003-cups_1.4.6.bb-Fix-build-on-ppc64.patch \
15 file://0004-cups-fix-multilib-install-file-conflicts.patch \
16 file://volatiles.99_cups \
17 file://cups-volatiles.conf \
Andrew Geissler90fd73c2021-03-05 15:25:55 -060018 file://CVE-2020-10001.patch \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080019 "
Patrick Williamsc124f4f2015-09-15 14:41:29 -050020
Patrick Williamsc0f7c042017-02-23 20:41:17 -060021UPSTREAM_CHECK_URI = "https://github.com/apple/cups/releases"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050022UPSTREAM_CHECK_REGEX = "cups-(?P<pver>\d+\.\d+(\.\d+)?)-source.tar"
23
Andrew Geisslerd1e89492021-02-12 15:35:20 -060024# Issue only applies to MacOS
25CVE_CHECK_WHITELIST += "CVE-2008-1033"
26# Issue affects pdfdistiller plugin used with but not part of cups
27CVE_CHECK_WHITELIST += "CVE-2009-0032"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060028# This is an Ubuntu only issue.
29CVE_CHECK_WHITELIST += "CVE-2018-6553"
30
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031LEAD_SONAME = "libcupsdriver.so"
32
33CLEANBROKEN = "1"
34
Andrew Geissler82c905d2020-04-13 13:39:40 -050035inherit autotools-brokensep binconfig useradd systemd pkgconfig multilib_script
Patrick Williamsc124f4f2015-09-15 14:41:29 -050036
37USERADD_PACKAGES = "${PN}"
38GROUPADD_PARAM_${PN} = "--system lpadmin"
39
Andrew Geissler5a43b432020-06-13 10:46:56 -050040SYSTEMD_SERVICE_${PN} = "org.cups.cupsd.socket org.cups.cupsd.path org.cups.cupsd.service org.cups.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)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050044PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
45PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"
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 = " \
51 --enable-gnutls \
52 --enable-dbus \
53 --enable-browsing \
54 --disable-gssapi \
55 --enable-debug \
56 --disable-relro \
57 --enable-libusb \
Andrew Geissler90fd73c2021-03-05 15:25:55 -060058 --with-system-groups=lpadmin \
59 --with-cups-group=lp \
Andrew Geissler4c19ea12020-10-27 13:52:24 -050060 --with-domainsocket=/run/cups/cups.sock \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060061 DSOFLAGS='${LDFLAGS}' \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050062 "
63
64EXTRA_AUTORECONF += "--exclude=autoheader"
65
66do_compile () {
67 echo "all:" > man/Makefile
68 echo "libs:" >> man/Makefile
69 echo "install:" >> man/Makefile
70 echo "install-data:" >> man/Makefile
71 echo "install-exec:" >> man/Makefile
72 echo "install-headers:" >> man/Makefile
73 echo "install-libs:" >> man/Makefile
74
75 oe_runmake
76}
77
78do_install () {
79 oe_runmake "DSTROOT=${D}" install
80
81 # Remove /var/run from package as cupsd will populate it on startup
82 rm -fr ${D}/${localstatedir}/run
Andrew Geissler82c905d2020-04-13 13:39:40 -050083 rm -fr ${D}/${localstatedir}/log
Brad Bishop79641f22019-09-10 07:20:22 -040084 rmdir ${D}/${libexecdir}/${BPN}/driver
Patrick Williamsc124f4f2015-09-15 14:41:29 -050085
Patrick Williamsf1e5d692016-03-30 15:21:19 -050086 # Fix the pam configuration file permissions
87 if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
88 chmod 0644 ${D}${sysconfdir}/pam.d/cups
89 fi
90
Patrick Williamsc124f4f2015-09-15 14:41:29 -050091 # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES
92 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then
93 rm -rf ${D}${sysconfdir}/init.d/
94 rm -rf ${D}${sysconfdir}/rc*
Andrew Geissler82c905d2020-04-13 13:39:40 -050095 install -d ${D}${sysconfdir}/tmpfiles.d
96 install -m 0644 ${WORKDIR}/cups-volatiles.conf \
97 ${D}${sysconfdir}/tmpfiles.d/cups.conf
98 else
99 install -d ${D}${sysconfdir}/default/volatiles
100 install -m 0644 ${WORKDIR}/volatiles.99_cups \
101 ${D}${sysconfdir}/default/volatiles/99_cups
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500102 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500103}
104
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500105PACKAGES =+ "${PN}-lib ${PN}-libimage"
106
107RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500108FILES_${PN} += "${libexecdir}/cups/ \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500109 "
110
111FILES_${PN}-lib = "${libdir}/libcups.so.*"
112
113FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*"
114
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500115#package the html for the webgui inside the main packages (~1MB uncompressed)
116
117FILES_${PN} += "${datadir}/doc/cups/images \
118 ${datadir}/doc/cups/*html \
119 ${datadir}/doc/cups/*.css \
120 ${datadir}/icons/ \
121 "
122CONFFILES_${PN} += "${sysconfdir}/cups/cupsd.conf"
123
Andrew Geissler82c905d2020-04-13 13:39:40 -0500124MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/cups-config"
125
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500126SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess"
127cups_sysroot_preprocess () {
Andrew Geissler82c905d2020-04-13 13:39:40 -0500128 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 -0500129}