summaryrefslogtreecommitdiff
blob: 0ae63dfa9ec5e336621fedbfc551fb600ab6ad7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit toolchain-funcs pam

DESCRIPTION="Lightweight Linux console locking tool"
HOMEPAGE="https://github.com/muennich/physlock"
SRC_URI="https://github.com/muennich/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"

IUSE="elogind systemd"
REQUIRED_USE="?? ( elogind systemd )"

RDEPEND="sys-libs/pam"
DEPEND="${RDEPEND}
	elogind? ( sys-auth/elogind )
	systemd? ( sys-apps/systemd )
"

PATCHES=(
	"${FILESDIR}/${PN}-13-Set-PAM_TTY.patch"
)

pkg_setup() {
	export MY_CONF="HAVE_SYSTEMD=$(usex systemd 1 0) HAVE_ELOGIND=$(usex elogind 1 0)"
}

src_prepare() {
	default
	tc-export CC
}

src_compile() {
	emake ${MY_CONF}
}

src_install() {
	emake ${MY_CONF} DESTDIR="${D}" PREFIX=/usr install
	newpamd physlock.pam ${PN}
}