7 |
7 |
|
8 |
8 |
DESCRIPTION="Free and Open, Distributed, RESTful Search Engine"
|
9 |
9 |
HOMEPAGE="https://www.elastic.co/elasticsearch/"
|
10 |
|
SRC_URI="https://artifacts.elastic.co/downloads/${PN}/${P}-no-jdk-linux-x86_64.tar.gz"
|
|
10 |
SRC_URI="https://artifacts.elastic.co/downloads/${PN}/${P}-linux-x86_64.tar.gz"
|
|
11 |
|
11 |
12 |
LICENSE="Apache-2.0 BSD-2 Elastic-2.0 LGPL-3 MIT public-domain"
|
12 |
13 |
SLOT="0"
|
13 |
14 |
KEYWORDS="~amd64"
|
14 |
15 |
|
|
16 |
DEPEND="acct-group/elasticsearch
|
|
17 |
acct-user/elasticsearch"
|
15 |
18 |
RDEPEND="acct-group/elasticsearch
|
16 |
19 |
acct-user/elasticsearch
|
17 |
20 |
sys-libs/zlib
|
18 |
|
virtual/jre"
|
|
21 |
virtual/jre:17"
|
19 |
22 |
|
20 |
23 |
QA_PREBUILT="usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/\(bin\|lib\)/.*"
|
21 |
24 |
QA_PRESTRIPPED="usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/\(bin\|lib\)/.*"
|
22 |
25 |
|
|
26 |
PATCHES=(
|
|
27 |
"${FILESDIR}/${PN}-env.patch"
|
|
28 |
)
|
|
29 |
|
23 |
30 |
src_prepare() {
|
24 |
31 |
default
|
25 |
32 |
|
|
33 |
rm -rf jdk || die
|
|
34 |
sed -i -e "s:logs/:${EPREFIX}/var/log/${PN}/:g" config/jvm.options || die "Unable to set Elasticsearch log location"
|
|
35 |
# elasticsearch-env sets the envvar for the config location if not specified elsewhere;
|
|
36 |
# certain utilities try and source this. Although we patch ES_JAVA_HOME for Gentoo slightly earlier,
|
|
37 |
# it's easier to respect EPREFIX for the config location using sed.
|
|
38 |
sed -i "s:ES_PATH_CONF=\"\$ES_HOME\"/config:ES_PATH_CONF=\"${EPREFIX}/etc/${PN}\":" bin/elasticsearch-env \
|
|
39 |
|| die "Unable to set Elasticsearch config directory"
|
26 |
40 |
rm LICENSE.txt NOTICE.txt || die
|
27 |
41 |
rmdir logs || die
|
28 |
42 |
}
|
... | ... | |
35 |
49 |
doins -r config/.
|
36 |
50 |
rm -r config || die
|
37 |
51 |
|
38 |
|
fowners root:${PN} /etc/${PN}
|
39 |
|
fperms 2750 /etc/${PN}
|
|
52 |
fowners -R root:${PN} /etc/${PN}
|
|
53 |
fperms -R 2750 /etc/${PN}
|
40 |
54 |
|
41 |
55 |
insinto /usr/share/${PN}
|
42 |
56 |
doins -r .
|
43 |
57 |
|
|
58 |
keepdir /usr/share/${PN}/plugins
|
|
59 |
|
44 |
60 |
exeinto /usr/share/${PN}/bin
|
45 |
|
doexe "${FILESDIR}/elasticsearch-systemd-pre-exec"
|
|
61 |
doexe "${FILESDIR}"/elasticsearch-systemd-pre-exec
|
46 |
62 |
|
47 |
63 |
fperms -R +x /usr/share/${PN}/bin
|
48 |
64 |
fperms -R +x /usr/share/${PN}/modules/x-pack-ml/platform/linux-x86_64/bin
|
... | ... | |
55 |
71 |
newins "${FILESDIR}/${PN}.sysctl.d" ${PN}.conf
|
56 |
72 |
|
57 |
73 |
newconfd "${FILESDIR}/${PN}.conf.4" ${PN}
|
58 |
|
newinitd "${FILESDIR}/${PN}.init.9" ${PN}
|
|
74 |
newinitd "${FILESDIR}/${PN}.init.8" ${PN}
|
59 |
75 |
|
60 |
76 |
systemd_install_serviced "${FILESDIR}/${PN}.service.conf"
|
61 |
|
systemd_newunit "${FILESDIR}"/${PN}.service.3 ${PN}.service
|
|
77 |
systemd_newunit "${FILESDIR}"/${PN}.service.4 ${PN}.service
|
62 |
78 |
|
63 |
79 |
newtmpfiles "${FILESDIR}"/${PN}.tmpfiles.d ${PN}.conf
|
64 |
80 |
}
|
65 |
81 |
|
66 |
82 |
pkg_postinst() {
|
|
83 |
# Elasticsearch will choke on our keep file and dodir will not preserve the empty dir
|
|
84 |
local KEEPFILE
|
|
85 |
KEEPFILE=$(find "${EROOT}/usr/share/${PN}/plugins/" -type f -name '.keep*')
|
|
86 |
rm "${KEEPFILE}" || die
|
67 |
87 |
tmpfiles_process /usr/lib/tmpfiles.d/${PN}.conf
|
68 |
|
|
69 |
|
elog
|
70 |
|
elog "You may create multiple instances of ${PN} by"
|
71 |
|
elog "symlinking the init script:"
|
72 |
|
elog "ln -sf /etc/init.d/${PN} /etc/init.d/${PN}.instance"
|
73 |
|
elog
|
74 |
|
elog "Please make sure you put elasticsearch.yml, log4j2.properties and scripts"
|
75 |
|
elog "from /etc/${PN} into the configuration directory of the instance:"
|
76 |
|
elog "/etc/${PN}/instance"
|
77 |
|
elog
|
|
88 |
if ! systemd_is_booted ; then
|
|
89 |
elog "You may create multiple instances of ${PN} by"
|
|
90 |
elog "symlinking the init script:"
|
|
91 |
elog "ln -sf /etc/init.d/${PN} /etc/init.d/${PN}.instance"
|
|
92 |
elog
|
|
93 |
elog "Please make sure you put elasticsearch.yml, log4j2.properties and scripts"
|
|
94 |
elog "from /etc/${PN} into the configuration directory of the instance:"
|
|
95 |
elog "/etc/${PN}/instance"
|
|
96 |
elog
|
|
97 |
fi
|
78 |
98 |
ewarn "Please make sure you have proper permissions on /etc/${PN}"
|
79 |
|
ewarn "prior to keystore generation or you may experience startup fails."
|
|
99 |
ewarn "prior to keystore generation or you may experience startup failures."
|
80 |
100 |
ewarn "chown root:${PN} /etc/${PN} && chmod 2750 /etc/${PN}"
|
81 |
101 |
ewarn "chown root:${PN} /etc/${PN}/${PN}.keystore && chmod 0660 /etc/${PN}/${PN}.keystore"
|
82 |
102 |
}
|