summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorxiretza2017-04-14 00:26:58 +0200
committerxiretza2017-04-14 00:26:58 +0200
commitd3d4ac1a37bf02c496988426ca85ebcdbc45d412 (patch)
tree682df5d9af488cc55e1a63a1288ea9cf2ae126d8
downloadaur-d3d4ac1a37bf02c496988426ca85ebcdbc45d412.tar.gz
initial commit
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD40
-rw-r--r--factorio-init.conf59
-rw-r--r--factorio-init.service22
4 files changed, 140 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..ad2963e13c7
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = factorio-init
+ pkgdesc = A simple factorio init script for linux
+ pkgver = 2.5.0
+ pkgrel = 1
+ url = https://github.com/Bisa/factorio-init
+ arch = any
+ license = MIT
+ depends = bash
+ depends = factorio-headless
+ backup = etc/conf.d/factorio-init
+ source = https://github.com/Bisa/factorio-init/archive/2.5.0.tar.gz
+ source = factorio-init.service
+ source = factorio-init.conf
+ sha256sums = a1d90b5b1804a932e258ccf43dfd7cd7ffcd44ae8b83d87203187f0469d17789
+ sha256sums = 876eba92ba84dfc473fa23915525c4123cebfec474151704c515aae18ae81dfb
+ sha256sums = 0dd4fd75cf3448451a1b55bdf6bc38a4b9654a8d125cac391b180f70732a62e0
+
+pkgname = factorio-init
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..56835354520
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,40 @@
+# Maintainer: xiretza <xiretza+aur@gmail.com>
+pkgname=factorio-init
+pkgver=2.5.0
+pkgrel=1
+pkgdesc="A simple factorio init script for linux"
+arch=('any')
+url="https://github.com/Bisa/factorio-init"
+license=('MIT')
+depends=('bash'
+ 'factorio-headless')
+backup=("etc/conf.d/factorio-init")
+source=("https://github.com/Bisa/factorio-init/archive/${pkgver}.tar.gz"
+ "factorio-init.service"
+ "factorio-init.conf")
+sha256sums=('a1d90b5b1804a932e258ccf43dfd7cd7ffcd44ae8b83d87203187f0469d17789'
+ '876eba92ba84dfc473fa23915525c4123cebfec474151704c515aae18ae81dfb'
+ '0dd4fd75cf3448451a1b55bdf6bc38a4b9654a8d125cac391b180f70732a62e0')
+
+package() {
+ cd "${srcdir}"
+
+ install -Dm644 factorio-init.service -t "${pkgdir}/usr/lib/systemd/system/"
+ install -Dm644 factorio-init.conf "${pkgdir}/etc/conf.d/factorio-init"
+
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/factorio-init/"
+
+ _pkgdir="${pkgdir}/usr/share/${pkgname}/"
+ install -Dm644 bash_autocomplete -t "${_pkgdir}"
+ install -D factorio "${_pkgdir}/factorio-init"
+
+ install -d "${pkgdir}/usr/share/bash-completion/completions/"
+ install -d "${pkgdir}/usr/bin/"
+
+ ln -s "/usr/share/${pkgname}/bash_autocomplete" "${pkgdir}/usr/share/bash-completion/completions/factorio-init"
+ ln -s "/usr/share/${pkgname}/factorio-init" "${pkgdir}/usr/bin/factorio-init"
+ ln -s "/etc/conf.d/factorio-init" "${_pkgdir}/config"
+
+}
diff --git a/factorio-init.conf b/factorio-init.conf
new file mode 100644
index 00000000000..a7f3d0b19ed
--- /dev/null
+++ b/factorio-init.conf
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+# Enable debugging, useful when you want to figure out why
+# this script is not behaving the way you expect it to do
+DEBUG=0
+
+# What do you want to call this service?
+SERVICE_NAME="Factorio-init"
+
+# Which user/group is running factorio?
+# Running any public service as "root" is generally not recommended
+USERNAME=factorio
+USERGROUP=games
+
+# The absolute path to the factorio directory
+FACTORIO_PATH=/var/lib/factorio/.factorio
+WRITE_DIR=/var/lib/factorio/.factorio
+BINARY=/usr/bin/factorio
+# Server settings file, see data/server-settings.example.json
+SERVER_SETTINGS=/etc/factorio/server-settings.json
+
+# Port on which you want to run the server
+PORT=34197
+
+# Save the command/chat/log on server start? Default location /opt/factorio/server.out
+# Setting this to 0 will cause the script to erase the log file on each start
+# If you set this to 1 you might want to apply logrotate on the log or it will eventually fill your disk
+SAVELOG=0
+
+# Factorio comes packaged in a tarball containing the directory named "factorio"
+# when using this scripts update/install command we expect to see this very
+# directory. If you want to supply your own update/install tar other than what you can download
+# from factorio.com/download-headless you can use this option to tell the script this is ok.
+#
+# If you place your factorio install within a directory named "factorio" and you update/install
+# with the official tarball you can safely ignore this option.
+PACKAGE_DIR_NAME=factorio
+
+#
+# narcotiq made a sweet update script for factorio and by cloning into this
+# you can simply run "factorio update" provided you configure the below arguments
+# To install the updater:
+#
+# git clone https://github.com/narc0tiq/factorio-updater
+#
+
+# absolute path to the factorio-updater script
+UPDATE_SCRIPT=/path/to/update_factorio.py
+# Note that if you set HEADLESS=1 the username/token will not be used as the headless
+# download is provided free of charge
+HEADLESS=1
+UPDATE_USERNAME=you
+UPDATE_TOKEN=yourtoken
+UPDATE_EXPERIMENTAL=0
+UPDATE_TMPDIR=/tmp
+
+# Extras
+# Additional binary arguments, these will be sent to the binary when issuing the "start" command
+EXTRA_BINARGS=""
diff --git a/factorio-init.service b/factorio-init.service
new file mode 100644
index 00000000000..c270d26664c
--- /dev/null
+++ b/factorio-init.service
@@ -0,0 +1,22 @@
+[Unit]
+Description=Factorio Server Init Script
+After=network.target
+
+[Service]
+User=factorio
+Group=games
+
+# We will store a pid file in your ${WRITE_DIR}/server.pid
+# Adjust if you change the write dir of your server
+PIDFile=/var/lib/factorio/.factorio/server.pid
+
+Type=forking
+TimeoutStartSec=20
+ExecStart=/usr/bin/factorio-init start
+TimeoutStopSec=20
+ExecStop=/usr/bin/factorio-init stop
+RestartSec=20
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target