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 | |
| 6 | SRC_URI = "http://www.cups.org/software/${PV}/${BP}-source.tar.bz2 \ |
| 7 | file://use_echo_only_in_init.patch \ |
| 8 | file://0001-don-t-try-to-run-generated-binaries.patch \ |
| 9 | file://cups_serverbin.patch \ |
| 10 | file://cups.socket \ |
| 11 | file://cups.path \ |
| 12 | file://cups.service \ |
| 13 | " |
| 14 | |
| 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 | |
| 24 | SYSTEMD_SERVICE_${PN} = "cups.socket cups.path cups.service" |
| 25 | |
| 26 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \ |
| 27 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" |
| 28 | PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi" |
| 29 | PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl" |
| 30 | PACKAGECONFIG[pam] = "--enable-pam, --disable-pam, libpam" |
| 31 | |
| 32 | EXTRA_OECONF = " \ |
| 33 | --enable-gnutls \ |
| 34 | --enable-dbus \ |
| 35 | --enable-browsing \ |
| 36 | --disable-gssapi \ |
| 37 | --enable-debug \ |
| 38 | --disable-relro \ |
| 39 | --enable-libusb \ |
| 40 | --without-php \ |
| 41 | --without-perl \ |
| 42 | --without-python \ |
| 43 | --without-java \ |
| 44 | " |
| 45 | |
| 46 | EXTRA_AUTORECONF += "--exclude=autoheader" |
| 47 | |
| 48 | do_compile () { |
| 49 | echo "all:" > man/Makefile |
| 50 | echo "libs:" >> man/Makefile |
| 51 | echo "install:" >> man/Makefile |
| 52 | echo "install-data:" >> man/Makefile |
| 53 | echo "install-exec:" >> man/Makefile |
| 54 | echo "install-headers:" >> man/Makefile |
| 55 | echo "install-libs:" >> man/Makefile |
| 56 | |
| 57 | oe_runmake |
| 58 | } |
| 59 | |
| 60 | do_install () { |
| 61 | oe_runmake "DSTROOT=${D}" install |
| 62 | |
| 63 | # Remove /var/run from package as cupsd will populate it on startup |
| 64 | rm -fr ${D}/${localstatedir}/run |
| 65 | rmdir ${D}/${libdir}/${BPN}/driver |
| 66 | |
| 67 | # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES |
| 68 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then |
| 69 | rm -rf ${D}${sysconfdir}/init.d/ |
| 70 | rm -rf ${D}${sysconfdir}/rc* |
| 71 | fi |
| 72 | |
| 73 | # Install systemd unit files |
| 74 | install -d ${D}${systemd_unitdir}/system |
| 75 | install -m 0644 ${WORKDIR}/cups.socket ${D}${systemd_unitdir}/system |
| 76 | install -m 0644 ${WORKDIR}/cups.path ${D}${systemd_unitdir}/system |
| 77 | install -m 0644 ${WORKDIR}/cups.service ${D}${systemd_unitdir}/system |
| 78 | sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/cups.service |
| 79 | } |
| 80 | |
| 81 | python do_package_append() { |
| 82 | import subprocess |
| 83 | # Change permissions back the way they were, they probably had a reason... |
| 84 | workdir = d.getVar('WORKDIR', True) |
| 85 | subprocess.call('chmod 0511 %s/install/cups/var/run/cups/certs' % workdir, shell=True) |
| 86 | } |
| 87 | |
| 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 | |
| 103 | FILES_${PN}-dbg += "${libdir}/cups/backend/.debug \ |
| 104 | ${libdir}/cups/cgi-bin/.debug \ |
| 105 | ${libdir}/cups/filter/.debug \ |
| 106 | ${libdir}/cups/monitor/.debug \ |
| 107 | ${libdir}/cups/notifier/.debug \ |
| 108 | ${libdir}/cups/daemon/.debug \ |
| 109 | " |
| 110 | |
| 111 | #package the html for the webgui inside the main packages (~1MB uncompressed) |
| 112 | |
| 113 | FILES_${PN} += "${datadir}/doc/cups/images \ |
| 114 | ${datadir}/doc/cups/*html \ |
| 115 | ${datadir}/doc/cups/*.css \ |
| 116 | ${datadir}/icons/ \ |
| 117 | " |
| 118 | CONFFILES_${PN} += "${sysconfdir}/cups/cupsd.conf" |
| 119 | |
| 120 | SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess" |
| 121 | cups_sysroot_preprocess () { |
| 122 | sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libdir}/cups:' |
| 123 | } |