SUMMARY="Network-related giomodules for GLib"
DESCRIPTION="This package contains various network related extensions for the GIO library."
HOMEPAGE="https://www.gtk.org/"
COPYRIGHT="1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
	1991-2003 Free Software Foundation, Inc.
	1997-2006 University of Cambridge.
	1998-2001, 2003-2010 Red Hat, Inc.
	2007-2009 Nokia Corporation
	2008, 2010 Oracle and/or its affiliates, Inc. All rights
	2008-2010 Codethink Limited
	2008-2010 Collabora Ltd.
	1995-2010 Several others"
LICENSE="GNU LGPL v2"
REVISION="5"
SOURCE_URI="http://ftp.acc.umu.se/pub/gnome/sources/glib-networking/2.50/glib-networking-$portVersion.tar.xz"
CHECKSUM_SHA256="3f1a442f3c2a734946983532ce59ed49120319fdb10c938447c373d5e5286bee"
SOURCE_DIR="glib-networking-$portVersion"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	glib_networking$secondaryArchSuffix = $portVersion compat >= 2
	lib:libglib_networking_2.0$secondaryArchSuffix = $portVersion compat >= 2
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libffi$secondaryArchSuffix
	lib:libglib_2.0$secondaryArchSuffix
	lib:libgmp$secondaryArchSuffix
	lib:libgnutls$secondaryArchSuffix
	lib:libintl$secondaryArchSuffix
	lib:libxml2$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	ca_root_certificates
	devel:libglib_2.0$secondaryArchSuffix
	devel:libgmp$secondaryArchSuffix
	devel:libgnutls$secondaryArchSuffix >= 30
	devel:libnettle$secondaryArchSuffix
	devel:libtasn1$secondaryArchSuffix
	devel:libxml2$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:intltool_update
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	cmd:python
	"

BUILD()
{
	autoreconf -fi
	export CFLAGS=-D_BSD_SOURCE
	runConfigure ./configure --disable-maintainer-mode \
		--with-ca-certificates=/system/data/ssl/CARootCertificates.pem

	make $jobArgs
}

INSTALL()
{
	find -type f -name 'Makefile' -exec sed -i "s|^GIO_MODULE_DIR =.*|GIO_MODULE_DIR = $libDir/gio/modules|g" {} \;
	make install

	rm $libDir/gio/modules/libgiognutls.la
}
