# Maintainer: Darshit Shah <darnir@gmail.com>

_gitname=wget2
pkgname=${_gitname}-git
pkgver=1.99.2.r1.gfc34771c
pkgrel=1
pkgdesc="Updated version of popular Wget tool"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/wget/wget.html"
license=('GPL3')
depends=('libutil-linux' 'gnutls' 'libidn2' 'libpsl' 'gpgme' 'nghttp2' 'lzip')
checkdepends=('libmicrohttpd')
optdepends=("ca-certificates: HTTPS Downloads")
makedepends=('git' 'rsync' 'gperf' 'python' 'wget')
provides=('wget2')
conflicts=('wget2')
source=("git+https://gitlab.com/gnuwget/wget2.git"
        "git://git.savannah.gnu.org/gnulib.git")
md5sums=('SKIP' 'SKIP')

build() {
  cd $_gitname
  git submodule init
  git config submodule.gnulib.url "$srcdir/gnulib"
  git submodule update gnulib
  ./bootstrap
  ./configure --prefix=/usr --sysconfdir=/etc
  make
}

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

pkgver() {
  cd $_gitname
  #Use the tag from the last commit.
  # git describe --always --tags --long | sed 's/^v//; s/-/.r/; s/-/./g; s/wget2.//g'
  git describe --tags --long | cut -f6- | sed 's/wget2-//g; s/-/.r/; s/-/./g'
}

check() {
  cd $_gitname
  # make check
}

# vim:set ts=2 sw=2 tw=0 et:
