# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DESCRIPTION="Prevents you from committing sensitive info to a git repository."
HOMEPAGE="https://github.com/awslabs/git-secrets"
SHA="5357e18bc27b42a827b6780564ea873a72ca1f01"
SRC_URI="https://github.com/awslabs/git-secrets/archive/${SHA}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~ppc64 ~x86"
IUSE="man"
RDEPEND=">=dev-vcs/git-2.10.2"
DEPEND="${RDEPEND}"
BDEPEND="
man? (
|| (
dev-python/sphinx
dev-python/docutils
)
virtual/man
)
"
S="${WORKDIR}/${PN}-${SHA}"
src_compile() {
if use man; then
if command -v sphinx-build &> /dev/null; then
sphinx-build -b man . "${S}"
elif command -v rst2man &> /dev/null; then
emake man
elif command -v rst2man.py &> /dev/null; then
sed -i 's/rst2man/rst2man.py/g' Makefile
emake man
else
ewarn "Neither sphinx-build nor rst2man found, skipping man page generation"
fi
fi
}
src_install() {
emake DESTDIR="${D}" PREFIX=/usr install
if use man && [ -f "${PN}.1" ]; then
doman "${PN}.1"
fi
einstalldocs
}