blob: ac4d225c1a734eb80cda2814430e92312fc745b5 [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"
5DEPENDS = "gnutls libpng jpeg dbus dbus-glib zlib libusb"
6
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 \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050011 "
12
Patrick Williamsc0f7c042017-02-23 20:41:17 -060013UPSTREAM_CHECK_URI = "https://github.com/apple/cups/releases"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050014UPSTREAM_CHECK_REGEX = "cups-(?P<pver>\d+\.\d+(\.\d+)?)-source.tar"
15
Patrick Williamsc124f4f2015-09-15 14:41:29 -050016LEAD_SONAME = "libcupsdriver.so"
17
18CLEANBROKEN = "1"
19
Brad Bishop6e60e8b2018-02-01 10:27:11 -050020inherit autotools-brokensep binconfig useradd systemd pkgconfig
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021
22USERADD_PACKAGES = "${PN}"
23GROUPADD_PARAM_${PN} = "--system lpadmin"
24
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050025SYSTEMD_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 -050026
27PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050028 ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050029PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
30PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"
31PACKAGECONFIG[pam] = "--enable-pam, --disable-pam, libpam"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050032PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd"
Patrick Williamsf1e5d692016-03-30 15:21:19 -050033PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034
35EXTRA_OECONF = " \
36 --enable-gnutls \
37 --enable-dbus \
38 --enable-browsing \
39 --disable-gssapi \
40 --enable-debug \
41 --disable-relro \
42 --enable-libusb \
43 --without-php \
44 --without-perl \
45 --without-python \
46 --without-java \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060047 DSOFLAGS='${LDFLAGS}' \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050048 "
49
50EXTRA_AUTORECONF += "--exclude=autoheader"
51
52do_compile () {
53 echo "all:" > man/Makefile
54 echo "libs:" >> man/Makefile
55 echo "install:" >> man/Makefile
56 echo "install-data:" >> man/Makefile
57 echo "install-exec:" >> man/Makefile
58 echo "install-headers:" >> man/Makefile
59 echo "install-libs:" >> man/Makefile
60
61 oe_runmake
62}
63
64do_install () {
65 oe_runmake "DSTROOT=${D}" install
66
67 # Remove /var/run from package as cupsd will populate it on startup
68 rm -fr ${D}/${localstatedir}/run
69 rmdir ${D}/${libdir}/${BPN}/driver
70
Patrick Williamsf1e5d692016-03-30 15:21:19 -050071 # Fix the pam configuration file permissions
72 if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
73 chmod 0644 ${D}${sysconfdir}/pam.d/cups
74 fi
75
Patrick Williamsc124f4f2015-09-15 14:41:29 -050076 # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES
77 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then
78 rm -rf ${D}${sysconfdir}/init.d/
79 rm -rf ${D}${sysconfdir}/rc*
80 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050081}
82
Patrick Williamsc124f4f2015-09-15 14:41:29 -050083PACKAGES =+ "${PN}-lib ${PN}-libimage"
84
85RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}"
86FILES_${PN} += "${libdir}/cups/backend \
87 ${libdir}/cups/cgi-bin \
88 ${libdir}/cups/filter \
89 ${libdir}/cups/monitor \
90 ${libdir}/cups/notifier \
91 ${libdir}/cups/daemon \
92 "
93
94FILES_${PN}-lib = "${libdir}/libcups.so.*"
95
96FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*"
97
Patrick Williamsc124f4f2015-09-15 14:41:29 -050098#package the html for the webgui inside the main packages (~1MB uncompressed)
99
100FILES_${PN} += "${datadir}/doc/cups/images \
101 ${datadir}/doc/cups/*html \
102 ${datadir}/doc/cups/*.css \
103 ${datadir}/icons/ \
104 "
105CONFFILES_${PN} += "${sysconfdir}/cups/cupsd.conf"
106
107SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess"
108cups_sysroot_preprocess () {
109 sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libdir}/cups:'
110}