app-misc/kloak - 9999 (guru)

Search

Install

Install this version:

emerge -a =app-misc/kloak-9999

If this version is masked, you can unmask it using the autounmask tool or standard emerge options:

autounmask =app-misc/kloak-9999

Or alternatively:

emerge --autounmask-write -a =app-misc/kloak-9999

Package Information

Description:
A privacy tool that makes keystroke biometrics less effective
Homepage:
https://github.com/Whonix/kloak
License:
BSD

Ebuild Details

Version EAPI Keywords Slot
9999 8 ~amd64 0
View Raw Ebuild
# Copyright 2022-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit toolchain-funcs linux-info udev

MY_PV="${PV/_p/-}"
MY_P="${PN}-${MY_PV}"

if [[ ${PV} == *9999* ]]; then
	EGIT_REPO_URI="https://github.com/Whonix/kloak.git"
	inherit git-r3
else
	SRC_URI="https://github.com/Whonix/kloak/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
	KEYWORDS="~amd64"
	S="${WORKDIR}/${MY_P}"
fi

DESCRIPTION="A privacy tool that makes keystroke biometrics less effective"
HOMEPAGE="https://github.com/Whonix/kloak"

LICENSE="BSD"
SLOT="0"
IUSE="systemd apparmor"

DEPEND="
	dev-libs/libevdev
	dev-libs/libsodium
"
RDEPEND="${DEPEND}"
BDEPEND="app-text/ronn-ng"

pkg_pretend() {
	local CONFIG_CHECK="~UINPUT"
	[[ ${MERGE_TYPE} != buildonly ]] && check_extra_config
}

src_prepare() {
	default

	# force manpages to be regenerated
	rm auto-generated-man-pages/* || die

	# respect our prefix in scripts
	[[ -z "$EPREFIX" ]] || sed -i -e "s!/usr/sbin/!${EPREFIX}/usr/sbin/!" \
		etc/apparmor.d/usr.sbin.kloak \
		usr/lib/systemd/system/kloak.service || die
}

src_configure() {
	tc-export CC PKG_CONFIG
}

src_install() {
	local my_makeopts=(
		prefix="${EPREFIX}/usr"
	)
	use systemd || my_makeopts+=(
		udev_rules_dir=deleteme
		systemd_dir=deleteme
	)
	use apparmor || my_makeopts+=(
		apparmor_dir=deleteme
	)

	emake DESTDIR="${D}" "${my_makeopts[@]}"  install

	if [[ -d "${D}/deleteme" ]]; then
		rm -r "${D}/deleteme" || die
	fi
}

pkg_postinst() {
	if use systemd; then
		elog "systemd kloak service is installed; kloak will automatically restart"
		elog "to handle newly attached each newly attached input device."
	else
		elog "kloak is installed without any service support. You will have"
		elog "to manually launch and stop it, see kloak's documentation:"
		elog "  https://github.com/vmonaco/kloak"
	fi

	use systemd && udev_reload
}

pkg_postrm() {
	use systemd && udev_reload
}

USE Flags

Manage flags for this package: euse -i <flag> -p app-misc/kloak | euse -E <flag> -p app-misc/kloak | euse -D <flag> -p app-misc/kloak

Global/Standard Flags

Inherited Eclasses

Dependencies

DEPEND

	dev-libs/libevdev
	dev-libs/libsodium

RDEPEND

	dev-libs/libevdev
	dev-libs/libsodium

BDEPEND

app-text/ronn-ng