# Compiling Time: 0.02 SBU
# Maintainer: Miklos Vajna <vmiklos@frugalware.org>

pkgname=unzip
pkgver=6.0
pkgrel=4
pkgdesc="Info-ZIP's unzip utility"
url="http://www.info-zip.org/UnZip.html"
depends=('glibc>=2.22-7')
groups=('apps' 'chroot-core')
archs=('i686' 'x86_64' 'arm')
up2date="lynx -dump $url |grep UnZip|sed -n 's/.*p \(.*\) \[.*/\1/;1 p'"
source=(ftp://ftp.info-zip.org/pub/infozip/src/unzip${pkgver/./}.tgz)
sha1sums=('abf7de8a4018a983590ed6f5cbd990d4740f8a22')

# FSA fix ***
source=(${source[@]} CVE-2014-8139.patch CVE-2014-8140.patch CVE-2014-8141.patch)
sha1sums=(${sha1sums[@]} '72a5b18ec3606fbbc602869a1251ee164eb913c5' \
                         '2cad2f21abcd15696c6d85f8520feaeade647a44' \
                         '56d6ae6789a8d7a106dfefcdc325b583233604d6')
# ***********

build()
{
	Fcd unzip${pkgver/./}
	[[ $CARCH == "i686" ]] && _TARGET_="linux_asm"
	[[ $CARCH == "x86_64" ]] && _TARGET_="linux_noasm"
	[[ $CARCH == "arm" ]] && _TARGET_="linux_noasm"

	Fpatchall
	make -f unix/Makefile LOCAL_UNZIP="$CFLAGS" prefix=$Fprefix $_TARGET_ || Fdie
	Fmakeinstall -f unix/Makefile
}

# optimization OK
