Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "An Internet printing system for Unix" |
Brad Bishop | f3f93bb | 2019-10-16 14:33:32 -0400 | [diff] [blame] | 2 | DESCRIPTION = "The Common UNIX Printing System is a printing system and \ |
| 3 | general replacement for lpd and the like. It supports the Internet Printing \ |
| 4 | Protocol (IPP), and has its own filtering driver model for handling various \ |
| 5 | document types." |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 6 | HOMEPAGE = "https://www.cups.org/" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 7 | SECTION = "console/utils" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 8 | LICENSE = "Apache-2.0" |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 9 | DEPENDS = "gnutls libpng jpeg dbus zlib libusb1" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 10 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 11 | SRC_URI = "https://github.com/apple/cups/releases/download/v${PV}/${BP}-source.tar.gz \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 12 | 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 \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 18 | " |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 19 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 20 | UPSTREAM_CHECK_URI = "https://github.com/apple/cups/releases" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 21 | UPSTREAM_CHECK_REGEX = "cups-(?P<pver>\d+\.\d+(\.\d+)?)-source.tar" |
| 22 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 23 | LEAD_SONAME = "libcupsdriver.so" |
| 24 | |
| 25 | CLEANBROKEN = "1" |
| 26 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 27 | inherit autotools-brokensep binconfig useradd systemd pkgconfig multilib_script |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | |
| 29 | USERADD_PACKAGES = "${PN}" |
| 30 | GROUPADD_PARAM_${PN} = "--system lpadmin" |
| 31 | |
Andrew Geissler | 5a43b43 | 2020-06-13 10:46:56 -0500 | [diff] [blame] | 32 | SYSTEMD_SERVICE_${PN} = "org.cups.cupsd.socket org.cups.cupsd.path org.cups.cupsd.service org.cups.cups-lpd.socket" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 33 | |
| 34 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 35 | ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 36 | PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi" |
| 37 | PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 38 | PACKAGECONFIG[pam] = "--enable-pam --with-pam-module=unix, --disable-pam, libpam" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 39 | PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd" |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 40 | PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 41 | |
| 42 | EXTRA_OECONF = " \ |
| 43 | --enable-gnutls \ |
| 44 | --enable-dbus \ |
| 45 | --enable-browsing \ |
| 46 | --disable-gssapi \ |
| 47 | --enable-debug \ |
| 48 | --disable-relro \ |
| 49 | --enable-libusb \ |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame^] | 50 | --with-domainsocket=/run/cups/cups.sock \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 51 | DSOFLAGS='${LDFLAGS}' \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 52 | " |
| 53 | |
| 54 | EXTRA_AUTORECONF += "--exclude=autoheader" |
| 55 | |
| 56 | do_compile () { |
| 57 | echo "all:" > man/Makefile |
| 58 | echo "libs:" >> man/Makefile |
| 59 | echo "install:" >> man/Makefile |
| 60 | echo "install-data:" >> man/Makefile |
| 61 | echo "install-exec:" >> man/Makefile |
| 62 | echo "install-headers:" >> man/Makefile |
| 63 | echo "install-libs:" >> man/Makefile |
| 64 | |
| 65 | oe_runmake |
| 66 | } |
| 67 | |
| 68 | do_install () { |
| 69 | oe_runmake "DSTROOT=${D}" install |
| 70 | |
| 71 | # Remove /var/run from package as cupsd will populate it on startup |
| 72 | rm -fr ${D}/${localstatedir}/run |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 73 | rm -fr ${D}/${localstatedir}/log |
Brad Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 74 | rmdir ${D}/${libexecdir}/${BPN}/driver |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 75 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 76 | # Fix the pam configuration file permissions |
| 77 | if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then |
| 78 | chmod 0644 ${D}${sysconfdir}/pam.d/cups |
| 79 | fi |
| 80 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 81 | # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES |
| 82 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then |
| 83 | rm -rf ${D}${sysconfdir}/init.d/ |
| 84 | rm -rf ${D}${sysconfdir}/rc* |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 85 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 86 | install -m 0644 ${WORKDIR}/cups-volatiles.conf \ |
| 87 | ${D}${sysconfdir}/tmpfiles.d/cups.conf |
| 88 | else |
| 89 | install -d ${D}${sysconfdir}/default/volatiles |
| 90 | install -m 0644 ${WORKDIR}/volatiles.99_cups \ |
| 91 | ${D}${sysconfdir}/default/volatiles/99_cups |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 92 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 93 | } |
| 94 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 95 | PACKAGES =+ "${PN}-lib ${PN}-libimage" |
| 96 | |
| 97 | RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 98 | FILES_${PN} += "${libexecdir}/cups/ \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 99 | " |
| 100 | |
| 101 | FILES_${PN}-lib = "${libdir}/libcups.so.*" |
| 102 | |
| 103 | FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*" |
| 104 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 105 | #package the html for the webgui inside the main packages (~1MB uncompressed) |
| 106 | |
| 107 | FILES_${PN} += "${datadir}/doc/cups/images \ |
| 108 | ${datadir}/doc/cups/*html \ |
| 109 | ${datadir}/doc/cups/*.css \ |
| 110 | ${datadir}/icons/ \ |
| 111 | " |
| 112 | CONFFILES_${PN} += "${sysconfdir}/cups/cupsd.conf" |
| 113 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 114 | MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/cups-config" |
| 115 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 116 | SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess" |
| 117 | cups_sysroot_preprocess () { |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 118 | 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 119 | } |