summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ba4a0066cb525dc15cad93e09d0364879634f821 (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
# Maintainer: Hetsh <aur@hetsh.de>

pkgname=mcsctl-git
pkgver=master
pkgrel=12
pkgdesc='Manage multiple minecraft servers with a simple bash script and systemd unit templates.'
arch=('any')
license=('GPL3')
depends=('bash' 'grep' 'java-runtime-headless>=8' 'openbsd-netcat' 'jq' 'screen' 'sudo' 'systemd')
provides=('mcsctl')
conflicts=('mcsctl')
install="$pkgname.install"
url='https://github.com/Hetsh/mcsctl'
commit=('dc3e9e1f8e52b1011187c28f2e5ca526af0dcbc4')
source=("$url/archive/$commit.tar.gz")
sha256sums=('d3cb46ec087af0c6f655f6d4422b4ee9598673148dfca85f9df4a5773efbd94d')

package() {
	work_dir="${pkgname%-git}-$commit"
	install -Dm 644 "$work_dir/mcs@.service" "$pkgdir/usr/lib/systemd/system/mcs@.service"
	install -Dm 755 "$work_dir/mcsctl.sh" "$pkgdir/usr/bin/mcsctl"
	install -Dm 644 "$work_dir/mcs-update@.timer" "$pkgdir/usr/lib/systemd/system/mcs-update@.timer"
	install -Dm 644 "$work_dir/mcs-update@.service" "$pkgdir/usr/lib/systemd/system/mcs-update@.service"

	# Generate an example config file from default options inside the mcsctl script
	sed -n '/\# Mutable config/,/\# \/Mutable config/p' "$work_dir/mcsctl.sh" | head -n -1 | tail -n +2 > "$work_dir/mcsctl.conf.bak"
	install -Dm 644 "$work_dir/mcsctl.conf.bak" "$pkgdir/etc/mcsctl.conf.bak"
}