# Maintainer: Taner Tas <taner76@gmail.com>
pkgname=advancemame
pkgver=3.6
pkgrel=0
pkgdesc="A port of the MAME and MESS emulators for Arcade Monitors and TVs but also for LCDs and PC monitors"
url="http://www.advancemame.it"
arch="all"
license="GPL"
makedepends="sdl2-dev alsa-lib-dev freetype-dev zlib-dev expat-dev slang-dev"
subpackages="$pkgname-doc $pkgname-data"
source="https://github.com/amadvance/${pkgname}/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz"
options="!check"

prepare() {
	default_prepare
}

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--enable-sdl2
	make
}

package() {
	cd "$builddir"
	make bindir="${pkgdir}/usr/bin/" \
	datadir="${pkgdir}/usr/share/" \
	mandir="${pkgdir}/usr/share/man/" \
	pkgdocdir="${pkgdir}/usr/share/doc/${pkgname}/" \
	install
}

data() {
	pkgdesc="Distrubition files for advancemame"
	depends="$pkgname"
	mkdir -p "$subpkgdir"/usr/share/advance
	mv "$pkgdir"/usr/share/advance/* "$subpkgdir"/usr/share/advance/
}

sha512sums="4693d993c7cd6333fc1a484c83d280227005b5e2aa79c70f8d12373615bab161f41703686cf6c0088ed4f2224801bf88d1ea9bb7d6bf93c37c58e16cfa896687  advancemame-3.6.tar.gz"
