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

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

package() {
	install -Dm 644 "${pkgname%-git}-$commit/mcs@.service" "$pkgdir/usr/lib/systemd/system/mcs@.service"
	install -Dm 755 "${pkgname%-git}-$commit/mcsctl.sh" "$pkgdir/usr/bin/mcsctl"
	install -Dm 644 "${pkgname%-git}-$commit/mcs-update@.timer" "$pkgdir/usr/lib/systemd/system/mcs-update@.timer"
	install -Dm 644 "${pkgname%-git}-$commit/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' "${pkgname%-git}-$commit/mcsctl.sh" | head -n -1 | tail -n +2 > "${pkgname%-git}-$commit/mcsctl.conf.bak"
	install -Dm 644 "${pkgname%-git}-$commit/mcsctl.conf.bak" "$pkgdir/etc/mcsctl.conf.bak"
}