blob: 259d3a5e161ddf4943efc192103c723d4923cbd5 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001SUMMARY = "Virtual Console lock program"
2DESCRIPTION = "Sometimes a malicious local user could cause more problems \
3 than a sophisticated remote one. vlock is a program that locks one or more \
4 sessions on the Linux console to prevent attackers from gaining physical \
5 access to the machine. \
6 "
7SECTION = "utils"
8
9LICENSE = "GPLv2"
10LIC_FILES_CHKSUM = "file://COPYING;md5=a17cb0a873d252440acfdf9b3d0e7fbf"
11
12SRC_URI = "${GENTOO_MIRROR}/${BP}.tar.gz \
13 file://disable_vlockrc.patch \
14 file://vlock_pam_tally2_reset.patch \
15 file://vlock-no_tally.patch \
16 file://vlock_pam \
17 "
18
19SRC_URI[md5sum] = "378175c7692a8f288e65fd4dbf8a38eb"
20SRC_URI[sha256sum] = "85aa5aed1ae49351378a0bd527a013078f0f969372a63164b1944174ae1a5e39"
21
22inherit autotools-brokensep update-alternatives
23
24# authentification method: either pam or shadow
25PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', 'shadow', d)}"
26PACKAGECONFIG[pam] = "--enable-pam,,libpam,"
27PACKAGECONFIG[shadow] = "--enable-shadow,,shadow,"
28
29CFLAGS += "-Wall -W -pedantic -std=gnu99"
30
31do_configure () {
32 # The configure tries to use 'getent' to get the group
33 # info from the host, which should be avoided.
34 sed -i 's/\(ROOT_GROUP=\).*/\1"root"/' ${CONFIGURE_SCRIPT}
35
36 ${CONFIGURE_SCRIPT} \
37 VLOCK_GROUP=root \
38 ROOT_GROUP=root \
39 CC="${CC}" \
40 CFLAGS="${CFLAGS}" \
41 LDFLAGS="${LDFLAGS}" \
42 --prefix=${prefix} \
43 --libdir=${libdir} \
44 --mandir=${mandir} \
45 --with-modules="all.so new.so nosysrq.so ttyblank.so vesablank.so" \
46 --disable-root-password --enable-debug --disable-fail-count \
47 ${PACKAGECONFIG_CONFARGS}
48}
49
50do_install_append () {
51 if [ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'yes', '', d)} = yes ]; then
52 install -d -m 0755 ${D}/${sysconfdir}/pam.d
53 install -m 0644 ${WORKDIR}/vlock_pam ${D}${sysconfdir}/pam.d/vlock
54 fi
55}
56
57ALTERNATIVE_${PN} = "vlock"
58ALTERNATIVE_PRIORITY = "60"
59ALTERNATIVE_LINK_NAME[vlock] = "${bindir}/vlock"