# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libmicrohttpd
pkgver=0.9.57
pkgrel=0
pkgdesc="a small C library that is supposed to make it easy to run an HTTP server as part of another application."
url="https://www.gnu.org/software/libmicrohttpd/"
arch="all"
license="GPL"
makedepends="curl-dev libgcrypt-dev gnutls-dev"
options="!check"
subpackages="$pkgname-dev $pkgname-doc"
source="ftp://ftp.gnu.org/gnu/libmicrohttpd/$pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$pkgname-$pkgver

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--enable-largefile \
		--enable-curl \
		--enable-https \
		--enable-messages
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	install -Dm644 "$builddir"/src/include/platform.h \
		"$pkgdir"/usr/include/platform.h
}

sha512sums="996a59b1bc950320f21df095d3e24e1e6a6e4204095eb84e7dc5e5ed296b1dbe553459b227ba6cc93f60721f1975f778ece8c7c1c10e9168d030fba46675eed3  libmicrohttpd-0.9.57.tar.gz"
