blob: b93112fa3fd1d77e14c1d393593bfd6db22f4819 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001require sudo.inc
2
3SRC_URI = "http://ftp.sudo.ws/sudo/dist/sudo-${PV}.tar.gz \
4 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
5 file://0001-Use-correct-path-to-init.d-and-tmpfiles.d-files.patch \
6 file://0001-Include-sys-types.h-for-id_t-definition.patch \
7 "
8
9PAM_SRC_URI = "file://sudo.pam"
10
11SRC_URI[md5sum] = "93dbd1e47c136179ff1b01494c1c0e75"
12SRC_URI[sha256sum] = "a8a697cbb113859058944850d098464618254804cf97961dee926429f00a1237"
13
14DEPENDS += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
15RDEPENDS_${PN} += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-limits pam-plugin-keyinit', '', d)}"
16
17EXTRA_OECONF += " \
18 ac_cv_type_rsize_t=no \
19 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \
20 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--enable-tmpfiles.d=${libdir}/tmpfiles.d', '--disable-tmpfiles.d', d)} \
21 "
22
23do_install_append () {
24 if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
Patrick Williamsf1e5d692016-03-30 15:21:19 -050025 install -D -m 644 ${WORKDIR}/sudo.pam ${D}/${sysconfdir}/pam.d/sudo
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026 fi
27
28 chmod 4111 ${D}${bindir}/sudo
29 chmod 0440 ${D}${sysconfdir}/sudoers
30
31 # Explicitly remove the ${localstatedir}/run directory to avoid QA error
32 rmdir -p --ignore-fail-on-non-empty ${D}${localstatedir}/run/sudo
33}
34
35FILES_${PN} += "${libdir}/tmpfiles.d"
36FILES_${PN}-dev += "${libdir}/${BPN}/lib*${SOLIBSDEV} ${libdir}/${BPN}/*.la"