2022-01-15 14:33:49 +01:00
|
|
|
# Copyright 1999-2022 Gentoo Authors
|
2020-04-30 14:11:24 +02:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
EAPI=7
|
|
|
|
|
|
|
|
DESCRIPTION="Factorio is a game in which you build and maintain factories"
|
|
|
|
HOMEPAGE="https://www.factorio.com/"
|
|
|
|
SRC_URI="https://www.factorio.com/get-download/${PV}/headless/linux64 -> ${P}.tar.xz"
|
|
|
|
LICENSE="Factorio"
|
2020-05-31 14:09:11 +02:00
|
|
|
SLOT="${PV%.*}"
|
2021-01-29 13:59:21 +01:00
|
|
|
KEYWORDS="amd64"
|
2020-04-30 14:11:24 +02:00
|
|
|
|
2020-04-30 14:25:42 +02:00
|
|
|
DEPEND="
|
2020-04-30 14:01:05 +02:00
|
|
|
acct-group/factorio
|
|
|
|
acct-user/factorio
|
|
|
|
"
|
|
|
|
|
|
|
|
RESTRICT="bindist mirror"
|
|
|
|
|
2020-04-30 14:11:24 +02:00
|
|
|
S="${WORKDIR}/factorio"
|
|
|
|
|
|
|
|
src_install() {
|
2020-05-31 16:58:00 +02:00
|
|
|
insinto "/opt/factorio-${SLOT}"
|
2020-04-30 18:27:19 +02:00
|
|
|
doins -r *
|
2020-05-31 16:58:00 +02:00
|
|
|
exeinto "/opt/factorio-${SLOT}"/bin/x64
|
2020-04-30 14:11:24 +02:00
|
|
|
doexe bin/x64/factorio
|
2020-04-30 18:27:19 +02:00
|
|
|
|
2020-05-31 16:59:58 +02:00
|
|
|
newinitd "${FILESDIR}"/factorio.initd "factorio-${SLOT}"
|
|
|
|
newconfd "${FILESDIR}"/factorio.confd "factorio-${SLOT}"
|
2020-05-31 17:34:45 +02:00
|
|
|
|
|
|
|
sed -i "s/%SLOT%/${SLOT}/" "${D}/etc/conf.d/factorio-${SLOT}" || \
|
|
|
|
die "SLOTing sed failed"
|
2020-04-30 14:11:24 +02:00
|
|
|
}
|
2020-04-30 18:27:19 +02:00
|
|
|
|
|
|
|
pkg_postinst() {
|
|
|
|
einfo "As factorio user, copy data/server-settings.example.json to"
|
|
|
|
einfo "config/server-settings.json and data/server-whitelist.example.json"
|
|
|
|
einfo "to config/server-whitelist.json and adapt it according to your needs."
|
|
|
|
einfo ""
|
|
|
|
einfo "Then, run bin/x64/factorio --create ./saves/my-save.zip to create a"
|
|
|
|
einfo "new map, and start the service."
|
|
|
|
}
|