summaryrefslogtreecommitdiff
path: root/dev-perl/baldeagleos-report/baldeagleos-report-3.2.2-r1.ebuild
blob: 71cf79656f682ee3d113244364685cdb11cecfa2 (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
# Copyright 2021-2023 BaldEagleOS Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8

inherit perl-module bash-completion-r1

DESCRIPTION="Anonymous reporting tool for BaldEagleOS Linux"
HOMEPAGE="https://git.baldeagleos.com/baldeagleos-reporter"
GIT_COMMIT="b6caba46a8f0b1169ed2e375becfcf9cf1234163"
SRC_URI="https://git.baldeagleos.com/baldeagleos-reporter/archive/${GIT_COMMIT}.tar.gz -> ${P}.tar.gz"
KEYWORDS="*"
S="${WORKDIR}/baldeagleos-reporter-${GIT_COMMIT}"

LICENSE="MIT"
SLOT="0"
IUSE="${IUSE} bash-completion zsh-completion"

RDEPEND="
	dev-perl/JSON
	sys-apps/pciutils
"

DIST_TEST="do parallel"

src_compile() {
	pod2man baldeagleos-report > baldeagleos-report.1 || die "pod2man failed"
	pod2man lib/BaldEagleOS/Report.pm > baldeagleos-report.3 || die "pod2man failed"
}

src_install() {
	insinto /etc
	doins "${FILESDIR}/baldeagleos-report.conf"
	dodoc README.md
	doman baldeagleos-report.1 baldeagleos-report.3

	# Install bash completion files
	if use bash-completion; then
		newbashcomp share/bash-completion/baldeagleos-report.bash baldeagleos-report
	fi

	# Install zsh completion files
	if use zsh-completion; then
		insinto /usr/share/zsh/site-functions
		doins share/zsh-completion/_baldeagleos-report
	fi

	perl-module_src_install
}

pkg_postinst() {
	elog BaldEagleOS Reporter - Stable release
	elog "The BaldEagleOS Reporter comes with a default config file that can be found in /etc/baldeagleos-report.conf"
	elog "You can review what information gets submitted and generate/update your config file"
	elog "using the tool directly by issuing:"
	echo
	elog "baldeagleos-report -u"
	echo
	elog "It is recommended to run --update-config|-u after any major release."
	elog "You can setup a cron job to submit your information on regular basis."
	elog "The data collected are submitted with a timestamp, so changes can be followed in time (like kits used, profile usage ...)."
	elog "Here is a sample cron job definition to put into your crontab:"
	echo
	elog "0 * * * * /usr/bin/baldeagleos-report -s"
	echo
	elog "This would send data every hour to the database."
	echo
}