# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=vorbis-tools
pkgver=1.4.2
pkgrel=3
pkgdesc="Extra tools for Ogg-Vorbis"
url="https://www.xiph.org/vorbis/"
arch="all"
license="GPL-2.0-only"
makedepends="curl-dev flac-dev libvorbis-dev libao-dev speex-dev"
subpackages="$pkgname-doc $pkgname-lang"
source="https://downloads.xiph.org/releases/vorbis/vorbis-tools-$pkgver.tar.gz
	CVE-2023-43361.patch"

# secfixes:
#   9.54-r1:
#     - CVE-2023-43361

prepare() {
 	default_prepare
	update_config_sub
	update_config_guess
}

build() {
	./configure \
		--prefix=/usr \
		--enable-vcut
	make
}

check() {
	make check
}

lang() {
	default_lang
	mkdir -p "$subpkgdir"/usr/share/$pkgname
	mv "$subpkgdir"/usr/share/locale "$subpkgdir"/usr/share/$pkgname
}

package() {
	make DESTDIR="$pkgdir" install
	rm "$pkgdir"/usr/lib/charset.alias
}

sha512sums="
31681560434054706981aef64406975295eb405a9d2d7c0468af789d6c23edb7cfc1c19d26a28fa7061835524289cdc6d217a4669c43a2eb828189370cc6fcaf  vorbis-tools-1.4.2.tar.gz
e5e5537991d9e3a294dc2f18ae2d01f0fb99b251c05de096675a290ec6c4e83d26c28b35ea79b3e8b128e3848ae1a438b40d2d4af6c22fa6801c2993d05497af  CVE-2023-43361.patch
"
