summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a4809bfdd24642c02cd77d5680d5605f725f2df3 (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
# Maintainer: griffin <19497824+WingofaGriffin@users.noreply.github.com>
_pkgname=itgmania
pkgname=itgmania-bin
pkgver=1.2.1
pkgrel=1
pkgdesc="A fork of stepmania 5.1, improved for the post-ITG community"
provides=('itgmania')
conflicts=('itgmania')
arch=('x86_64')
url="https://www.itgmania.com/"
license=('GPL')
depends=(gtk3 ffmpeg libusb-compat lua glu)
source=(
	"https://github.com/$_pkgname/$_pkgname/releases/download/v${pkgver}/ITGmania-${pkgver}-Linux.tar.gz"
	"itgmania.sh"
)
sha256sums=('de6e490270e20894af4e1c306a63161cdcd37ce43028e89eeef03a6d2867dc1e'
            '0249497c6eb7969362d8a93e1bb50c3259e5dc3873f8c94a40503d1321f03810')

package() {
	install -dm755 "${pkgdir}/opt/"
	cp -r "ITGmania-${pkgver}-Linux/$_pkgname" "${pkgdir}/opt/$_pkgname"
  	install -dm755 "${pkgdir}/usr/bin"
	install -D -m755 "$_pkgname.sh" "${pkgdir}/usr/bin/$_pkgname"
	install -D -m644 "ITGmania-${pkgver}-Linux/$_pkgname/$_pkgname.desktop" \
		"${pkgdir}/usr/share/applications/itgmania.desktop"

	# Install license
    install -Dm644 "ITGmania-${pkgver}-Linux/$_pkgname/Docs/Licenses.txt" "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

pkgver() {
	ITGMANIA_GITHUB_URL="https://api.github.com/repos/$_pkgname/$_pkgname/releases/latest"
  
  	itgManiaVer=$(curl --silent ${ITGMANIA_GITHUB_URL} | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's/v//')
  	if [ -z "$itgManiaVer" ]; then
    	itgManiaVer=$pkgver
  	fi
  	echo $itgManiaVer
}