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