# Maintainer: Alexey Pavlov <alexpux@gmail.com>
# Contributor: Ray Donnelly <mingw.android@gmail.com>

pkgname=make
pkgver=4.1
pkgrel=4
pkgdesc="GNU make utility to maintain groups of programs"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/make"
license=('GPL3')
groups=('base-devel')
depends=('msys2-runtime' 'libintl' 'sh')
makedepends=('gettext' 'gettext-devel' 'git' 'wget' 'msys2-runtime-devel')
install=${pkgname}.install
options=() # 'debug' '!strip')
source=("http://ftp.gnu.org/gnu/make/${pkgname}-${pkgver}.tar.bz2"
        'make-autoconf.patch')
md5sums=('57a7a224a822f94789a587ccbcedff69'
         '9c941890b550a7cc2b5728e76a6641ce')

prepare() {
  cd ${srcdir}/${pkgname}-${pkgver}
  patch -p1 -i ${srcdir}/make-autoconf.patch
  autoreconf -fi
}

build() {
  cd ${srcdir}/${pkgname}-${pkgver}
  ./configure \
    --build=${CHOST} \
    --prefix=/usr \
    --without-libintl-prefix \
    --without-libiconv-prefix \
    --without-guile \
    ac_cv_dos_paths=yes

  make -j1 all
}

check() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make check
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
}
