# Template file for 'mozjpeg'
pkgname=mozjpeg
version=3.3.1
revision=1
#wrksrc=
#create_wrksrc=yes
#archs="i686 x86_64"
#build_style=gnu-configure
#configure_args=""
#make_build_args=""
#make_install_args=""
#conf_files=""
#make_dirs="/var/log/dir 0755 root root"
hostmakedepends="gcc autoconf gettext automake libtool pkg-config nasm"
makedepends=""
depends="glibc"
short_desc="Improved JPEG encoder from Mozilla"
maintainer="reback00 <reback00@protonmail.com>"
license="custom:libjpeg-turbo, BSD-3-Clause-Clear, Zlib"
homepage="https://github.com/mozilla/mozjpeg"
distfiles="https://github.com/mozilla/mozjpeg/archive/v${version}.tar.gz"
checksum=aebbea60ea038a84a2d1ed3de38fdbca34027e2e54ee2b7d08a97578be72599d
conflicts="libjpeg-turbo"

do_build() {
	autoreconf -fiv
	./configure --prefix=/usr --with-jpeg8 --mandir=/usr/share/man
	make
}

do_install() {
	make \
		DESTDIR="${DESTDIR}" \
		docdir="/usr/share/doc/${pkgname}" \
		exampledir="/usr/share/doc/${pkgname}" \
		install

	#install -D LICENSE.md "${DESTDIR}/usr/share/licenses/${pkgname}/LICENSE"
	vlicense LICENSE.md
	install -m644 jpegint.h "${DESTDIR}/usr/include"
}
