# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=libraw
pkgver=0.19.5
pkgrel=1
pkgdesc="Read RAW image files from digital cameras"
url="https://www.libraw.org/"
arch="all"
license="LGPL-2.1-only OR CDDL-1.0"
depends=""
makedepends="jasper-dev lcms2-dev libjpeg-turbo-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://www.libraw.org/data/LibRaw-$pkgver.tar.gz
	CVE-2020-15503.patch
	"
builddir="$srcdir/LibRaw-$pkgver"

# secfixes:
#   0.19.5-r1:
#     - CVE-2020-15503

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make check
}

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

sha512sums="4560045f75e6d2ab0d1d8686075f3a0e26a5d7ce693b48508110a2c31d19055d58983c24852da0abb64fa90db5e20f24b87aa7537ed04d958c38c8b265a7e826  LibRaw-0.19.5.tar.gz
49feadef114b219222c0ca143f45aaa1595b7c7a4a8f8472cd6f18449082d75b3fb4314e4beba549f8f69bc49d7790777129ff1f12ee8a110988fdf12f20caae  CVE-2020-15503.patch"