Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 1/3] cups: use BUILDROOT instead of DESTDIR
@ 2023-03-08 22:44 Trevor Woerner
  2023-03-08 22:44 ` [PATCH 2/3] cups: check PACKAGECONFIG for pam feature Trevor Woerner
  2023-03-08 22:44 ` [PATCH 3/3] cups: add/fix web interface packaging Trevor Woerner
  0 siblings, 2 replies; 3+ messages in thread
From: Trevor Woerner @ 2023-03-08 22:44 UTC (permalink / raw)
  To: openembedded-core

The cups documentation is clear that the correct way to install into an
alternate root directory is to use the BUILDROOT variable. From INSTALL.md:

	Use the `BUILDROOT` variable to install to an alternate root directory:

	    make BUILDROOT=/some/other/root/directory install

DESTDIR works, but we should use the mechanism the project specifically
created for this purpose.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 meta/recipes-extended/cups/cups.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-extended/cups/cups.inc b/meta/recipes-extended/cups/cups.inc
index 9c920bb133ff..b8b655a4fb85 100644
--- a/meta/recipes-extended/cups/cups.inc
+++ b/meta/recipes-extended/cups/cups.inc
@@ -66,7 +66,7 @@ EXTRA_OECONF = " \
 EXTRA_AUTORECONF += "--exclude=autoheader"
 
 do_install () {
-	oe_runmake "DESTDIR=${D}" install
+	oe_runmake "BUILDROOT=${D}" install
 
 	# Remove /var/run from package as cupsd will populate it on startup
 	rm -fr ${D}/${localstatedir}/run
-- 
2.36.0.rc2.17.g4027e30c53



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/3] cups: check PACKAGECONFIG for pam feature
  2023-03-08 22:44 [PATCH 1/3] cups: use BUILDROOT instead of DESTDIR Trevor Woerner
@ 2023-03-08 22:44 ` Trevor Woerner
  2023-03-08 22:44 ` [PATCH 3/3] cups: add/fix web interface packaging Trevor Woerner
  1 sibling, 0 replies; 3+ messages in thread
From: Trevor Woerner @ 2023-03-08 22:44 UTC (permalink / raw)
  To: openembedded-core

The cups' PACKAGECONFIG is populated based on DISTRO_FEATURES, but a user
is free to enable or disable PACKAGECONFIGs at will. In theory it is
possible that pam is enabled globally in DISTRO_FEATURES but disabled in
cups' PACKAGECONFIG. Checking the PACKAGECONFIG to determine whether or not
pam is enabled would be a safer check rather than relying on DISTRO_FEATURES.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 meta/recipes-extended/cups/cups.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-extended/cups/cups.inc b/meta/recipes-extended/cups/cups.inc
index b8b655a4fb85..1b522d7d8535 100644
--- a/meta/recipes-extended/cups/cups.inc
+++ b/meta/recipes-extended/cups/cups.inc
@@ -74,7 +74,7 @@ do_install () {
 	rmdir ${D}/${libexecdir}/${BPN}/driver
 
 	# Fix the pam configuration file permissions
-	if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
+	if ${@bb.utils.contains('PACKAGECONFIG', 'pam', 'true', 'false', d)}; then
 	    chmod 0644 ${D}${sysconfdir}/pam.d/cups
 	fi
 
-- 
2.36.0.rc2.17.g4027e30c53



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 3/3] cups: add/fix web interface packaging
  2023-03-08 22:44 [PATCH 1/3] cups: use BUILDROOT instead of DESTDIR Trevor Woerner
  2023-03-08 22:44 ` [PATCH 2/3] cups: check PACKAGECONFIG for pam feature Trevor Woerner
@ 2023-03-08 22:44 ` Trevor Woerner
  1 sibling, 0 replies; 3+ messages in thread
From: Trevor Woerner @ 2023-03-08 22:44 UTC (permalink / raw)
  To: openembedded-core

cups includes a web server. Users can surf to port 631 (default) of a
machine running cups to (potentially, based on configuration, default off)
view jobs, add printers, and perform other forms of administration.

The location of the various resources that are used by the built-in web server
(e.g. index.html) are installed under ${datadir}/doc/cups. By default these
artifacts would be included in the ${PN}-doc package. The comments in this
recipe, however, would suggest an attempt was made to have them added to
${PN}; albeit unsuccessfully.

These resources add roughly 1.8M to an image.

Since cups does include a configuration option to disable the web interface
(--enable-webif), add a PACKAGECONFIG (default off) to allow the user to
decide whether or not they would like the web interface configured and its
pieces added to the image. Enabling this PACKAGECONFIG both enables the
web interface to be configured and built into cups, and also adds (by way
of a recommendation) the web interface package to the image. Considering
that the previous intention was not working, defaulting this option to off
preserves the existing behaviour. Previously in order to have the web
interface data included in an image, a user would have needed to explicitly
add the ${PN}-doc package to their image.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 meta/recipes-extended/cups/cups.inc | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/meta/recipes-extended/cups/cups.inc b/meta/recipes-extended/cups/cups.inc
index 1b522d7d8535..da320b108552 100644
--- a/meta/recipes-extended/cups/cups.inc
+++ b/meta/recipes-extended/cups/cups.inc
@@ -47,6 +47,7 @@ PACKAGECONFIG[gnutls] = "--with-tls=gnutls,--with-tls=no,gnutls"
 PACKAGECONFIG[pam] = "--enable-pam --with-pam-module=unix, --disable-pam, libpam"
 PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd"
 PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd"
+PACKAGECONFIG[webif] = "--enable-webif,--disable-webif"
 
 EXTRA_OECONF = " \
                --enable-dbus \
@@ -92,7 +93,7 @@ do_install () {
 	fi
 }
 
-PACKAGES =+ "${PN}-lib ${PN}-libimage"
+PACKAGES =+ "${PN}-lib ${PN}-libimage ${PN}-webif"
 
 RDEPENDS:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}"
 FILES:${PN} += "${libexecdir}/cups/"
@@ -101,13 +102,10 @@ FILES:${PN}-lib = "${libdir}/libcups.so.*"
 
 FILES:${PN}-libimage = "${libdir}/libcupsimage.so.*"
 
-#package the html for the webgui inside the main packages (~1MB uncompressed)
+# put the html for the web interface into its own PACKAGE
+FILES:${PN}-webif += "${datadir}/doc/cups/ ${datadir}/icons/"
+RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'webif', '${PN}-webif', '', d)}"
 
-FILES:${PN} += "${datadir}/doc/cups/images \
-                ${datadir}/doc/cups/*html \
-                ${datadir}/doc/cups/*.css \
-                ${datadir}/icons/ \
-               "
 CONFFILES:${PN} += "${sysconfdir}/cups/cupsd.conf"
 
 MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/cups-config"
-- 
2.36.0.rc2.17.g4027e30c53



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-08 22:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-08 22:44 [PATCH 1/3] cups: use BUILDROOT instead of DESTDIR Trevor Woerner
2023-03-08 22:44 ` [PATCH 2/3] cups: check PACKAGECONFIG for pam feature Trevor Woerner
2023-03-08 22:44 ` [PATCH 3/3] cups: add/fix web interface packaging Trevor Woerner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox