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 | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 5 | " |
| 6 | |
| 7 | PAM_SRC_URI = "file://sudo.pam" |
| 8 | |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame^] | 9 | SRC_URI[sha256sum] = "294116cefe10a02773917fc7440d8384b925955bc96a6e0eaa1977c83b34adff" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 10 | |
| 11 | DEPENDS += " virtual/crypt ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" |
| 12 | RDEPENDS_${PN} += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-limits pam-plugin-keyinit', '', d)}" |
| 13 | |
| 14 | CACHED_CONFIGUREVARS = " \ |
| 15 | ac_cv_type_rsize_t=no \ |
| 16 | ac_cv_path_MVPROG=${base_bindir}/mv \ |
| 17 | ac_cv_path_BSHELLPROG=${base_bindir}/sh \ |
| 18 | ac_cv_path_SENDMAILPROG=${sbindir}/sendmail \ |
| 19 | ac_cv_path_VIPROG=${base_bindir}/vi \ |
| 20 | " |
| 21 | |
| 22 | EXTRA_OECONF += " \ |
| 23 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \ |
| 24 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--enable-tmpfiles.d=${nonarch_libdir}/tmpfiles.d', '--disable-tmpfiles.d', d)} \ |
| 25 | --with-vardir=/var/lib/sudo \ |
| 26 | " |
| 27 | |
| 28 | do_install_append () { |
| 29 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then |
| 30 | install -D -m 644 ${WORKDIR}/sudo.pam ${D}/${sysconfdir}/pam.d/sudo |
| 31 | if ${@bb.utils.contains('PACKAGECONFIG', 'pam-wheel', 'true', 'false', d)} ; then |
| 32 | echo 'auth required pam_wheel.so use_uid' >>${D}${sysconfdir}/pam.d/sudo |
| 33 | sed -i 's/# \(%wheel ALL=(ALL) ALL\)/\1/' ${D}${sysconfdir}/sudoers |
| 34 | fi |
| 35 | fi |
| 36 | |
| 37 | chmod 4111 ${D}${bindir}/sudo |
| 38 | chmod 0440 ${D}${sysconfdir}/sudoers |
| 39 | |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame^] | 40 | # Explicitly remove the /sudo directory to avoid QA error |
| 41 | rmdir -p --ignore-fail-on-non-empty ${D}/sudo |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | FILES_${PN} += "${nonarch_libdir}/tmpfiles.d" |
| 45 | FILES_${PN}-dev += "${libexecdir}/${BPN}/lib*${SOLIBSDEV} ${libexecdir}/${BPN}/*.la \ |
| 46 | ${libexecdir}/lib*${SOLIBSDEV} ${libexecdir}/*.la" |