backports/iwd: new aport

This commit is contained in:
Antoine Martin 2023-04-23 16:14:27 -04:00 committed by Antoine Martin
parent 23e99c945a
commit 53538b7bac
7 changed files with 226 additions and 0 deletions

86
backports/iwd/APKBUILD Normal file
View file

@ -0,0 +1,86 @@
# Contributor: Milan P. Stanić <mps@arvanta.net>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=iwd
pkgver=2.4
pkgrel=0
pkgdesc="Internet Wireless Daemon"
url="https://iwd.wiki.kernel.org/"
arch="all"
license="LGPL-2.1-or-later"
depends="dbus"
makedepends="dbus-dev readline-dev linux-headers"
options="!check" # some builders fail on some test
checkdepends="coreutils"
subpackages="
$pkgname-dbg
$pkgname-doc
$pkgname-openrc
ead
ead-openrc:ead_openrc:noarch
"
source="https://mirrors.edge.kernel.org/pub/linux/network/wireless/iwd-$pkgver.tar.gz
iwd.initd
iwd.confd
ead.initd
ead.confd
main.conf
"
build() {
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--localstatedir=/var \
--disable-systemd-service \
--enable-wired \
--enable-tools
make
}
check() {
make check
}
package() {
make DESTDIR="$pkgdir" install
install -m750 -d "$pkgdir"/var/lib/$pkgname
install -m644 -D "$srcdir"/main.conf "$pkgdir"/etc/$pkgname/main.conf
install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
}
ead() {
pkgdesc="Ethernet authentication daemon"
amove usr/libexec/ead
install -m750 -d "$subpkgdir"/etc/ead
# ead expects configs in /var/lib/ead, but these are really configs,
# not dynamically generated, so they should be in /etc.
mkdir -p "$subpkgdir"/var/lib
ln -s /etc/ead "$subpkgdir"/var/lib/ead
}
ead_openrc() {
pkgdesc="Ethernet authentication daemon (OpenRC init scripts)"
depends=""
install_if="openrc ead=$pkgver-r$pkgrel"
install -m755 -D "$srcdir"/ead.initd "$subpkgdir"/etc/init.d/ead
install -m644 -D "$srcdir"/ead.confd "$subpkgdir"/etc/conf.d/ead
}
sha512sums="
00e97c9dff8dc86247b1e39e7586f3512f0ae4d2c882267dbabaa1a9b974672287d83d78fbf99b51f1787450d82d69e11eb98e007d3f7c13e66c251a8ebd3754 iwd-2.4.tar.gz
48fb5b5f0b4566a530bf971bcf7ec56ad155340b7d7b73d4e362a73d0395f516c1cd4f13cdf08af8b8b4d4972cbb7ef9b0594a74af474dc1ac949967e116f6fb iwd.initd
c53bfe1b18f0e965d6055e79b40d9f01d13648a4ae6124d2bcb0c6a77dc16f96980df0127c67cecd2a0319a6052f980400bb063d00c87ec016ccb350e3fe797e iwd.confd
8207a411d400bc7932829c959251a3246d1c33d342afa7070023dc90403e58b19518b2c84fe36495075a44724e2deab38970a2cc1f83bfff5abf3dff54b8ea3f ead.initd
4611df202e07178556d61f5642ea82f56cafaee9bf122240d8de8b4937b6bd3458ee7c2d209211523febab942dee184e94c899a1fd4456f8357347030c943c49 ead.confd
09f4097e653cfecfa1e4bc7b4843832785d0a8ef2a8ecf7daa3d5be704d9ac311fbbecf9f9f5b8b1c75beff894e4cf0d8fda4d6ff728a638dedf77aff0197179 main.conf
"

18
backports/iwd/ead.confd Normal file
View file

@ -0,0 +1,18 @@
# Configuration for /etc/init.d/ead
# A comma-separated list of patterns specifying the network interfaces that
# ead is allowed to manage. Defaults to any ethernet interfaces.
#allowed_interfaces=
# A comma-separated list of patterns specifying the network interfaces that
# ead should ignore.
#ignored_interfaces=
# Extra options for ead(8).
#command_args=
# Log messages are redirected to syslog. Set to empty string to disable.
#error_logger="logger -t ead -p daemon.info >/dev/null 2>&1"
# Uncomment to use process supervisor.
# supervisor="supervise-daemon"

20
backports/iwd/ead.initd Normal file
View file

@ -0,0 +1,20 @@
#!/sbin/openrc-run
description="Ethernet authentication daemon"
: ${error_logger="logger -t ead -p daemon.info >/dev/null 2>&1"}
command="/usr/libexec/ead"
command_background="yes"
command_args="
${allowed_interfaces:+"--interfaces \"$allowed_interfaces\""}
${ignored_interfaces:+"--nointerfaces \"$ignored_interfaces\""}
${command_args:-}
"
pidfile="/run/$RC_SVCNAME.pid"
depend() {
need dbus
before net
keyword -shutdown
}

24
backports/iwd/iwd.confd Normal file
View file

@ -0,0 +1,24 @@
# Configuration for /etc/init.d/iwd
# A comma-separated list of patterns specifying the network interfaces that
# iwd is allowed to manage. Defaults to any wireless interfaces.
#allowed_interfaces=
# A comma-separated list of patterns specifying the network interfaces that
# iwd should ignore.
#ignored_interfaces=
# Extra options for iwd(8).
#command_args=
# Log messages are redirected to syslog. Set to empty string to disable.
#error_logger="logger -t iwd -p daemon.info >/dev/null 2>&1"
# Number of milliseconds to wait after starting and check that daemon is
# still running. Set to empty string to disable.
# NOTE: If you use iwd together with ConnMan and ConnMan crashes when started
# right after iwd, increase this period to e.g. 200 ms.
#start_wait=50
# Uncomment to use process supervisor.
# supervisor="supervise-daemon"

25
backports/iwd/iwd.initd Normal file
View file

@ -0,0 +1,25 @@
#!/sbin/openrc-run
description="iNet wireless daemon"
: ${error_logger="logger -t iwd -p daemon.info >/dev/null 2>&1"}
: ${start_wait=50} # milliseconds
command="/usr/libexec/iwd"
command_background="yes"
command_args="
${allowed_interfaces:+"--interfaces \"$allowed_interfaces\""}
${ignored_interfaces:+"--nointerfaces \"$ignored_interfaces\""}
${command_args:-}
"
start_stop_daemon_args="
${start_wait:+--wait $start_wait}
${start_stop_daemon_args:-}
"
pidfile="/run/$RC_SVCNAME.pid"
depend() {
need dbus
before net
keyword -shutdown
}

View file

@ -0,0 +1,17 @@
#!/bin/sh
ver_old=$2
if [ "$(apk version -t "$ver_old" "1.15-r1")" = '<' ]; then
cat >&2 <<-EOF
*
* ead (Ethernet authentication daemon) has been moved from "iwd" into a
* separate package "ead". If you use it: apk add ead.
*
EOF
fi
if [ -f /etc/iwd/main.conf ]; then
sed -i -e s/enable_network_config=True/EnableNetworkConfiguration=True/ /etc/iwd/main.conf
sed -i -e s/resolve_method=resolvconf/NameResolvingService=resolvconf/ /etc/iwd/main.conf
fi

36
backports/iwd/main.conf Normal file
View file

@ -0,0 +1,36 @@
# Note: The lines starting with # are ignored. To enable any of the
# configuration options below, remove # from the beginning of a respective line.
# this file is not distributed upstream as of iwd 1.0 version
# It is created as transitional config from latest version
# Please read iwd.config(5), iwd.network(5), iwctl(1), iwmon(1) before setting
# these parameters below
# main.conf format is changed with iwd 1.3 release
#[EAP]
#mtu=1400
#[EAPoL]
#max_4way_handshake_time=5
#[General]
#EnableNetworkConfiguration=True
#ControlPortOverNL80211=True
#RoamThreshold=-70
#[Network]
#NameResolvingService=resolvconf
#[Scan]
# DisablePeriodicScan=false
# DisableRoamingScan=false
#[Blacklist]
#[Rank]
# BandModifier5Ghz=1.0