Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [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)} \ |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 5 | file://0001-sudo.conf.in-fix-conflict-with-multilib.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 6 | " |
| 7 | |
| 8 | PAM_SRC_URI = "file://sudo.pam" |
| 9 | |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 10 | SRC_URI[sha256sum] = "391431f454e55121b60c6ded0fcf30ddb80d623d7d16a6d1907cfa6a0b91d8cf" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [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)} \ |
Andrew Geissler | b7d2861 | 2020-07-24 16:15:54 -0500 | [diff] [blame] | 26 | --with-rundir=/run/sudo \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 27 | --with-vardir=/var/lib/sudo \ |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 28 | --libexecdir=${libdir} \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 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 | |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 43 | # Explicitly remove the /sudo directory to avoid QA error |
Andrew Geissler | b7d2861 | 2020-07-24 16:15:54 -0500 | [diff] [blame] | 44 | rmdir -p --ignore-fail-on-non-empty ${D}/run/sudo |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 45 | } |
| 46 | |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 47 | FILES_${PN}-dev += "${libdir}/${BPN}/lib*${SOLIBSDEV} ${libdir}/${BPN}/*.la \ |
| 48 | ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la" |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 49 | |
| 50 | SUDO_PACKAGES = "${PN}-sudo\ |
| 51 | ${PN}-lib" |
| 52 | |
| 53 | PACKAGE_BEFORE_PN = "${SUDO_PACKAGES}" |
| 54 | |
| 55 | RDEPENDS_${PN}-sudo = "${PN}-lib" |
| 56 | RDEPENDS_${PN} += "${SUDO_PACKAGES}" |
| 57 | |
| 58 | FILES_${PN}-sudo = "${bindir}/sudo ${bindir}/sudoedit" |
| 59 | FILES_${PN}-lib = "${localstatedir} ${libexecdir} ${sysconfdir} ${libdir} ${nonarch_libdir}" |