blob: c73f24be2db5b6acee1a41de9dd165fac8aa2042 (
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# Maintainer: Cranky Supertoon <crankysupertoon@gmail.com>
pkgname="modsman"
pkgver="0.32.1"
pkgrel=2
commithash="6add8e25be26080164cd4f84ce5338b8d98e4e4e"
shorthash="g6add8e2"
arch=('x86_64')
pkgdesc="Minecraft mod manager and updater for the CLI"
url='https://github.com/sargunv/modsman'
license=('GPL3')
makedepends=('gendesk' 'unzip' 'git')
depends=('java-runtime=8')
conflicts=('modsman-git' 'modsman-bin')
source=("${pkgname}::git+${url}.git")
md5sums=('SKIP')
prepare() {
#Rebase project to proper commit
#because the project cannot be built dirty
cd "${srcdir}/${pkgname}"
git reset --hard ${commithash}
# Create Startup Script
cat > "${pkgname}" <<-EOT
#!/bin/sh
cd /opt/modsman/bin
./modsman-cli
EOT
}
build() {
cd "${srcdir}/${pkgname}"
./gradlew :${pkgname}-cli:distZip --info --stacktrace
}
package() {
# Unzip Compiled project
cd "${srcdir}/${pkgname}/${pkgname}-cli/build/distributions"
unzip -o ${pkgname}-cli-${pkgver}-${pkgrel}-${shorthash}.dirty.zip
rm -rf "${pkgname}/"
cp -r "${pkgname}-cli-${pkgver}-${pkgrel}-${shorthash}.dirty/" "${pkgname}/"
rm -f "modsman/bin/${pkgname}-cli.bat"
# install the main files.
install -d -m755 "${pkgdir}/opt/${pkgname}"
cp -Rr "${srcdir}/${pkgname}/modsman-cli/build/distributions/modsman" "${pkgdir}/opt/"
# fix file permissions - all files as 644 - directories as 755
find "${pkgdir}/"opt -type d -exec chmod 755 {} \;
find "${pkgdir}/"opt -type f -exec chmod 644 {} \;
# link the binary
install -d -m755 "${pkgdir}/usr/bin"
cp -Rr "${srcdir}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
# make sure the main binary has the right permissions
chmod +x "${pkgdir}/usr/bin/${pkgname}"
chmod +x "${pkgdir}/opt/${pkgname}/bin/${pkgname}-cli"
}
|