summaryrefslogtreecommitdiff
blob: 3b4b5b17dc22a0c729bee03b16a8f175ccbc6de1 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

CMAKE_IN_SOURCE_BUILD=1
inherit cmake pam readme.gentoo-r1 systemd

# Long ago it was just "poppassd", but upstream now seems to have
# settled on "poppassd-ceti" (instead of "poppassd_ceti" or no suffix).
MY_PN="poppassd-ceti"
MY_P="${MY_PN}-${PV}"

DESCRIPTION="Password change daemon with PAM support"
HOMEPAGE="https://github.com/kravietz/poppassd-ceti"
SRC_URI="https://github.com/kravietz/${MY_PN}/archive/v${PV}.tar.gz -> ${MY_P}.tar.gz"

LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="test"

# Tests seem to hang.
RESTRICT="test"

RDEPEND="sys-libs/pam"
DEPEND="${RDEPEND}
	test? ( app-admin/sudo )"

S="${WORKDIR}/${MY_P}"

DISABLE_AUTOFORMATTING=1
DOC_CONTENTS="poppassd is installed, but has to be run as root to work.

Most commonly a front end would require sys-apps/xinetd and connect to
port 106: For this, edit /etc/xinetd.d/poppassd, install sys-apps/xinetd,
and start the xinetd service.

If you use systemd, you may be able to use the installed poppassd.socket
and poppassd.service files instead of xinetd.  See README.md.bz2 and
systemd documentation.

Alternatively, a front end may be able to run it directly (if already
root), or might use app-admin/sudo.  To use sudo, you'll need to configure
/etc/sudoers with something similar to:

	apache ALL=(ALL) NOPASSWD: /usr/sbin/poppassd

See also README.md.bz2 for related configuration and security
considerations.
"

src_install() {
	dodoc README.md
	readme.gentoo_create_doc

	pamd_mimic_system poppassd auth account password

	insinto /etc/xinetd.d
	newins "${FILESDIR}"/poppassd.xinetd poppassd

	systemd_dounit etc/systemd/poppassd.{socket,service}

	exeinto /usr/sbin
	exeopts -o root -g bin -m 500
	doexe poppassd
}

pkg_postinst() {
	readme.gentoo_print_elog
}