description="a small C library that is supposed to make it easy to run an HTTP server as part of another application."
url="http://www.gnu.org/software/libmicrohttpd/"

contributors="Fanch, Greg, tnut"
packager="spiky <spiky@nutyx.org>"

makedepends=(curl file gnutls libgcrypt)

name=libmicrohttpd
version=0.9.75

source=(ftp://ftp.gnu.org/gnu/libmicrohttpd/$name-$version.tar.gz)

build() {

  cd $name-$version
  ./configure --prefix=/usr --disable-dependency-tracking --enable-largefile \
	--enable-curl --enable-messages --with-pic --enable-https --disable-examples

  make
  make DESTDIR=$PKG install

  # Obsolet lib
  rm $PKG/usr/lib/libmicrohttpd.la
}
uptodate() {
local url ext
url="https://ftp.gnu.org/gnu/$name/"
ext=".tar.gz"
lynx -read_timeout=20 -dump -listonly -nonumbers \
$url?C=M\;O=A|grep $name-[0-9]|grep [0-9]$ext$| \
sed "s@$url$name-@@"|sed "s@$ext@@"|tail -1
}
