diff options
Diffstat (limited to 'meta/recipes-extended/cups/cups.inc')
-rw-r--r-- | meta/recipes-extended/cups/cups.inc | 85 |
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." | |||
6 | HOMEPAGE = "https://www.cups.org/" | 6 | HOMEPAGE = "https://www.cups.org/" |
7 | SECTION = "console/utils" | 7 | SECTION = "console/utils" |
8 | LICENSE = "Apache-2.0" | 8 | LICENSE = "Apache-2.0" |
9 | DEPENDS = "gnutls libpng jpeg dbus zlib libusb1" | 9 | DEPENDS = "libpng jpeg dbus zlib libusb1" |
10 | 10 | ||
11 | SRC_URI = "https://github.com/apple/cups/releases/download/v${PV}/${BP}-source.tar.gz \ | 11 | SRC_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 | ||
21 | UPSTREAM_CHECK_URI = "https://github.com/apple/cups/releases" | 20 | GITHUB_BASE_URI = "https://github.com/OpenPrinting/cups/releases" |
22 | UPSTREAM_CHECK_REGEX = "cups-(?P<pver>\d+\.\d+(\.\d+)?)-source.tar" | ||
23 | 21 | ||
24 | # Issue only applies to MacOS | 22 | CVE_STATUS[CVE-2008-1033] = "not-applicable-platform: Issue only applies to MacOS" |
25 | CVE_CHECK_WHITELIST += "CVE-2008-1033" | 23 | CVE_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 | 24 | CVE_STATUS[CVE-2018-6553] = "not-applicable-platform: This is an Ubuntu only issue" |
27 | CVE_CHECK_WHITELIST += "CVE-2009-0032" | 25 | CVE_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. | 26 | CVE_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." |
29 | CVE_CHECK_WHITELIST += "CVE-2018-6553" | ||
30 | 27 | ||
31 | LEAD_SONAME = "libcupsdriver.so" | 28 | LEAD_SONAME = "libcupsdriver.so" |
32 | 29 | ||
33 | CLEANBROKEN = "1" | 30 | CLEANBROKEN = "1" |
34 | 31 | ||
35 | inherit autotools-brokensep binconfig useradd systemd pkgconfig multilib_script | 32 | inherit autotools-brokensep binconfig useradd systemd pkgconfig multilib_script github-releases |
36 | 33 | ||
37 | USERADD_PACKAGES = "${PN}" | 34 | USERADD_PACKAGES = "${PN}" |
38 | GROUPADD_PARAM_${PN} = "--system lpadmin" | 35 | GROUPADD_PARAM:${PN} = "--system lpadmin" |
39 | 36 | ||
40 | SYSTEMD_SERVICE_${PN} = "org.cups.cupsd.socket org.cups.cupsd.path org.cups.cupsd.service org.cups.cups-lpd.socket" | 37 | SYSTEMD_SERVICE:${PN} = "cups.socket cups.path cups.service cups-lpd.socket" |
41 | 38 | ||
42 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \ | 39 | PACKAGECONFIG ??= "${@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)} \ |
44 | PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi" | 41 | openssl \ |
42 | " | ||
43 | PACKAGECONFIG[avahi] = "--with-dnssd=avahi,--with-dnssd=no,avahi" | ||
45 | PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl" | 44 | PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl" |
45 | PACKAGECONFIG[gnutls] = "--with-tls=gnutls,,gnutls,,,openssl" | ||
46 | PACKAGECONFIG[openssl] = "--with-tls=openssl,,openssl,,,gnutls" | ||
46 | PACKAGECONFIG[pam] = "--enable-pam --with-pam-module=unix, --disable-pam, libpam" | 47 | PACKAGECONFIG[pam] = "--enable-pam --with-pam-module=unix, --disable-pam, libpam" |
47 | PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd" | 48 | PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd" |
48 | PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd" | 49 | PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd" |
50 | PACKAGECONFIG[webif] = "--enable-webif,--disable-webif" | ||
49 | 51 | ||
50 | EXTRA_OECONF = " \ | 52 | EXTRA_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 | ||
64 | EXTRA_AUTORECONF += "--exclude=autoheader" | 67 | EXTRA_AUTORECONF += "--exclude=autoheader" |
65 | 68 | ||
66 | do_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 | |||
78 | do_install () { | 69 | do_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 | ||
105 | PACKAGES =+ "${PN}-lib ${PN}-libimage" | 96 | PACKAGES =+ "${PN}-lib ${PN}-libimage ${PN}-webif" |
106 | 97 | ||
107 | RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}" | 98 | RDEPENDS:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}" |
108 | FILES_${PN} += "${libexecdir}/cups/ \ | 99 | FILES:${PN} += "${libexecdir}/cups/" |
109 | " | ||
110 | 100 | ||
111 | FILES_${PN}-lib = "${libdir}/libcups.so.*" | 101 | FILES:${PN}-lib = "${libdir}/libcups.so.*" |
112 | 102 | ||
113 | FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*" | 103 | FILES:${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 |
106 | FILES:${PN}-webif += "${datadir}/doc/cups/ ${datadir}/icons/" | ||
107 | RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'webif', '${PN}-webif', '', d)}" | ||
116 | 108 | ||
117 | FILES_${PN} += "${datadir}/doc/cups/images \ | 109 | CONFFILES:${PN} += "${sysconfdir}/cups/cupsd.conf" |
118 | ${datadir}/doc/cups/*html \ | ||
119 | ${datadir}/doc/cups/*.css \ | ||
120 | ${datadir}/icons/ \ | ||
121 | " | ||
122 | CONFFILES_${PN} += "${sysconfdir}/cups/cupsd.conf" | ||
123 | 110 | ||
124 | MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/cups-config" | 111 | MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/cups-config" |
125 | 112 | ||
113 | LOCALE_PATHS += "${datadir}/cups/templates" | ||
114 | |||
126 | SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess" | 115 | SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess" |
127 | cups_sysroot_preprocess () { | 116 | cups_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:' |