summaryrefslogtreecommitdiff
path: root/dev-perl/baldeagleos-report/baldeagleos-report-9999.ebuild
blob: 113b83f3354af4eb2be61d0d38de1352d0d525ab (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Copyright 2021-2022 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"

if [[ ${PV} == 9999* ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://git.baldeagleos.com/baldeagleos-reporter.git"
	EGIT_BRANCH="develop"
	SRC_URI=""
	KEYWORDS=""
	IUSE="test"
else
	SRC_URI="https://git.baldeagleos.com/baldeagleos-reporter/archive/v${PV}.tar.gz -> ${P}.tar.gz"
	KEYWORDS="*"
	S="${WORKDIR}/baldeagleos-reporter-${PV}"
fi

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"
	if [[ ${PV} == 9999* ]]; then
		./bump_version.sh describe # change the version to show latest commit hash
	fi
}

src_install() {
	insinto /etc
	doins "${FILESDIR}/baldeagleos-report.conf"
	dodoc README.md
	doman baldeagleos-report.1
	doman 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() {
if [[ ${PV} == 9999* ]]; then
	elog BaldEagleOS Reporter - Development release
	elog ====================================================================
	elog WARNING: You are using a version that is tracking the $EGIT_BRANCH
	elog Things can be broken. If you want a stable release use version <9999
	elog ====================================================================
else
	elog BaldEagleOS Reporter - Stable release
fi
	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
}