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" |
| 8 | LICENSE = "GPLv2 & LGPLv2" |
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 \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 12 | file://use_echo_only_in_init.patch \ |
| 13 | file://0001-don-t-try-to-run-generated-binaries.patch \ |
| 14 | file://cups_serverbin.patch \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 15 | file://cups-avoid-install-file-conflicts.patch \ |
| 16 | " |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 17 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 18 | UPSTREAM_CHECK_URI = "https://github.com/apple/cups/releases" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 19 | UPSTREAM_CHECK_REGEX = "cups-(?P<pver>\d+\.\d+(\.\d+)?)-source.tar" |
| 20 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 21 | LEAD_SONAME = "libcupsdriver.so" |
| 22 | |
| 23 | CLEANBROKEN = "1" |
| 24 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 25 | inherit autotools-brokensep binconfig useradd systemd pkgconfig |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 26 | |
| 27 | USERADD_PACKAGES = "${PN}" |
| 28 | GROUPADD_PARAM_${PN} = "--system lpadmin" |
| 29 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 30 | SYSTEMD_SERVICE_${PN} = "org.cups.cupsd.socket org.cups.cupsd.path org.cups.cupsd.service org.cups.cups-lpd.socket org.cups.cups-lpd@.service" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 31 | |
| 32 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 33 | ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 34 | PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi" |
| 35 | PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 36 | PACKAGECONFIG[pam] = "--enable-pam --with-pam-module=unix, --disable-pam, libpam" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 37 | PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd" |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 38 | PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 39 | |
| 40 | EXTRA_OECONF = " \ |
| 41 | --enable-gnutls \ |
| 42 | --enable-dbus \ |
| 43 | --enable-browsing \ |
| 44 | --disable-gssapi \ |
| 45 | --enable-debug \ |
| 46 | --disable-relro \ |
| 47 | --enable-libusb \ |
| 48 | --without-php \ |
| 49 | --without-perl \ |
| 50 | --without-python \ |
| 51 | --without-java \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 52 | DSOFLAGS='${LDFLAGS}' \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 53 | " |
| 54 | |
| 55 | EXTRA_AUTORECONF += "--exclude=autoheader" |
| 56 | |
| 57 | do_compile () { |
| 58 | echo "all:" > man/Makefile |
| 59 | echo "libs:" >> man/Makefile |
| 60 | echo "install:" >> man/Makefile |
| 61 | echo "install-data:" >> man/Makefile |
| 62 | echo "install-exec:" >> man/Makefile |
| 63 | echo "install-headers:" >> man/Makefile |
| 64 | echo "install-libs:" >> man/Makefile |
| 65 | |
| 66 | oe_runmake |
| 67 | } |
| 68 | |
| 69 | do_install () { |
| 70 | oe_runmake "DSTROOT=${D}" install |
| 71 | |
| 72 | # Remove /var/run from package as cupsd will populate it on startup |
| 73 | rm -fr ${D}/${localstatedir}/run |
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* |
| 85 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 86 | } |
| 87 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 88 | PACKAGES =+ "${PN}-lib ${PN}-libimage" |
| 89 | |
| 90 | RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}" |
| 91 | FILES_${PN} += "${libdir}/cups/backend \ |
| 92 | ${libdir}/cups/cgi-bin \ |
| 93 | ${libdir}/cups/filter \ |
| 94 | ${libdir}/cups/monitor \ |
| 95 | ${libdir}/cups/notifier \ |
| 96 | ${libdir}/cups/daemon \ |
| 97 | " |
| 98 | |
| 99 | FILES_${PN}-lib = "${libdir}/libcups.so.*" |
| 100 | |
| 101 | FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*" |
| 102 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 103 | #package the html for the webgui inside the main packages (~1MB uncompressed) |
| 104 | |
| 105 | FILES_${PN} += "${datadir}/doc/cups/images \ |
| 106 | ${datadir}/doc/cups/*html \ |
| 107 | ${datadir}/doc/cups/*.css \ |
| 108 | ${datadir}/icons/ \ |
| 109 | " |
| 110 | CONFFILES_${PN} += "${sysconfdir}/cups/cupsd.conf" |
| 111 | |
| 112 | SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess" |
| 113 | cups_sysroot_preprocess () { |
| 114 | sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libdir}/cups:' |
| 115 | } |