xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-oe/recipes-extended/vlock/vlock_2.2.3.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSUMMARY = "Virtual Console lock program"
2*4882a593SmuzhiyunDESCRIPTION = "Sometimes a malicious local user could cause more problems \
3*4882a593Smuzhiyun  than a sophisticated remote one. vlock is a program that locks one or more \
4*4882a593Smuzhiyun  sessions on the Linux console to prevent attackers from gaining physical \
5*4882a593Smuzhiyun  access to the machine. \
6*4882a593Smuzhiyun  "
7*4882a593SmuzhiyunSECTION = "utils"
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunLICENSE = "GPL-2.0-only"
10*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=a17cb0a873d252440acfdf9b3d0e7fbf"
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunSRC_URI = "${GENTOO_MIRROR}/${BP}.tar.gz \
13*4882a593Smuzhiyun       file://disable_vlockrc.patch \
14*4882a593Smuzhiyun       file://vlock_pam_tally2_reset.patch \
15*4882a593Smuzhiyun       file://vlock-no_tally.patch \
16*4882a593Smuzhiyun       file://vlock_pam \
17*4882a593Smuzhiyun       "
18*4882a593Smuzhiyun
19*4882a593SmuzhiyunSRC_URI[md5sum] = "378175c7692a8f288e65fd4dbf8a38eb"
20*4882a593SmuzhiyunSRC_URI[sha256sum] = "85aa5aed1ae49351378a0bd527a013078f0f969372a63164b1944174ae1a5e39"
21*4882a593Smuzhiyun
22*4882a593Smuzhiyuninherit autotools-brokensep update-alternatives
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun# authentification method: either pam or shadow
25*4882a593SmuzhiyunPACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', 'shadow', d)}"
26*4882a593SmuzhiyunPACKAGECONFIG[pam] = "--enable-pam,,libpam,"
27*4882a593SmuzhiyunPACKAGECONFIG[shadow] = "--enable-shadow,,shadow,"
28*4882a593Smuzhiyun
29*4882a593SmuzhiyunCFLAGS += "-Wall -W -pedantic -std=gnu99"
30*4882a593Smuzhiyun
31*4882a593Smuzhiyundo_configure () {
32*4882a593Smuzhiyun    # The configure tries to use 'getent' to get the group
33*4882a593Smuzhiyun    # info from the host, which should be avoided.
34*4882a593Smuzhiyun    sed -i 's/\(ROOT_GROUP=\).*/\1"root"/' ${CONFIGURE_SCRIPT}
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun    ${CONFIGURE_SCRIPT} \
37*4882a593Smuzhiyun        VLOCK_GROUP=root \
38*4882a593Smuzhiyun        ROOT_GROUP=root \
39*4882a593Smuzhiyun        CC="${CC}" \
40*4882a593Smuzhiyun        CFLAGS="${CFLAGS}" \
41*4882a593Smuzhiyun        LDFLAGS="${LDFLAGS}" \
42*4882a593Smuzhiyun        --prefix=${prefix} \
43*4882a593Smuzhiyun        --libdir=${libdir} \
44*4882a593Smuzhiyun        --mandir=${mandir} \
45*4882a593Smuzhiyun        --with-modules="all.so new.so nosysrq.so ttyblank.so vesablank.so" \
46*4882a593Smuzhiyun        --disable-root-password --enable-debug --disable-fail-count \
47*4882a593Smuzhiyun        ${PACKAGECONFIG_CONFARGS}
48*4882a593Smuzhiyun}
49*4882a593Smuzhiyun
50*4882a593Smuzhiyundo_install:append () {
51*4882a593Smuzhiyun    if [ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'yes', '', d)} = yes ]; then
52*4882a593Smuzhiyun        install -d -m 0755 ${D}/${sysconfdir}/pam.d
53*4882a593Smuzhiyun        install -m 0644 ${WORKDIR}/vlock_pam ${D}${sysconfdir}/pam.d/vlock
54*4882a593Smuzhiyun    fi
55*4882a593Smuzhiyun}
56*4882a593Smuzhiyun
57*4882a593SmuzhiyunALTERNATIVE:${PN} = "vlock"
58*4882a593SmuzhiyunALTERNATIVE_PRIORITY = "60"
59*4882a593SmuzhiyunALTERNATIVE_LINK_NAME[vlock] = "${bindir}/vlock"
60