# Contributor: Sergei Lukin <sergej.lukin@gmail.com>
# Contributor: Carlo Landmeter
# Maintainer:  Natanael Copa <ncopa@alpinelinux.org>
pkgname=wavpack
pkgver=5.1.0
pkgrel=5
pkgdesc="Audio compression format with lossless, lossy, and hybrid compression modes"
url="http://www.wavpack.com/"
arch="all"
options="!check"  # No test suite.
license="BSD-3-Clause"
subpackages="$pkgname-dev $pkgname-doc"
source="http://www.wavpack.com/${pkgname}-${pkgver}.tar.bz2
	CVE-2018-6767.patch
	CVE-2018-7253.patch
	CVE-2018-7254.patch
	"

# secfixes:
#   5.1.0-r3:
#     - CVE-2018-6767
#     - CVE-2018-7253
#     - CVE-2018-7254
#   5.1.0-r0:
#     - CVE-2016-10169
#     - CVE-2016-10170
#     - CVE-2016-10171
#     - CVE-2016-10172

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--disable-static
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

sha512sums="4c31616ae63c3a875afa20f26ce935f7a8f9921e2892b4b8388eca3ccd83b2d686f43eed8b9ec1dead934a1148401b9dced3b05f509b7942c48d7af31cf80a54  wavpack-5.1.0.tar.bz2
9a4d0da20398c3500f2308abae921bda2149e46270e0424b83b06bf9a15ff16b5b89c000a7633a6b454f09f7e2ffd5a88de37cd7504f633108e50c0d954c883c  CVE-2018-6767.patch
6e8bdb2a1fa1445de7778226bf4db35efa96f6455be3f2c52bd56dc567eba8eeba9a0140965816c2dc340abcdcb966dc6fd647345e419fde3dceba2a512e5395  CVE-2018-7253.patch
8745e1d3b97df6bdc2844c6731c1079afce8aee6cd3ad39557c8442687f80d2e2b278fd5277e35f7793de3035a7923be69a248dd7ab2cae66d92ea43905dae60  CVE-2018-7254.patch"
