wpa_supplicant: switch to systemd, drop openrc support.

This commit is contained in:
Juan RP 2011-10-11 04:13:37 +02:00
parent f6d93bbe35
commit a8498e55f5
3 changed files with 17 additions and 77 deletions

View file

@ -1,71 +0,0 @@
#!/sbin/runscript
# Copyright (c) 2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
command=/usr/sbin/wpa_supplicant
: ${wpa_supplicant_conf:=/etc/wpa_supplicant.conf}
: ${wpa_supplicant_log:=/var/log/wpa_supplicant.log}
wpa_supplicant_if=${wpa_supplicant_if:+-i}$wpa_supplicant_if
command_args="$wpa_supplicant_args -f $wpa_supplicant_log -B -c$wpa_supplicant_conf $wpa_supplicant_if"
name="WPA Supplicant Daemon"
depend()
{
need localmount
use logger
after bootmisc modules
before dns dhcpcd net
keyword -shutdown
}
find_wireless()
{
local iface=
case "$RC_UNAME" in
Linux)
for iface in /sys/class/net/*; do
if [ -e "$iface"/wireless -o \
-e "$iface"/phy80211 ]
then
echo "${iface##*/}"
return 0
fi
done
;;
*)
for iface in /dev/net/* $(ifconfig -l 2>/dev/null); do
if ifconfig "${iface##*/}" 2>/dev/null | \
grep -q "[ ]*ssid "
then
echo "${iface##*/}"
return 0
fi
done
;;
esac
return 1
}
append_wireless()
{
local iface= i=
iface=$(find_wireless)
if [ -n "$iface" ]; then
for i in $iface; do
command_args="$command_args -i$i"
done
else
eerror "Could not find a wireless interface"
fi
}
start_pre()
{
case " $command_args" in
*" -i"*) ;;
*) append_wireless;;
esac
}

View file

@ -0,0 +1,12 @@
[Unit]
Description=Wi-Fi Security Service
After=syslog.target
[Service]
Type=dbus
BusName=fi.epitest.hostap.WPASupplicant
ExecStart=/usr/sbin/wpa_supplicant -c /etc/wpa_supplicant.conf -u
StandardOutput=syslog
[Install]
WantedBy=multi-user.target

View file

@ -1,7 +1,7 @@
# Template file for 'wpa_supplicant'
pkgname=wpa_supplicant
version=0.7.3
revision=2
revision=3
wrksrc=${pkgname}-${version}/${pkgname}
distfiles="http://hostap.epitest.fi/releases/$pkgname-$version.tar.gz"
build_style=custom-install
@ -22,13 +22,14 @@ long_desc="
(wpa_cli) and a GUI (wpa_gui) are included with $pkgname."
conf_files="/etc/${pkgname}.conf"
openrc_services="$pkgname default false"
systemd_services="${pkgname}.service"
Add_dependency run glibc
Add_dependency run libnl
Add_dependency run libssl
Add_dependency run dbus-libs
Add_dependency run readline
Add_dependency build libnl-devel
Add_dependency build openssl-devel
Add_dependency build dbus-devel
@ -45,10 +46,8 @@ do_install()
{
make PREFIX=/usr DESTDIR=${DESTDIR} install
install -d ${DESTDIR}/etc/init.d
install -m755 ${FILESDIR}/${pkgname}.rc \
${DESTDIR}/etc/init.d/${pkgname}
install -m644 wpa_supplicant.conf ${DESTDIR}/etc
vinstall ${FILESDIR}/${pkgname}.service 644 lib/systemd/system
vinstall wpa_supplicant.conf 644 etc
for d in 5 8; do
install -d ${DESTDIR}/usr/share/man/man${d}
done