Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 1 | require sudo.inc |
| 2 | |
| 3 | SRC_URI = "https://www.sudo.ws/dist/sudo-${PV}.tar.gz \ |
| 4 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ |
| 5 | file://0001-sudo.conf.in-fix-conflict-with-multilib.patch \ |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 6 | " |
| 7 | |
| 8 | PAM_SRC_URI = "file://sudo.pam" |
| 9 | |
Andrew Geissler | 5082cc7 | 2023-09-11 08:41:39 -0400 | [diff] [blame] | 10 | SRC_URI[sha256sum] = "a08318b1c4bc8582c004d4cd9ae2903abc549e7e46ba815e41fe81d1c0782b62" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 11 | |
| 12 | DEPENDS += " virtual/crypt ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" |
| 13 | RDEPENDS:${PN} += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-limits pam-plugin-keyinit', '', d)}" |
| 14 | |
| 15 | CACHED_CONFIGUREVARS = " \ |
| 16 | ac_cv_type_rsize_t=no \ |
| 17 | ac_cv_path_MVPROG=${base_bindir}/mv \ |
| 18 | ac_cv_path_BSHELLPROG=${base_bindir}/sh \ |
| 19 | ac_cv_path_SENDMAILPROG=${sbindir}/sendmail \ |
| 20 | ac_cv_path_VIPROG=${base_bindir}/vi \ |
| 21 | " |
| 22 | |
| 23 | EXTRA_OECONF += " \ |
| 24 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \ |
| 25 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--enable-tmpfiles.d=${nonarch_libdir}/tmpfiles.d', '--disable-tmpfiles.d', d)} \ |
| 26 | --with-rundir=/run/sudo \ |
| 27 | --with-vardir=/var/lib/sudo \ |
| 28 | --libexecdir=${libdir} \ |
| 29 | " |
| 30 | |
| 31 | do_install:append () { |
| 32 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then |
| 33 | install -D -m 644 ${WORKDIR}/sudo.pam ${D}/${sysconfdir}/pam.d/sudo |
| 34 | if ${@bb.utils.contains('PACKAGECONFIG', 'pam-wheel', 'true', 'false', d)} ; then |
| 35 | echo 'auth required pam_wheel.so use_uid' >>${D}${sysconfdir}/pam.d/sudo |
| 36 | sed -i 's/# \(%wheel ALL=(ALL) ALL\)/\1/' ${D}${sysconfdir}/sudoers |
| 37 | fi |
| 38 | fi |
| 39 | |
| 40 | chmod 4111 ${D}${bindir}/sudo |
| 41 | chmod 0440 ${D}${sysconfdir}/sudoers |
| 42 | |
| 43 | # Explicitly remove the /sudo directory to avoid QA error |
| 44 | rmdir -p --ignore-fail-on-non-empty ${D}/run/sudo |
| 45 | } |
| 46 | |
| 47 | FILES:${PN}-dev += "${libdir}/${BPN}/lib*${SOLIBSDEV} ${libdir}/${BPN}/*.la \ |
| 48 | ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la" |
| 49 | |
| 50 | CONFFILES:${PN}-lib = "${sysconfdir}/sudoers" |
| 51 | |
| 52 | SUDO_PACKAGES = "${PN}-sudo\ |
| 53 | ${PN}-lib" |
| 54 | |
| 55 | PACKAGE_BEFORE_PN = "${SUDO_PACKAGES}" |
| 56 | |
| 57 | RDEPENDS:${PN}-sudo = "${PN}-lib" |
| 58 | RDEPENDS:${PN} += "${SUDO_PACKAGES}" |
| 59 | |
| 60 | FILES:${PN}-sudo = "${bindir}/sudo ${bindir}/sudoedit" |
| 61 | FILES:${PN}-lib = "${localstatedir} ${libexecdir} ${sysconfdir} ${libdir} ${nonarch_libdir}" |