From 2ea6a2d561be28351c6c371bdc12e3a903e5cfe0 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sat, 2 Aug 2025 20:28:51 +0300 Subject: [PATCH] Initial commit --- .gitignore | 2 ++ check-version.sh | 15 ++++++++++ pkg.info | 9 ++++++ source-files/config | 29 ++++++++++++++++++ source-files/wpa_supplicant.conf | 10 +++++++ source-files/wpa_supplicant.esv | 7 +++++ source-files/wpa_supplicant.sh | 3 ++ source.sh | 50 ++++++++++++++++++++++++++++++++ 8 files changed, 125 insertions(+) create mode 100644 .gitignore create mode 100644 check-version.sh create mode 100644 pkg.info create mode 100644 source-files/config create mode 100644 source-files/wpa_supplicant.conf create mode 100644 source-files/wpa_supplicant.esv create mode 100644 source-files/wpa_supplicant.sh create mode 100644 source.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e58e5f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Exclude bpm archives +*.bpm \ No newline at end of file diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..d2b1a1c --- /dev/null +++ b/check-version.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Git repository +REPO="git://w1.fi/hostap.git" + +# Get tag name using 'git ls-remote' +TAG_NAME=$(git ls-remote --exit-code --refs --tags --sort='v:refname' "$REPO" | tail -1 | cut -d'/' -f3) + +# Trim 'hostap_' prefix from TAG_NAME variable +VERSION=$(echo "$TAG_NAME" | sed 's/hostap_//g') + +# Replace underscores with dots in VERSION variable +VERSION=$(echo "$VERSION" | tr '_' '.') + +echo "$VERSION" diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..9e26bf8 --- /dev/null +++ b/pkg.info @@ -0,0 +1,9 @@ +name: wpa_supplicant +description: A utility providing key negotiation for WPA wireless networks +version: 2.11 +url: https://w1.fi/wpa_supplicant/ +license: BSD-3-Clause +architecture: any +depends: ["glibc","dbus","libnl","openssl","readline"] +keep: ["etc/wpa_supplicant/wpa_supplicant.conf"] +type: source diff --git a/source-files/config b/source-files/config new file mode 100644 index 0000000..10dcf6b --- /dev/null +++ b/source-files/config @@ -0,0 +1,29 @@ +CONFIG_BACKEND=file +CONFIG_CTRL_IFACE=y +CONFIG_DEBUG_FILE=y +CONFIG_DEBUG_SYSLOG=y +CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON +CONFIG_DRIVER_NL80211=y +CONFIG_DRIVER_WEXT=y +CONFIG_DRIVER_WIRED=y +CONFIG_EAP_GTC=y +CONFIG_EAP_LEAP=y +CONFIG_EAP_MD5=y +CONFIG_EAP_MSCHAPV2=y +CONFIG_EAP_OTP=y +CONFIG_EAP_PEAP=y +CONFIG_EAP_TLS=y +CONFIG_EAP_TTLS=y +CONFIG_IEEE8021X_EAPOL=y +CONFIG_IPV6=y +CONFIG_LIBNL32=y +CONFIG_PEERKEY=y +CONFIG_PKCS12=y +CONFIG_READLINE=y +CONFIG_SMARTCARD=y +CONFIG_WPS=y +CONFIG_CTRL_IFACE_DBUS=y +CONFIG_CTRL_IFACE_DBUS_NEW=y +CONFIG_CTRL_IFACE_DBUS_INTRO=y + +CFLAGS += -I/usr/include/libnl3 diff --git a/source-files/wpa_supplicant.conf b/source-files/wpa_supplicant.conf new file mode 100644 index 0000000..6a93305 --- /dev/null +++ b/source-files/wpa_supplicant.conf @@ -0,0 +1,10 @@ +# Default configuration file for wpa_supplicant.conf(5). + +ctrl_interface=/run/wpa_supplicant +ctrl_interface_group=wheel +eapol_version=1 +ap_scan=1 +fast_reauth=1 +update_config=1 + +# Add your networks here. diff --git a/source-files/wpa_supplicant.esv b/source-files/wpa_supplicant.esv new file mode 100644 index 0000000..5688750 --- /dev/null +++ b/source-files/wpa_supplicant.esv @@ -0,0 +1,7 @@ +name: wpa_supplicant +description: WPA supplicant daemon +dependencies: ["udevd"] +type: background +start_cmd: /etc/esvm/scripts/wpa_supplicant.sh +exit_method: kill +restart: true diff --git a/source-files/wpa_supplicant.sh b/source-files/wpa_supplicant.sh new file mode 100644 index 0000000..3d4396a --- /dev/null +++ b/source-files/wpa_supplicant.sh @@ -0,0 +1,3 @@ +WPA_INTERFACE="wlan0" + +exec /usr/sbin/wpa_supplicant -i ${WPA_INTERFACE} -c /etc/wpa_supplicant/wpa_supplicant.conf diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..de580ea --- /dev/null +++ b/source.sh @@ -0,0 +1,50 @@ +# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +DOWNLOAD="https://w1.fi/releases/wpa_supplicant-${BPM_PKG_VERSION}.tar.gz" +FILENAME="${DOWNLOAD##*/}" + +# The prepare function is executed in the root of the temp directory +# This function is used for downloading files and putting them into the correct location +prepare() { + wget "$DOWNLOAD" + tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + cd wpa_supplicant + + # Move build configuration file + mv "$BPM_WORKDIR"/config .config + + make BINDIR=/usr/sbin LIBDIR=/usr/lib +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + cd wpa_supplicant + + install -Dm755 wpa_{cli,passphrase,supplicant} -t "$BPM_OUTPUT"/usr/sbin/ + + # Install man pages + install -Dm644 doc/docbook/wpa_supplicant.conf.5 "$BPM_OUTPUT"/usr/share/man/man5/wpa_supplicant.conf.5 + install -Dm644 doc/docbook/wpa_{cli,passphrase,supplicant}.8 -t "$BPM_OUTPUT"/usr/share/man/man8/ + + # Install dbus configuration files + install -Dm644 dbus/fi.w1.wpa_supplicant1.service "$BPM_OUTPUT"/usr/share/dbus-1/system-services/fi.w1.wpa_supplicant1.service + install -Dm644 dbus/dbus-wpa_supplicant.conf "$BPM_OUTPUT"/etc/dbus-1/system.d/wpa_supplicant.conf + + # Install configuration file + install -Dm644 "$BPM_WORKDIR"/wpa_supplicant.conf "$BPM_OUTPUT"/etc/wpa_supplicant/wpa_supplicant.conf + + # Install service files + install -Dm644 "$BPM_WORKDIR"/wpa_supplicant.esv "$BPM_OUTPUT"/etc/esvm/services/wpa_supplicant.esv + install -Dm755 "$BPM_WORKDIR"/wpa_supplicant.sh "$BPM_OUTPUT"/etc/esvm/scripts/wpa_supplicant.sh + + # Install package license + install -Dm644 "$BPM_SOURCE"/README "$BPM_OUTPUT"/usr/share/licenses/wpa_supplicant/LICENSE +}