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

EAPI=7

inherit java-pkg-2

DESCRIPTION="Lightning-fast unified analytics engine"
HOMEPAGE="https://spark.apache.org"
SRC_URI="mirror://apache/spark/spark-${PV}/spark-${PV}-bin-hadoop3.2.tgz -> ${P}-hadoop.tgz"

LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="~amd64"

RDEPEND="
	>=virtual/jre-1.8"

DEPEND="
	>=virtual/jdk-1.8"

S="${WORKDIR}/spark-${PV}-bin-hadoop3.2"

DOCS=( LICENSE NOTICE README.md RELEASE )

# Nothing to compile here.
src_compile() { :; }

src_install() {
	dodir usr/lib/spark-${SLOT}
	into usr/lib/spark-${SLOT}

	local spark_scripts=(
		bin/beeline
		bin/find-spark-home
		bin/load-spark-env.sh
		bin/pyspark
		bin/spark-class
		bin/spark-shell
		bin/spark-sql
		bin/spark-submit
	)

	local s
	for s in "${spark_scripts[@]}"; do
		dobin "${s}"
	done

	insinto usr/lib/spark-${SLOT}

	local spark_dirs=( conf jars python sbin yarn )

	local d
	for d in "${spark_dirs[@]}"; do
		doins -r "${d}"
	done

	newenvd - "50${PN}${SLOT}" <<-_EOF_
		PATH="/usr/lib/spark-${SLOT}/bin:/usr/lib/spark-${SLOT}/sbin"
		SPARK_HOME="/usr/lib/spark-${SLOT}"
	_EOF_

	einstalldocs
}

pkg_postinst() {
	einfo
	einfo "Spark is now slotted. You have installed Spark ${SLOT}."
	einfo
}