cups.inc 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. SUMMARY = "An Internet printing system for Unix"
  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."
  6. HOMEPAGE = "https://www.cups.org/"
  7. SECTION = "console/utils"
  8. LICENSE = "Apache-2.0"
  9. DEPENDS = "gnutls libpng jpeg dbus zlib libusb1"
  10. SRC_URI = "https://github.com/apple/cups/releases/download/v${PV}/${BP}-source.tar.gz \
  11. file://0001-use-echo-only-in-init.patch \
  12. file://0002-don-t-try-to-run-generated-binaries.patch \
  13. file://0003-cups_1.4.6.bb-Fix-build-on-ppc64.patch \
  14. file://0004-cups-fix-multilib-install-file-conflicts.patch \
  15. file://volatiles.99_cups \
  16. file://cups-volatiles.conf \
  17. "
  18. UPSTREAM_CHECK_URI = "https://github.com/apple/cups/releases"
  19. UPSTREAM_CHECK_REGEX = "cups-(?P<pver>\d+\.\d+(\.\d+)?)-source.tar"
  20. LEAD_SONAME = "libcupsdriver.so"
  21. CLEANBROKEN = "1"
  22. inherit autotools-brokensep binconfig useradd systemd pkgconfig multilib_script
  23. USERADD_PACKAGES = "${PN}"
  24. GROUPADD_PARAM_${PN} = "--system lpadmin"
  25. SYSTEMD_SERVICE_${PN} = "org.cups.cupsd.socket org.cups.cupsd.path org.cups.cupsd.service org.cups.cups-lpd.socket"
  26. PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
  27. ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}"
  28. PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
  29. PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"
  30. PACKAGECONFIG[pam] = "--enable-pam --with-pam-module=unix, --disable-pam, libpam"
  31. PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd"
  32. PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd"
  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. --with-domainsocket=/run/cups/cups.sock \
  42. DSOFLAGS='${LDFLAGS}' \
  43. "
  44. EXTRA_AUTORECONF += "--exclude=autoheader"
  45. do_compile () {
  46. echo "all:" > man/Makefile
  47. echo "libs:" >> man/Makefile
  48. echo "install:" >> man/Makefile
  49. echo "install-data:" >> man/Makefile
  50. echo "install-exec:" >> man/Makefile
  51. echo "install-headers:" >> man/Makefile
  52. echo "install-libs:" >> man/Makefile
  53. oe_runmake
  54. }
  55. do_install () {
  56. oe_runmake "DSTROOT=${D}" install
  57. # Remove /var/run from package as cupsd will populate it on startup
  58. rm -fr ${D}/${localstatedir}/run
  59. rm -fr ${D}/${localstatedir}/log
  60. rmdir ${D}/${libexecdir}/${BPN}/driver
  61. # Fix the pam configuration file permissions
  62. if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
  63. chmod 0644 ${D}${sysconfdir}/pam.d/cups
  64. fi
  65. # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES
  66. if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then
  67. rm -rf ${D}${sysconfdir}/init.d/
  68. rm -rf ${D}${sysconfdir}/rc*
  69. install -d ${D}${sysconfdir}/tmpfiles.d
  70. install -m 0644 ${WORKDIR}/cups-volatiles.conf \
  71. ${D}${sysconfdir}/tmpfiles.d/cups.conf
  72. else
  73. install -d ${D}${sysconfdir}/default/volatiles
  74. install -m 0644 ${WORKDIR}/volatiles.99_cups \
  75. ${D}${sysconfdir}/default/volatiles/99_cups
  76. fi
  77. }
  78. PACKAGES =+ "${PN}-lib ${PN}-libimage"
  79. RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}"
  80. FILES_${PN} += "${libexecdir}/cups/ \
  81. "
  82. FILES_${PN}-lib = "${libdir}/libcups.so.*"
  83. FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*"
  84. #package the html for the webgui inside the main packages (~1MB uncompressed)
  85. FILES_${PN} += "${datadir}/doc/cups/images \
  86. ${datadir}/doc/cups/*html \
  87. ${datadir}/doc/cups/*.css \
  88. ${datadir}/icons/ \
  89. "
  90. CONFFILES_${PN} += "${sysconfdir}/cups/cupsd.conf"
  91. MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/cups-config"
  92. SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess"
  93. cups_sysroot_preprocess () {
  94. sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libexecdir}/cups:'
  95. }