repo/extra/wpa_supplicant/build
2022-03-26 14:25:00 +05:30

38 lines
928 B
Bash
Executable File

#!/bin/sh -e
# The wpa_supplicant package is built statically using
# libnl-tiny which is a minimal version of libnl maintained
# by OpenWRT.
mv libnl-tiny* libnl.tar.gz
tar xf libnl.tar.gz
mv libnl-tiny* libnl
export CFLAGS="$CFLAGS -D_GNU_SOURCE -I$PWD/libnl/include"
export LDFLAGS="-L$PWD/libnl"
(
cd libnl
# CFLAGS must expand to individual arguments.
# shellcheck disable=2086
$CC $CFLAGS $CPPFLAGS -c ./*.c
ar rc libnl-tiny.a ./*.o
)
cd wpa_supplicant
make LIBDIR=/usr/lib BINDIR=/usr/bin
make LIBDIR=/usr/lib BINDIR=/usr/bin install
mkdir -p \
"$1/usr/share/man/man5" \
"$1/usr/share/man/man8"
cp -f doc/docbook/*.5 "$1/usr/share/man/man5"
cp -f doc/docbook/*.8 "$1/usr/share/man/man8"
# Install runit service.
mkdir -p "$1/etc/sv/wpa_supplicant"
cp -f wpa_supplicant.run "$1/etc/sv/wpa_supplicant/run"
ln -sf /run/runit/supervise.wpa_supplicant "$1/etc/sv/wpa_supplicant/supervise"