sudo_1.7.2p1: Update recipe to support DISTRO_FEATURES = "pam".
authorDavid-John Willis <John.Willis@Distant-earth.com>
Tue, 24 Nov 2009 15:44:09 +0000 (15:44 +0000)
committerDavid-John Willis <John.Willis@Distant-earth.com>
Thu, 8 Apr 2010 07:19:34 +0000 (08:19 +0100)
* The recipe now uses the DISTRO_FEATURES flag to decide if PAM support is requested at build time.
* NOTE: There is a caveat. The DISTRO_FEATURES is only really relevant if the package can have PAM enabled or disabled at build time. If the package needs PAM to build/work then the DISTRO_FEATURES are totally academic and should not be used.

recipes/sudo/sudo_1.7.2p4.bb

index 3fe7aef..d77462b 100644 (file)
@@ -1,22 +1,30 @@
-PR = "r3"
+# Enable PAM suport in SUDO (and supporting service file) only is DISTRO wants PAM.
+OVERRIDES .= "${@base_contains('DISTRO_FEATURES', 'pam', ':pam-support', '', d)}"
 
-DEPENDS = "libpam"
-RDEPENDS = "libpam libpam-meta"
+DEPENDS_append_pam-support = "libpam"
+RDEPENDS_append_pam-support = "libpam libpam-meta"
+PR = "r1"
 
 SRC_URI = "http://ftp.sudo.ws/sudo/dist/sudo-${PV}.tar.gz;name=src \
-  file://sudo.pamd \
 "
 
 SRC_URI[src.md5sum] = "3989e5a00538247d7dcef8b514076752"
 SRC_URI[src.sha256sum] = "57d9adbdffa881e32894231079da7d68ffe99f46942818b63baadf6c795b7bdd"
 
-EXTRA_OECONF += " --with-pam "
+SRC_URI_append_pam-support = "file://sudo.pamd"
+                  
+EXTRA_OECONF += " \
+  ${@base_contains('DISTRO_FEATURES', 'pam', '--with-pam=yes', '--with-pam=no', d)} \ 
+"
 
 require sudo.inc
 
-# Do in the recipe not the common inc as not all SUDO recipes want PAM support.
+# Update DESCRIPTION to show it is build with PAM after include file.
+DESCRIPTION_append_pam-support = " (with PAM support) "
 
-do_install_append() {
+do_install_append_pam-support() {
   install -d ${D}${sysconfdir}/pam.d/  
   install -m 0644 ${WORKDIR}/sudo.pamd ${D}${sysconfdir}/pam.d/sudo 
 }
+
+FILES_append_pam-support = "${sysconfdir}/pam.d"