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" |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 31 | PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 32 | |
| 33 | EXTRA_OECONF = " \ |
| 34 | --enable-gnutls \ |
| 35 | --enable-dbus \ |
| 36 | --enable-browsing \ |
| 37 | --disable-gssapi \ |
| 38 | --enable-debug \ |
| 39 | --disable-relro \ |
| 40 | --enable-libusb \ |
| 41 | --without-php \ |
| 42 | --without-perl \ |
| 43 | --without-python \ |
| 44 | --without-java \ |
| 45 | " |
| 46 | |
| 47 | EXTRA_AUTORECONF += "--exclude=autoheader" |
| 48 | |
| 49 | do_compile () { |
| 50 | echo "all:" > man/Makefile |
| 51 | echo "libs:" >> man/Makefile |
| 52 | echo "install:" >> man/Makefile |
| 53 | echo "install-data:" >> man/Makefile |
| 54 | echo "install-exec:" >> man/Makefile |
| 55 | echo "install-headers:" >> man/Makefile |
| 56 | echo "install-libs:" >> man/Makefile |
| 57 | |
| 58 | oe_runmake |
| 59 | } |
| 60 | |
| 61 | do_install () { |
| 62 | oe_runmake "DSTROOT=${D}" install |
| 63 | |
| 64 | # Remove /var/run from package as cupsd will populate it on startup |
| 65 | rm -fr ${D}/${localstatedir}/run |
| 66 | rmdir ${D}/${libdir}/${BPN}/driver |
| 67 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 68 | # Fix the pam configuration file permissions |
| 69 | if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then |
| 70 | chmod 0644 ${D}${sysconfdir}/pam.d/cups |
| 71 | fi |
| 72 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 73 | # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES |
| 74 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then |
| 75 | rm -rf ${D}${sysconfdir}/init.d/ |
| 76 | rm -rf ${D}${sysconfdir}/rc* |
| 77 | fi |
| 78 | |
| 79 | # Install systemd unit files |
| 80 | install -d ${D}${systemd_unitdir}/system |
| 81 | install -m 0644 ${WORKDIR}/cups.socket ${D}${systemd_unitdir}/system |
| 82 | install -m 0644 ${WORKDIR}/cups.path ${D}${systemd_unitdir}/system |
| 83 | install -m 0644 ${WORKDIR}/cups.service ${D}${systemd_unitdir}/system |
| 84 | sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/cups.service |
| 85 | } |
| 86 | |
| 87 | python do_package_append() { |
| 88 | import subprocess |
| 89 | # Change permissions back the way they were, they probably had a reason... |
| 90 | workdir = d.getVar('WORKDIR', True) |
| 91 | subprocess.call('chmod 0511 %s/install/cups/var/run/cups/certs' % workdir, shell=True) |
| 92 | } |
| 93 | |
| 94 | PACKAGES =+ "${PN}-lib ${PN}-libimage" |
| 95 | |
| 96 | RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}" |
| 97 | FILES_${PN} += "${libdir}/cups/backend \ |
| 98 | ${libdir}/cups/cgi-bin \ |
| 99 | ${libdir}/cups/filter \ |
| 100 | ${libdir}/cups/monitor \ |
| 101 | ${libdir}/cups/notifier \ |
| 102 | ${libdir}/cups/daemon \ |
| 103 | " |
| 104 | |
| 105 | FILES_${PN}-lib = "${libdir}/libcups.so.*" |
| 106 | |
| 107 | FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*" |
| 108 | |
| 109 | FILES_${PN}-dbg += "${libdir}/cups/backend/.debug \ |
| 110 | ${libdir}/cups/cgi-bin/.debug \ |
| 111 | ${libdir}/cups/filter/.debug \ |
| 112 | ${libdir}/cups/monitor/.debug \ |
| 113 | ${libdir}/cups/notifier/.debug \ |
| 114 | ${libdir}/cups/daemon/.debug \ |
| 115 | " |
| 116 | |
| 117 | #package the html for the webgui inside the main packages (~1MB uncompressed) |
| 118 | |
| 119 | FILES_${PN} += "${datadir}/doc/cups/images \ |
| 120 | ${datadir}/doc/cups/*html \ |
| 121 | ${datadir}/doc/cups/*.css \ |
| 122 | ${datadir}/icons/ \ |
| 123 | " |
| 124 | CONFFILES_${PN} += "${sysconfdir}/cups/cupsd.conf" |
| 125 | |
| 126 | SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess" |
| 127 | cups_sysroot_preprocess () { |
| 128 | sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libdir}/cups:' |
| 129 | } |