# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=font-bakoma
pkgver=1
pkgrel=1
pkgdesc="Computer Modern fonts"
url="https://ctan.org/tex-archive/fonts/cm/ps-type1/bakoma"
arch="noarch"
license="custom"
depends="$pkgname-ttf"
subpackages="$pkgname-doc $pkgname-otf $pkgname-ttf"
source="http://mirrors.ctan.org/fonts/cm/ps-type1/bakoma.zip"
builddir="$srcdir/bakoma"
options="!check"  # fonts don't have tests

_fontsdir="usr/share/fonts/bakoma"

package() {
	install -D -m 644 LICENCE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE

	mkdir -p "$pkgdir"/usr/share/doc/$pkgname
	cp BaKoMa-*.Fonts README.news "$pkgdir"/usr/share/doc/$pkgname/
}

otf() {
	pkgdesc="$pkgdesc in OpenType format"
	depends=fontconfig

	mkdir -p "$subpkgdir"/$_fontsdir
	cp "$builddir"/otf/* "$subpkgdir"/$_fontsdir/
}

ttf() {
	pkgdesc="$pkgdesc in TrueType format"
	depends=fontconfig

	mkdir -p "$subpkgdir"/$_fontsdir
	cp "$builddir"/ttf/* "$subpkgdir"/$_fontsdir/
}

sha512sums="dc38832f77d4d2daa275b046310f9b263b46a24c884402a113a3ef83ee7514c55a76b7cd299e811ace88c6f9c68ef5705b1846d42522304660d7fede348a3d6f  bakoma.zip"
