# Description: Wireless daemon for Linux
# URL: https://iwd.wiki.kernel.org/
# Maintainer: Juergen Daubert, jue at crux dot nu
# Depends on: readline dbus

name=iwd
version=2.17
release=1
source=(https://www.kernel.org/pub/linux/network/wireless/$name-$version.tar.xz
	iwd)

build() {
	cd $name-$version

	sed '/DEFAULT_SYSTEM_BUS_ADDRESS/s|/var/run|/run|' -i ell/dbus.c

	./configure \
		--prefix=/usr \
		--libexecdir=/usr/sbin \
		--localstatedir=/var \
		--runstatedir=/run \
		--sysconfdir=/etc \
		--disable-systemd-service

	make
	make DESTDIR=$PKG install

	install -d -m 0700 $PKG/var/lib/iwd
	install -d -m 0700 $PKG/etc/iwd

	# rc script
	install -D -m 0755 $SRC/iwd $PKG/etc/rc.d/iwd
}
