diff options
Diffstat (limited to 'meta/recipes-extended/cups/cups.inc')
-rw-r--r-- | meta/recipes-extended/cups/cups.inc | 113 |
1 files changed, 113 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..e4771f7c80 --- /dev/null +++ b/meta/recipes-extended/cups/cups.inc | |||
@@ -0,0 +1,113 @@ | |||
1 | SUMMARY = "An Internet printing system for Unix" | ||
2 | SECTION = "console/utils" | ||
3 | LICENSE = "GPLv2 & LGPLv2" | ||
4 | DEPENDS = "gnutls libpng jpeg dbus dbus-glib zlib libusb" | ||
5 | PROVIDES = "cups14" | ||
6 | |||
7 | SRC_URI = "http://www.cups.org/software/${PV}/${BP}-source.tar.bz2 \ | ||
8 | file://use_echo_only_in_init.patch \ | ||
9 | file://0001-don-t-try-to-run-generated-binaries.patch \ | ||
10 | file://cups_serverbin.patch \ | ||
11 | " | ||
12 | |||
13 | LEAD_SONAME = "libcupsdriver.so" | ||
14 | |||
15 | inherit autotools-brokensep binconfig | ||
16 | |||
17 | PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \ | ||
18 | ${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" | ||
19 | PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi" | ||
20 | PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl" | ||
21 | PACKAGECONFIG[pam] = "--enable-pam, --disable-pam, libpam" | ||
22 | |||
23 | EXTRA_OECONF = " \ | ||
24 | --enable-gnutls \ | ||
25 | --enable-dbus \ | ||
26 | --enable-browsing \ | ||
27 | --disable-openssl \ | ||
28 | --disable-gssapi \ | ||
29 | --enable-debug \ | ||
30 | --disable-relro \ | ||
31 | --enable-libusb \ | ||
32 | --without-php \ | ||
33 | --without-perl \ | ||
34 | --without-python \ | ||
35 | --without-java \ | ||
36 | " | ||
37 | |||
38 | |||
39 | do_configure() { | ||
40 | gnu-configize | ||
41 | libtoolize --force | ||
42 | DSOFLAGS="${LDFLAGS}" SERVERBIN="${libdir}/cups" oe_runconf | ||
43 | } | ||
44 | |||
45 | do_compile () { | ||
46 | sed -i s:STRIP:NOSTRIP: Makedefs | ||
47 | sed -i s:serial:: backend/Makefile | ||
48 | |||
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 "SSLLIBS=-lgnutls -L${STAGING_LIBDIR}" \ | ||
58 | "LIBPNG=-lpng -lm -L${STAGING_LIBDIR}" \ | ||
59 | "LIBJPEG=-ljpeg -L${STAGING_LIBDIR}" \ | ||
60 | "LIBZ=-lz -L${STAGING_LIBDIR}" \ | ||
61 | "-I." | ||
62 | } | ||
63 | |||
64 | fakeroot do_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 | } | ||
71 | |||
72 | python do_package_append() { | ||
73 | import subprocess | ||
74 | # Change permissions back the way they were, they probably had a reason... | ||
75 | workdir = d.getVar('WORKDIR', True) | ||
76 | subprocess.call('chmod 0511 %s/install/cups/var/run/cups/certs' % workdir, shell=True) | ||
77 | } | ||
78 | |||
79 | PACKAGES =+ "${PN}-lib ${PN}-libimage" | ||
80 | |||
81 | FILES_${PN} += "${libdir}/cups/backend \ | ||
82 | ${libdir}/cups/cgi-bin \ | ||
83 | ${libdir}/cups/filter \ | ||
84 | ${libdir}/cups/monitor \ | ||
85 | ${libdir}/cups/notifier \ | ||
86 | ${libdir}/cups/daemon \ | ||
87 | " | ||
88 | |||
89 | FILES_${PN}-lib = "${libdir}/libcups.so.*" | ||
90 | |||
91 | FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*" | ||
92 | |||
93 | FILES_${PN}-dbg += "${libdir}/cups/backend/.debug \ | ||
94 | ${libdir}/cups/cgi-bin/.debug \ | ||
95 | ${libdir}/cups/filter/.debug \ | ||
96 | ${libdir}/cups/monitor/.debug \ | ||
97 | ${libdir}/cups/notifier/.debug \ | ||
98 | ${libdir}/cups/daemon/.debug \ | ||
99 | " | ||
100 | |||
101 | #package the html for the webgui inside the main packages (~1MB uncompressed) | ||
102 | |||
103 | FILES_${PN} += "${datadir}/doc/cups/images \ | ||
104 | ${datadir}/doc/cups/*html \ | ||
105 | ${datadir}/doc/cups/*.css \ | ||
106 | ${datadir}/icons/ \ | ||
107 | " | ||
108 | CONFFILES_${PN} += "${sysconfdir}/cups/cupsd.conf" | ||
109 | |||
110 | SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess" | ||
111 | cups_sysroot_preprocess () { | ||
112 | sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libdir}/cups:' | ||
113 | } | ||