blob: 2149cbe4cfb3778721e522eb00a2ba41c32ea135 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "An Internet printing system for Unix"
Brad Bishopf3f93bb2019-10-16 14:33:32 -04002DESCRIPTION = "The Common UNIX Printing System is a printing system and \
3general replacement for lpd and the like. It supports the Internet Printing \
4Protocol (IPP), and has its own filtering driver model for handling various \
5document types."
Brad Bishopd7bf8c12018-02-25 22:55:05 -05006HOMEPAGE = "https://www.cups.org/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05007SECTION = "console/utils"
8LICENSE = "GPLv2 & LGPLv2"
Brad Bishop96ff1982019-08-19 13:50:42 -04009DEPENDS = "gnutls libpng jpeg dbus zlib libusb1"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050010
Brad Bishop6e60e8b2018-02-01 10:27:11 -050011SRC_URI = "https://github.com/apple/cups/releases/download/v${PV}/${BP}-source.tar.gz \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050012 file://use_echo_only_in_init.patch \
13 file://0001-don-t-try-to-run-generated-binaries.patch \
14 file://cups_serverbin.patch \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080015 file://cups-avoid-install-file-conflicts.patch \
16 "
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017
Patrick Williamsc0f7c042017-02-23 20:41:17 -060018UPSTREAM_CHECK_URI = "https://github.com/apple/cups/releases"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050019UPSTREAM_CHECK_REGEX = "cups-(?P<pver>\d+\.\d+(\.\d+)?)-source.tar"
20
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021LEAD_SONAME = "libcupsdriver.so"
22
23CLEANBROKEN = "1"
24
Brad Bishop6e60e8b2018-02-01 10:27:11 -050025inherit autotools-brokensep binconfig useradd systemd pkgconfig
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026
27USERADD_PACKAGES = "${PN}"
28GROUPADD_PARAM_${PN} = "--system lpadmin"
29
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050030SYSTEMD_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 Williamsc124f4f2015-09-15 14:41:29 -050031
32PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050033 ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
35PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"
Brad Bishop19323692019-04-05 15:28:33 -040036PACKAGECONFIG[pam] = "--enable-pam --with-pam-module=unix, --disable-pam, libpam"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050037PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd"
Patrick Williamsf1e5d692016-03-30 15:21:19 -050038PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050039
40EXTRA_OECONF = " \
41 --enable-gnutls \
42 --enable-dbus \
43 --enable-browsing \
44 --disable-gssapi \
45 --enable-debug \
46 --disable-relro \
47 --enable-libusb \
48 --without-php \
49 --without-perl \
50 --without-python \
51 --without-java \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060052 DSOFLAGS='${LDFLAGS}' \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050053 "
54
55EXTRA_AUTORECONF += "--exclude=autoheader"
56
57do_compile () {
58 echo "all:" > man/Makefile
59 echo "libs:" >> man/Makefile
60 echo "install:" >> man/Makefile
61 echo "install-data:" >> man/Makefile
62 echo "install-exec:" >> man/Makefile
63 echo "install-headers:" >> man/Makefile
64 echo "install-libs:" >> man/Makefile
65
66 oe_runmake
67}
68
69do_install () {
70 oe_runmake "DSTROOT=${D}" install
71
72 # Remove /var/run from package as cupsd will populate it on startup
73 rm -fr ${D}/${localstatedir}/run
Brad Bishop79641f22019-09-10 07:20:22 -040074 rmdir ${D}/${libexecdir}/${BPN}/driver
Patrick Williamsc124f4f2015-09-15 14:41:29 -050075
Patrick Williamsf1e5d692016-03-30 15:21:19 -050076 # Fix the pam configuration file permissions
77 if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
78 chmod 0644 ${D}${sysconfdir}/pam.d/cups
79 fi
80
Patrick Williamsc124f4f2015-09-15 14:41:29 -050081 # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES
82 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then
83 rm -rf ${D}${sysconfdir}/init.d/
84 rm -rf ${D}${sysconfdir}/rc*
85 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050086}
87
Patrick Williamsc124f4f2015-09-15 14:41:29 -050088PACKAGES =+ "${PN}-lib ${PN}-libimage"
89
90RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}"
91FILES_${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
99FILES_${PN}-lib = "${libdir}/libcups.so.*"
100
101FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*"
102
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500103#package the html for the webgui inside the main packages (~1MB uncompressed)
104
105FILES_${PN} += "${datadir}/doc/cups/images \
106 ${datadir}/doc/cups/*html \
107 ${datadir}/doc/cups/*.css \
108 ${datadir}/icons/ \
109 "
110CONFFILES_${PN} += "${sysconfdir}/cups/cupsd.conf"
111
112SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess"
113cups_sysroot_preprocess () {
114 sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libdir}/cups:'
115}