blob: 5010f0861f4e03c102ac631cf6787e7ee4f46ee0 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "An Internet printing system for Unix"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05002HOMEPAGE = "https://www.cups.org/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003SECTION = "console/utils"
4LICENSE = "GPLv2 & LGPLv2"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08005DEPENDS = "gnutls libpng jpeg dbus dbus-glib zlib libusb1"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05006
Brad Bishop6e60e8b2018-02-01 10:27:11 -05007SRC_URI = "https://github.com/apple/cups/releases/download/v${PV}/${BP}-source.tar.gz \
Patrick Williamsc124f4f2015-09-15 14:41:29 -05008 file://use_echo_only_in_init.patch \
9 file://0001-don-t-try-to-run-generated-binaries.patch \
10 file://cups_serverbin.patch \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080011 file://cups-avoid-install-file-conflicts.patch \
12 "
Patrick Williamsc124f4f2015-09-15 14:41:29 -050013
Patrick Williamsc0f7c042017-02-23 20:41:17 -060014UPSTREAM_CHECK_URI = "https://github.com/apple/cups/releases"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050015UPSTREAM_CHECK_REGEX = "cups-(?P<pver>\d+\.\d+(\.\d+)?)-source.tar"
16
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017LEAD_SONAME = "libcupsdriver.so"
18
19CLEANBROKEN = "1"
20
Brad Bishop6e60e8b2018-02-01 10:27:11 -050021inherit autotools-brokensep binconfig useradd systemd pkgconfig
Patrick Williamsc124f4f2015-09-15 14:41:29 -050022
23USERADD_PACKAGES = "${PN}"
24GROUPADD_PARAM_${PN} = "--system lpadmin"
25
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050026SYSTEMD_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 -050027
28PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050029 ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050030PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
31PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"
Brad Bishop19323692019-04-05 15:28:33 -040032PACKAGECONFIG[pam] = "--enable-pam --with-pam-module=unix, --disable-pam, libpam"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050033PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd"
Patrick Williamsf1e5d692016-03-30 15:21:19 -050034PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050035
36EXTRA_OECONF = " \
37 --enable-gnutls \
38 --enable-dbus \
39 --enable-browsing \
40 --disable-gssapi \
41 --enable-debug \
42 --disable-relro \
43 --enable-libusb \
44 --without-php \
45 --without-perl \
46 --without-python \
47 --without-java \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060048 DSOFLAGS='${LDFLAGS}' \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050049 "
50
51EXTRA_AUTORECONF += "--exclude=autoheader"
52
53do_compile () {
54 echo "all:" > man/Makefile
55 echo "libs:" >> man/Makefile
56 echo "install:" >> man/Makefile
57 echo "install-data:" >> man/Makefile
58 echo "install-exec:" >> man/Makefile
59 echo "install-headers:" >> man/Makefile
60 echo "install-libs:" >> man/Makefile
61
62 oe_runmake
63}
64
65do_install () {
66 oe_runmake "DSTROOT=${D}" install
67
68 # Remove /var/run from package as cupsd will populate it on startup
69 rm -fr ${D}/${localstatedir}/run
70 rmdir ${D}/${libdir}/${BPN}/driver
71
Patrick Williamsf1e5d692016-03-30 15:21:19 -050072 # Fix the pam configuration file permissions
73 if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
74 chmod 0644 ${D}${sysconfdir}/pam.d/cups
75 fi
76
Patrick Williamsc124f4f2015-09-15 14:41:29 -050077 # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES
78 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then
79 rm -rf ${D}${sysconfdir}/init.d/
80 rm -rf ${D}${sysconfdir}/rc*
81 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050082}
83
Patrick Williamsc124f4f2015-09-15 14:41:29 -050084PACKAGES =+ "${PN}-lib ${PN}-libimage"
85
86RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}"
87FILES_${PN} += "${libdir}/cups/backend \
88 ${libdir}/cups/cgi-bin \
89 ${libdir}/cups/filter \
90 ${libdir}/cups/monitor \
91 ${libdir}/cups/notifier \
92 ${libdir}/cups/daemon \
93 "
94
95FILES_${PN}-lib = "${libdir}/libcups.so.*"
96
97FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*"
98
Patrick Williamsc124f4f2015-09-15 14:41:29 -050099#package the html for the webgui inside the main packages (~1MB uncompressed)
100
101FILES_${PN} += "${datadir}/doc/cups/images \
102 ${datadir}/doc/cups/*html \
103 ${datadir}/doc/cups/*.css \
104 ${datadir}/icons/ \
105 "
106CONFFILES_${PN} += "${sysconfdir}/cups/cupsd.conf"
107
108SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess"
109cups_sysroot_preprocess () {
110 sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libdir}/cups:'
111}