summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/cups/cups.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/cups/cups.inc')
-rw-r--r--meta/recipes-extended/cups/cups.inc136
1 files changed, 136 insertions, 0 deletions
diff --git a/meta/recipes-extended/cups/cups.inc b/meta/recipes-extended/cups/cups.inc
new file mode 100644
index 0000000000..fbdc48eab1
--- /dev/null
+++ b/meta/recipes-extended/cups/cups.inc
@@ -0,0 +1,136 @@
1SUMMARY = "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-no-gcrypt.patch \
11 file://cups.socket \
12 file://cups.path \
13 file://cups.service \
14 "
15
16LEAD_SONAME = "libcupsdriver.so"
17
18inherit autotools-brokensep binconfig useradd systemd
19
20USERADD_PACKAGES = "${PN}"
21GROUPADD_PARAM_${PN} = "--system lpadmin"
22
23SYSTEMD_SERVICE_${PN} = "cups.socket cups.path cups.service"
24
25PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
26 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
27PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
28PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"
29PACKAGECONFIG[pam] = "--enable-pam, --disable-pam, libpam"
30
31EXTRA_OECONF = " \
32 --enable-gnutls \
33 --enable-dbus \
34 --enable-browsing \
35 --disable-openssl \
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
46
47do_configure() {
48 gnu-configize
49 libtoolize --force
50 autoconf --force
51 DSOFLAGS="${LDFLAGS}" SERVERBIN="${libdir}/cups" oe_runconf
52}
53
54do_compile () {
55 sed -i s:STRIP:NOSTRIP: Makedefs
56 sed -i s:serial:: backend/Makefile
57
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 "SSLLIBS=-lgnutls -L${STAGING_LIBDIR}" \
67 "LIBPNG=-lpng -lm -L${STAGING_LIBDIR}" \
68 "LIBJPEG=-ljpeg -L${STAGING_LIBDIR}" \
69 "LIBZ=-lz -L${STAGING_LIBDIR}" \
70 "-I."
71}
72
73fakeroot do_install () {
74 oe_runmake "DSTROOT=${D}" install
75
76 # Remove /var/run from package as cupsd will populate it on startup
77 rm -fr ${D}/${localstatedir}/run
78 rmdir ${D}/${libdir}/${BPN}/driver
79
80 # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES
81 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then
82 rm -rf ${D}${sysconfdir}/init.d/
83 rm -rf ${D}${sysconfdir}/rc*
84 fi
85
86 # Install systemd unit files
87 install -d ${D}${systemd_unitdir}/system
88 install -m 0644 ${WORKDIR}/cups.socket ${D}${systemd_unitdir}/system
89 install -m 0644 ${WORKDIR}/cups.path ${D}${systemd_unitdir}/system
90 install -m 0644 ${WORKDIR}/cups.service ${D}${systemd_unitdir}/system
91 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/cups.service
92}
93
94python do_package_append() {
95 import subprocess
96 # Change permissions back the way they were, they probably had a reason...
97 workdir = d.getVar('WORKDIR', True)
98 subprocess.call('chmod 0511 %s/install/cups/var/run/cups/certs' % workdir, shell=True)
99}
100
101PACKAGES =+ "${PN}-lib ${PN}-libimage"
102
103RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}"
104FILES_${PN} += "${libdir}/cups/backend \
105 ${libdir}/cups/cgi-bin \
106 ${libdir}/cups/filter \
107 ${libdir}/cups/monitor \
108 ${libdir}/cups/notifier \
109 ${libdir}/cups/daemon \
110 "
111
112FILES_${PN}-lib = "${libdir}/libcups.so.*"
113
114FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*"
115
116FILES_${PN}-dbg += "${libdir}/cups/backend/.debug \
117 ${libdir}/cups/cgi-bin/.debug \
118 ${libdir}/cups/filter/.debug \
119 ${libdir}/cups/monitor/.debug \
120 ${libdir}/cups/notifier/.debug \
121 ${libdir}/cups/daemon/.debug \
122 "
123
124#package the html for the webgui inside the main packages (~1MB uncompressed)
125
126FILES_${PN} += "${datadir}/doc/cups/images \
127 ${datadir}/doc/cups/*html \
128 ${datadir}/doc/cups/*.css \
129 ${datadir}/icons/ \
130 "
131CONFFILES_${PN} += "${sysconfdir}/cups/cupsd.conf"
132
133SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess"
134cups_sysroot_preprocess () {
135 sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libdir}/cups:'
136}