blob: 57cdf2650e194e52745c132a4267f984e0c8565d [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "An Internet printing system for Unix"
2SECTION = "console/utils"
3LICENSE = "GPLv2 & LGPLv2"
4DEPENDS = "gnutls libpng jpeg dbus dbus-glib zlib libusb"
5
6SRC_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
15LEAD_SONAME = "libcupsdriver.so"
16
17CLEANBROKEN = "1"
18
19inherit autotools-brokensep binconfig useradd systemd
20
21USERADD_PACKAGES = "${PN}"
22GROUPADD_PARAM_${PN} = "--system lpadmin"
23
24SYSTEMD_SERVICE_${PN} = "cups.socket cups.path cups.service"
25
26PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
27 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
28PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
29PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"
30PACKAGECONFIG[pam] = "--enable-pam, --disable-pam, libpam"
31
32EXTRA_OECONF = " \
33 --enable-gnutls \
34 --enable-dbus \
35 --enable-browsing \
36 --disable-gssapi \
37 --enable-debug \
38 --disable-relro \
39 --enable-libusb \
40 --without-php \
41 --without-perl \
42 --without-python \
43 --without-java \
44 "
45
46EXTRA_AUTORECONF += "--exclude=autoheader"
47
48do_compile () {
49 echo "all:" > man/Makefile
50 echo "libs:" >> man/Makefile
51 echo "install:" >> man/Makefile
52 echo "install-data:" >> man/Makefile
53 echo "install-exec:" >> man/Makefile
54 echo "install-headers:" >> man/Makefile
55 echo "install-libs:" >> man/Makefile
56
57 oe_runmake
58}
59
60do_install () {
61 oe_runmake "DSTROOT=${D}" install
62
63 # Remove /var/run from package as cupsd will populate it on startup
64 rm -fr ${D}/${localstatedir}/run
65 rmdir ${D}/${libdir}/${BPN}/driver
66
67 # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES
68 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then
69 rm -rf ${D}${sysconfdir}/init.d/
70 rm -rf ${D}${sysconfdir}/rc*
71 fi
72
73 # Install systemd unit files
74 install -d ${D}${systemd_unitdir}/system
75 install -m 0644 ${WORKDIR}/cups.socket ${D}${systemd_unitdir}/system
76 install -m 0644 ${WORKDIR}/cups.path ${D}${systemd_unitdir}/system
77 install -m 0644 ${WORKDIR}/cups.service ${D}${systemd_unitdir}/system
78 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/cups.service
79}
80
81python do_package_append() {
82 import subprocess
83 # Change permissions back the way they were, they probably had a reason...
84 workdir = d.getVar('WORKDIR', True)
85 subprocess.call('chmod 0511 %s/install/cups/var/run/cups/certs' % workdir, shell=True)
86}
87
88PACKAGES =+ "${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
103FILES_${PN}-dbg += "${libdir}/cups/backend/.debug \
104 ${libdir}/cups/cgi-bin/.debug \
105 ${libdir}/cups/filter/.debug \
106 ${libdir}/cups/monitor/.debug \
107 ${libdir}/cups/notifier/.debug \
108 ${libdir}/cups/daemon/.debug \
109 "
110
111#package the html for the webgui inside the main packages (~1MB uncompressed)
112
113FILES_${PN} += "${datadir}/doc/cups/images \
114 ${datadir}/doc/cups/*html \
115 ${datadir}/doc/cups/*.css \
116 ${datadir}/icons/ \
117 "
118CONFFILES_${PN} += "${sysconfdir}/cups/cupsd.conf"
119
120SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess"
121cups_sysroot_preprocess () {
122 sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libdir}/cups:'
123}