# Description: a daemon for managing Internet connections within embedded device
# URL: https://01.org/connman
# Maintainer: Wawrzek Niewodniczanski, main at wawrzek dot name
# Depends on: dbus gnutls wpa_supplicant libmnl

name=connman
version=2.0
release=1
source=(https://www.kernel.org/pub/linux/network/connman/$name-$version.tar.gz
    connmand)

build()
{
    cd $name-$version
    ./configure \
      --prefix=/usr \
      --enable-iwd
    make
    make install DESTDIR=$PKG
    # update dbus roles
    mkdir -p $PKG/etc/dbus-1/system.d
    mv $PKG/usr/share/dbus-1/system.d/connman.conf $PKG/etc/dbus-1/system.d/

    mkdir -p $PKG/usr/var/run/$name
    # rc script
    install -D -m 0755 $SRC/connmand $PKG/etc/rc.d/connmand
}
