Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "An Internet printing system for Unix" |
| 2 | SECTION = "console/utils" |
| 3 | LICENSE = "GPLv2 & LGPLv2" |
| 4 | DEPENDS = "gnutls libpng jpeg dbus dbus-glib zlib libusb" |
| 5 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 6 | SRC_URI = "https://github.com/apple/cups/releases/download/release-${PV}/${BP}-source.tar.gz \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 7 | file://use_echo_only_in_init.patch \ |
| 8 | file://0001-don-t-try-to-run-generated-binaries.patch \ |
| 9 | file://cups_serverbin.patch \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 10 | " |
| 11 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 12 | UPSTREAM_CHECK_URI = "https://github.com/apple/cups/releases" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 13 | UPSTREAM_CHECK_REGEX = "cups-(?P<pver>\d+\.\d+(\.\d+)?)-source.tar" |
| 14 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 15 | LEAD_SONAME = "libcupsdriver.so" |
| 16 | |
| 17 | CLEANBROKEN = "1" |
| 18 | |
| 19 | inherit autotools-brokensep binconfig useradd systemd |
| 20 | |
| 21 | USERADD_PACKAGES = "${PN}" |
| 22 | GROUPADD_PARAM_${PN} = "--system lpadmin" |
| 23 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 24 | 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] | 25 | |
| 26 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 27 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" |
| 29 | PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi" |
| 30 | PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl" |
| 31 | PACKAGECONFIG[pam] = "--enable-pam, --disable-pam, libpam" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 32 | PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd" |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 33 | PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 34 | |
| 35 | EXTRA_OECONF = " \ |
| 36 | --enable-gnutls \ |
| 37 | --enable-dbus \ |
| 38 | --enable-browsing \ |
| 39 | --disable-gssapi \ |
| 40 | --enable-debug \ |
| 41 | --disable-relro \ |
| 42 | --enable-libusb \ |
| 43 | --without-php \ |
| 44 | --without-perl \ |
| 45 | --without-python \ |
| 46 | --without-java \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 47 | DSOFLAGS='${LDFLAGS}' \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 48 | " |
| 49 | |
| 50 | EXTRA_AUTORECONF += "--exclude=autoheader" |
| 51 | |
| 52 | do_compile () { |
| 53 | echo "all:" > man/Makefile |
| 54 | echo "libs:" >> man/Makefile |
| 55 | echo "install:" >> man/Makefile |
| 56 | echo "install-data:" >> man/Makefile |
| 57 | echo "install-exec:" >> man/Makefile |
| 58 | echo "install-headers:" >> man/Makefile |
| 59 | echo "install-libs:" >> man/Makefile |
| 60 | |
| 61 | oe_runmake |
| 62 | } |
| 63 | |
| 64 | do_install () { |
| 65 | oe_runmake "DSTROOT=${D}" install |
| 66 | |
| 67 | # Remove /var/run from package as cupsd will populate it on startup |
| 68 | rm -fr ${D}/${localstatedir}/run |
| 69 | rmdir ${D}/${libdir}/${BPN}/driver |
| 70 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 71 | # Fix the pam configuration file permissions |
| 72 | if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then |
| 73 | chmod 0644 ${D}${sysconfdir}/pam.d/cups |
| 74 | fi |
| 75 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 76 | # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES |
| 77 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then |
| 78 | rm -rf ${D}${sysconfdir}/init.d/ |
| 79 | rm -rf ${D}${sysconfdir}/rc* |
| 80 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | python do_package_append() { |
| 84 | import subprocess |
| 85 | # Change permissions back the way they were, they probably had a reason... |
| 86 | workdir = d.getVar('WORKDIR', True) |
| 87 | subprocess.call('chmod 0511 %s/install/cups/var/run/cups/certs' % workdir, shell=True) |
| 88 | } |
| 89 | |
| 90 | PACKAGES =+ "${PN}-lib ${PN}-libimage" |
| 91 | |
| 92 | RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}" |
| 93 | FILES_${PN} += "${libdir}/cups/backend \ |
| 94 | ${libdir}/cups/cgi-bin \ |
| 95 | ${libdir}/cups/filter \ |
| 96 | ${libdir}/cups/monitor \ |
| 97 | ${libdir}/cups/notifier \ |
| 98 | ${libdir}/cups/daemon \ |
| 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 | |
| 114 | SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess" |
| 115 | cups_sysroot_preprocess () { |
| 116 | sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libdir}/cups:' |
| 117 | } |