summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/cups/cups.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/cups/cups.inc')
-rw-r--r--meta/recipes-extended/cups/cups.inc85
1 files changed, 37 insertions, 48 deletions
diff --git a/meta/recipes-extended/cups/cups.inc b/meta/recipes-extended/cups/cups.inc
index 244c87001f..9688efafae 100644
--- a/meta/recipes-extended/cups/cups.inc
+++ b/meta/recipes-extended/cups/cups.inc
@@ -6,77 +6,68 @@ document types."
6HOMEPAGE = "https://www.cups.org/" 6HOMEPAGE = "https://www.cups.org/"
7SECTION = "console/utils" 7SECTION = "console/utils"
8LICENSE = "Apache-2.0" 8LICENSE = "Apache-2.0"
9DEPENDS = "gnutls libpng jpeg dbus zlib libusb1" 9DEPENDS = "libpng jpeg dbus zlib libusb1"
10 10
11SRC_URI = "https://github.com/apple/cups/releases/download/v${PV}/${BP}-source.tar.gz \ 11SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/cups-${PV}-source.tar.gz \
12 file://0001-use-echo-only-in-init.patch \ 12 file://0001-use-echo-only-in-init.patch \
13 file://0002-don-t-try-to-run-generated-binaries.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 \ 14 file://libexecdir.patch \
15 file://0004-cups-fix-multilib-install-file-conflicts.patch \ 15 file://0004-cups-fix-multilib-install-file-conflicts.patch \
16 file://volatiles.99_cups \ 16 file://volatiles.99_cups \
17 file://cups-volatiles.conf \ 17 file://cups-volatiles.conf \
18 file://CVE-2020-10001.patch \
19 " 18 "
20 19
21UPSTREAM_CHECK_URI = "https://github.com/apple/cups/releases" 20GITHUB_BASE_URI = "https://github.com/OpenPrinting/cups/releases"
22UPSTREAM_CHECK_REGEX = "cups-(?P<pver>\d+\.\d+(\.\d+)?)-source.tar"
23 21
24# Issue only applies to MacOS 22CVE_STATUS[CVE-2008-1033] = "not-applicable-platform: Issue only applies to MacOS"
25CVE_CHECK_WHITELIST += "CVE-2008-1033" 23CVE_STATUS[CVE-2009-0032] = "cpe-incorrect: Issue affects pdfdistiller plugin used with but not part of cups"
26# Issue affects pdfdistiller plugin used with but not part of cups 24CVE_STATUS[CVE-2018-6553] = "not-applicable-platform: This is an Ubuntu only issue"
27CVE_CHECK_WHITELIST += "CVE-2009-0032" 25CVE_STATUS[CVE-2022-26691] = "fixed-version: This is fixed in 2.4.2 but the cve-check class still reports it"
28# This is an Ubuntu only issue. 26CVE_STATUS[CVE-2021-25317] = "not-applicable-config: This concerns /var/log/cups having lp ownership, our /var/log/cups is root:root, so this doesn't apply."
29CVE_CHECK_WHITELIST += "CVE-2018-6553"
30 27
31LEAD_SONAME = "libcupsdriver.so" 28LEAD_SONAME = "libcupsdriver.so"
32 29
33CLEANBROKEN = "1" 30CLEANBROKEN = "1"
34 31
35inherit autotools-brokensep binconfig useradd systemd pkgconfig multilib_script 32inherit autotools-brokensep binconfig useradd systemd pkgconfig multilib_script github-releases
36 33
37USERADD_PACKAGES = "${PN}" 34USERADD_PACKAGES = "${PN}"
38GROUPADD_PARAM_${PN} = "--system lpadmin" 35GROUPADD_PARAM:${PN} = "--system lpadmin"
39 36
40SYSTEMD_SERVICE_${PN} = "org.cups.cupsd.socket org.cups.cupsd.path org.cups.cupsd.service org.cups.cups-lpd.socket" 37SYSTEMD_SERVICE:${PN} = "cups.socket cups.path cups.service cups-lpd.socket"
41 38
42PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \ 39PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
43 ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}" 40 ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)} \
44PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi" 41 openssl \
42"
43PACKAGECONFIG[avahi] = "--with-dnssd=avahi,--with-dnssd=no,avahi"
45PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl" 44PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"
45PACKAGECONFIG[gnutls] = "--with-tls=gnutls,,gnutls,,,openssl"
46PACKAGECONFIG[openssl] = "--with-tls=openssl,,openssl,,,gnutls"
46PACKAGECONFIG[pam] = "--enable-pam --with-pam-module=unix, --disable-pam, libpam" 47PACKAGECONFIG[pam] = "--enable-pam --with-pam-module=unix, --disable-pam, libpam"
47PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd" 48PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd"
48PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd" 49PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd"
50PACKAGECONFIG[webif] = "--enable-webif,--disable-webif"
49 51
50EXTRA_OECONF = " \ 52EXTRA_OECONF = " \
51 --enable-gnutls \
52 --enable-dbus \ 53 --enable-dbus \
54 --with-dbusdir=${sysconfdir}/dbus-1 \
53 --enable-browsing \ 55 --enable-browsing \
54 --disable-gssapi \ 56 --disable-gssapi \
55 --enable-debug \ 57 --enable-debug \
56 --disable-relro \ 58 --disable-relro \
57 --enable-libusb \ 59 --enable-libusb \
58 --with-system-groups=lpadmin \ 60 --with-system-groups=lpadmin,root,sys,wheel \
59 --with-cups-group=lp \ 61 --with-cups-group=lp \
60 --with-domainsocket=/run/cups/cups.sock \ 62 --with-domainsocket=/run/cups/cups.sock \
63 --with-pkgconfpath=${libdir}/pkgconfig \
61 DSOFLAGS='${LDFLAGS}' \ 64 DSOFLAGS='${LDFLAGS}' \
62 " 65 "
63 66
64EXTRA_AUTORECONF += "--exclude=autoheader" 67EXTRA_AUTORECONF += "--exclude=autoheader"
65 68
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 () { 69do_install () {
79 oe_runmake "DSTROOT=${D}" install 70 oe_runmake "BUILDROOT=${D}" install
80 71
81 # Remove /var/run from package as cupsd will populate it on startup 72 # Remove /var/run from package as cupsd will populate it on startup
82 rm -fr ${D}/${localstatedir}/run 73 rm -fr ${D}/${localstatedir}/run
@@ -84,7 +75,7 @@ do_install () {
84 rmdir ${D}/${libexecdir}/${BPN}/driver 75 rmdir ${D}/${libexecdir}/${BPN}/driver
85 76
86 # Fix the pam configuration file permissions 77 # Fix the pam configuration file permissions
87 if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then 78 if ${@bb.utils.contains('PACKAGECONFIG', 'pam', 'true', 'false', d)}; then
88 chmod 0644 ${D}${sysconfdir}/pam.d/cups 79 chmod 0644 ${D}${sysconfdir}/pam.d/cups
89 fi 80 fi
90 81
@@ -93,36 +84,34 @@ do_install () {
93 rm -rf ${D}${sysconfdir}/init.d/ 84 rm -rf ${D}${sysconfdir}/init.d/
94 rm -rf ${D}${sysconfdir}/rc* 85 rm -rf ${D}${sysconfdir}/rc*
95 install -d ${D}${sysconfdir}/tmpfiles.d 86 install -d ${D}${sysconfdir}/tmpfiles.d
96 install -m 0644 ${WORKDIR}/cups-volatiles.conf \ 87 install -m 0644 ${UNPACKDIR}/cups-volatiles.conf \
97 ${D}${sysconfdir}/tmpfiles.d/cups.conf 88 ${D}${sysconfdir}/tmpfiles.d/cups.conf
98 else 89 else
99 install -d ${D}${sysconfdir}/default/volatiles 90 install -d ${D}${sysconfdir}/default/volatiles
100 install -m 0644 ${WORKDIR}/volatiles.99_cups \ 91 install -m 0644 ${UNPACKDIR}/volatiles.99_cups \
101 ${D}${sysconfdir}/default/volatiles/99_cups 92 ${D}${sysconfdir}/default/volatiles/99_cups
102 fi 93 fi
103} 94}
104 95
105PACKAGES =+ "${PN}-lib ${PN}-libimage" 96PACKAGES =+ "${PN}-lib ${PN}-libimage ${PN}-webif"
106 97
107RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}" 98RDEPENDS:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}"
108FILES_${PN} += "${libexecdir}/cups/ \ 99FILES:${PN} += "${libexecdir}/cups/"
109 "
110 100
111FILES_${PN}-lib = "${libdir}/libcups.so.*" 101FILES:${PN}-lib = "${libdir}/libcups.so.*"
112 102
113FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*" 103FILES:${PN}-libimage = "${libdir}/libcupsimage.so.*"
114 104
115#package the html for the webgui inside the main packages (~1MB uncompressed) 105# 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)}"
116 108
117FILES_${PN} += "${datadir}/doc/cups/images \ 109CONFFILES:${PN} += "${sysconfdir}/cups/cupsd.conf"
118 ${datadir}/doc/cups/*html \
119 ${datadir}/doc/cups/*.css \
120 ${datadir}/icons/ \
121 "
122CONFFILES_${PN} += "${sysconfdir}/cups/cupsd.conf"
123 110
124MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/cups-config" 111MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/cups-config"
125 112
113LOCALE_PATHS += "${datadir}/cups/templates"
114
126SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess" 115SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess"
127cups_sysroot_preprocess () { 116cups_sysroot_preprocess () {
128 sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libexecdir}/cups:' 117 sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libexecdir}/cups:'