summaryrefslogtreecommitdiff
blob: 10da88e012a86dafb7f6dc5989240a2ba5147701 (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
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit bash-completion-r1

DESCRIPTION="A dotfile manager for the config files in your home folder"
HOMEPAGE="https://github.com/TheLocehiliosan/yadm/"
SRC_URI="https://github.com/TheLocehiliosan/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test"

RESTRICT="!test? ( test )"

RDEPEND="
	app-crypt/gnupg
	dev-vcs/git
"

DEPEND="
	test? ( ${RDEPEND}
		dev-python/pytest
		dev-tcltk/expect
	)
"

src_compile() {
	emake "${PN}.md"
}

src_test() {
	# test_encryption: needs write access to /tmp
	# test_alt, test_compat_jinja, test_unit_template_j2: needs envtpl
	# test_syntax: needs yamllint (not packaged)
	# test_compat_alt: known broken, tests deprecated features
	# test_compat_jinja: needs envtpl
	rm -v test/test_encryption.py || die
	rm -v test/test_alt.py || die
	rm -v test/test_compat_jinja.py || die
	rm -v test/test_unit_template_j2.py || die
	rm -v test/test_syntax.py || die
	rm -v test/test_compat_alt.py || die

	pytest || die "Testsuite failed under ${EPYTHON}"
}

src_install() {
	einstalldocs

	dobin "${PN}"
	doman "${PN}.1"

	newbashcomp completion/yadm.bash_completion yadm

	insinto /usr/share/zsh/site-functions
	newins completion/yadm.zsh_completion _${PN}
}