summaryrefslogtreecommitdiff
path: root/source/n/wpa_supplicant
diff options
context:
space:
mode:
Diffstat (limited to 'source/n/wpa_supplicant')
-rw-r--r--source/n/wpa_supplicant/config/dot.config (renamed from source/n/wpa_supplicant/wpa_supplicant.defconfig)53
-rw-r--r--source/n/wpa_supplicant/config/wpa_gui.desktop7
-rw-r--r--source/n/wpa_supplicant/config/wpa_gui.png (renamed from source/n/wpa_supplicant/wpa_gui.png)bin5124 -> 5124 bytes
-rw-r--r--source/n/wpa_supplicant/config/wpa_supplicant.conf2
-rw-r--r--source/n/wpa_supplicant/config/wpa_supplicant.logrotate6
-rw-r--r--source/n/wpa_supplicant/doinst.sh15
-rw-r--r--source/n/wpa_supplicant/fi.epitest.hostap.WPASupplicant.service4
-rw-r--r--source/n/wpa_supplicant/hostap-07.git-b80b5639935d37b95d00f86b57f2844a9c775f57.patch61
-rw-r--r--source/n/wpa_supplicant/patches/dbus-service-file-args.diff20
-rw-r--r--source/n/wpa_supplicant/patches/include-unistd_h.diff15
-rw-r--r--source/n/wpa_supplicant/patches/libnl3-includes.diff12
-rw-r--r--source/n/wpa_supplicant/patches/quiet-scan-results-message.diff12
-rw-r--r--source/n/wpa_supplicant/patches/squelch-driver-disconnect-spam.diff95
-rwxr-xr-xsource/n/wpa_supplicant/wpa_supplicant.SlackBuild213
14 files changed, 273 insertions, 242 deletions
diff --git a/source/n/wpa_supplicant/wpa_supplicant.defconfig b/source/n/wpa_supplicant/config/dot.config
index 2c530fdc..f4d7306b 100644
--- a/source/n/wpa_supplicant/wpa_supplicant.defconfig
+++ b/source/n/wpa_supplicant/config/dot.config
@@ -1,27 +1,42 @@
-CONFIG_DRIVER_HOSTAP=y
-CONFIG_DRIVER_NDISWRAPPER=y
-CONFIG_DRIVER_ATMEL=y
-CONFIG_DRIVER_IPW=y
-CONFIG_DRIVER_RALINK=y
-CONFIG_DRIVER_WEXT=y
+CONFIG_BACKEND=file
+CONFIG_BGSCAN_SIMPLE=y
+CONFIG_CTRL_IFACE=y
+CONFIG_CTRL_IFACE_DBUS=y
+CONFIG_CTRL_IFACE_DBUS_INTRO=y
+CONFIG_CTRL_IFACE_DBUS_NEW=y
+CONFIG_DEBUG_FILE=y
CONFIG_DRIVER_NL80211=y
+CONFIG_DRIVER_WEXT=y
CONFIG_DRIVER_WIRED=y
-CONFIG_IEEE8021X_EAPOL=y
+CONFIG_EAP_AKA=y
+CONFIG_EAP_FAST=y
+CONFIG_EAP_GPSK=y
+CONFIG_EAP_GPSK_SHA256=y
+CONFIG_EAP_GTC=y
+CONFIG_EAP_IKEV2=y
+CONFIG_EAP_LEAP=y
CONFIG_EAP_MD5=y
CONFIG_EAP_MSCHAPV2=y
-CONFIG_EAP_TLS=y
+CONFIG_EAP_OTP=y
+CONFIG_EAP_PAX=y
CONFIG_EAP_PEAP=y
+CONFIG_EAP_SAKE=y
+CONFIG_EAP_TLS=y
+CONFIG_EAP_TNC=y
CONFIG_EAP_TTLS=y
-CONFIG_EAP_GTC=y
-CONFIG_EAP_OTP=y
-CONFIG_EAP_LEAP=y
-CONFIG_WPS=y
+CONFIG_IEEE8021X_EAPOL=y
+CONFIG_LIBNL32=y
+CONFIG_PEERKEY=y
CONFIG_PKCS12=y
-CONFIG_SMARTCARD=y
-CONFIG_CTRL_IFACE=y
CONFIG_READLINE=y
-CONFIG_BACKEND=file
-CONFIG_PEERKEY=y
-CONFIG_CTRL_IFACE_DBUS=y
-CONFIG_CTRL_IFACE_DBUS_NEW=y
-CONFIG_CTRL_IFACE_DBUS_INTRO=y
+CONFIG_SMARTCARD=y
+CONFIG_WPS=y
+
+# These five are not defined by Fedora
+# Do we still need them?
+#CONFIG_DRIVER_ATMEL=y
+#CONFIG_DRIVER_HOSTAP=y
+#CONFIG_DRIVER_IPW=y
+#CONFIG_DRIVER_NDISWRAPPER=y
+#CONFIG_DRIVER_RALINK=y
+
diff --git a/source/n/wpa_supplicant/config/wpa_gui.desktop b/source/n/wpa_supplicant/config/wpa_gui.desktop
new file mode 100644
index 00000000..31b8b6b0
--- /dev/null
+++ b/source/n/wpa_supplicant/config/wpa_gui.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Name=wpa_gui
+Comment[en]=Wpa_supplicant management
+Exec=kdesu wpa_gui
+Icon=wpa_gui
+Type=Application
+Categories=Qt;Network;
diff --git a/source/n/wpa_supplicant/wpa_gui.png b/source/n/wpa_supplicant/config/wpa_gui.png
index a72f3569..a72f3569 100644
--- a/source/n/wpa_supplicant/wpa_gui.png
+++ b/source/n/wpa_supplicant/config/wpa_gui.png
Binary files differ
diff --git a/source/n/wpa_supplicant/config/wpa_supplicant.conf b/source/n/wpa_supplicant/config/wpa_supplicant.conf
new file mode 100644
index 00000000..4dbbf96a
--- /dev/null
+++ b/source/n/wpa_supplicant/config/wpa_supplicant.conf
@@ -0,0 +1,2 @@
+ctrl_interface=/var/run/wpa_supplicant
+ctrl_interface_group=root
diff --git a/source/n/wpa_supplicant/config/wpa_supplicant.logrotate b/source/n/wpa_supplicant/config/wpa_supplicant.logrotate
new file mode 100644
index 00000000..bd7ef91c
--- /dev/null
+++ b/source/n/wpa_supplicant/config/wpa_supplicant.logrotate
@@ -0,0 +1,6 @@
+/var/log/wpa_supplicant.log {
+ missingok
+ notifempty
+ size 30k
+ create 0600 root root
+}
diff --git a/source/n/wpa_supplicant/doinst.sh b/source/n/wpa_supplicant/doinst.sh
new file mode 100644
index 00000000..6052fca4
--- /dev/null
+++ b/source/n/wpa_supplicant/doinst.sh
@@ -0,0 +1,15 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+config etc/wpa_supplicant.conf.new
+config etc/logrotate.d/wpa_supplicant.new
diff --git a/source/n/wpa_supplicant/fi.epitest.hostap.WPASupplicant.service b/source/n/wpa_supplicant/fi.epitest.hostap.WPASupplicant.service
deleted file mode 100644
index e8b4250b..00000000
--- a/source/n/wpa_supplicant/fi.epitest.hostap.WPASupplicant.service
+++ /dev/null
@@ -1,4 +0,0 @@
-[D-BUS Service]
-Name=fi.epitest.hostap.WPASupplicant
-Exec=/usr/sbin/wpa_supplicant -u
-User=root
diff --git a/source/n/wpa_supplicant/hostap-07.git-b80b5639935d37b95d00f86b57f2844a9c775f57.patch b/source/n/wpa_supplicant/hostap-07.git-b80b5639935d37b95d00f86b57f2844a9c775f57.patch
deleted file mode 100644
index 4c500200..00000000
--- a/source/n/wpa_supplicant/hostap-07.git-b80b5639935d37b95d00f86b57f2844a9c775f57.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From b80b5639935d37b95d00f86b57f2844a9c775f57 Mon Sep 17 00:00:00 2001
-From: Dan Williams <dcbw@redhat.com>
-Date: Fri, 17 Dec 2010 15:56:01 +0200
-Subject: [PATCH] dbus: Emit property changed events when adding/removing BSSes
-
-The supplicant was not emitting property changed events when the BSSs
-property changed.
-
-Signed-off-by: Dan Williams <dcbw@redhat.com>
-(cherry picked from commit 1e6288df6b07a353a9246b77e0de2a840b5f2c72)
----
- wpa_supplicant/dbus/dbus_new.c | 6 ++++++
- wpa_supplicant/dbus/dbus_new.h | 1 +
- 2 files changed, 7 insertions(+), 0 deletions(-)
-
-diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
-index bdfbbac..c66640a 100644
---- a/wpa_supplicant/dbus/dbus_new.c
-+++ b/wpa_supplicant/dbus/dbus_new.c
-@@ -691,6 +691,10 @@ void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
- wpas_dbus_getter_current_network;
- prop = "CurrentNetwork";
- break;
-+ case WPAS_DBUS_PROP_BSSS:
-+ getter = (WPADBusPropertyAccessor) wpas_dbus_getter_bsss;
-+ prop = "BSSs";
-+ break;
- default:
- wpa_printf(MSG_ERROR, "dbus: %s: Unknown Property value %d",
- __func__, property);
-@@ -1199,6 +1203,7 @@ int wpas_dbus_unregister_bss(struct wpa_supplicant *wpa_s,
- }
-
- wpas_dbus_signal_bss_removed(wpa_s, bss_obj_path);
-+ wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_BSSS);
-
- return 0;
- }
-@@ -1263,6 +1268,7 @@ int wpas_dbus_register_bss(struct wpa_supplicant *wpa_s,
- }
-
- wpas_dbus_signal_bss_added(wpa_s, bss_obj_path);
-+ wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_BSSS);
-
- return 0;
-
-diff --git a/wpa_supplicant/dbus/dbus_new.h b/wpa_supplicant/dbus/dbus_new.h
-index 80ea98c..9cdefcb 100644
---- a/wpa_supplicant/dbus/dbus_new.h
-+++ b/wpa_supplicant/dbus/dbus_new.h
-@@ -30,6 +30,7 @@ enum wpas_dbus_prop {
- WPAS_DBUS_PROP_STATE,
- WPAS_DBUS_PROP_CURRENT_BSS,
- WPAS_DBUS_PROP_CURRENT_NETWORK,
-+ WPAS_DBUS_PROP_BSSS,
- };
-
- enum wpas_dbus_bss_prop {
---
-1.7.4-rc1
-
diff --git a/source/n/wpa_supplicant/patches/dbus-service-file-args.diff b/source/n/wpa_supplicant/patches/dbus-service-file-args.diff
new file mode 100644
index 00000000..7e2449f2
--- /dev/null
+++ b/source/n/wpa_supplicant/patches/dbus-service-file-args.diff
@@ -0,0 +1,20 @@
+diff -Nur wpa_supplicant-1.0-rc3.orig/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in wpa_supplicant-1.0-rc3/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in
+--- wpa_supplicant-1.0-rc3.orig/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in 2012-04-16 15:15:40.000000000 -0500
++++ wpa_supplicant-1.0-rc3/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in 2012-05-06 01:07:44.523999837 -0500
+@@ -1,5 +1,5 @@
+ [D-BUS Service]
+ Name=fi.epitest.hostap.WPASupplicant
+-Exec=@BINDIR@/wpa_supplicant -u
++Exec=@BINDIR@/wpa_supplicant -B -u -f /var/log/wpa_supplicant.log -P /var/run/wpa_supplicant.pid
+ User=root
+ SystemdService=wpa_supplicant.service
+diff -Nur wpa_supplicant-1.0-rc3.orig/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in wpa_supplicant-1.0-rc3/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in
+--- wpa_supplicant-1.0-rc3.orig/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in 2012-04-16 15:15:40.000000000 -0500
++++ wpa_supplicant-1.0-rc3/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in 2012-05-06 01:06:59.528589953 -0500
+@@ -1,5 +1,5 @@
+ [D-BUS Service]
+ Name=fi.w1.wpa_supplicant1
+-Exec=@BINDIR@/wpa_supplicant -u
++Exec=@BINDIR@/wpa_supplicant -B -u -f /var/log/wpa_supplicant.log -P /var/run/wpa_supplicant.pid
+ User=root
+ SystemdService=wpa_supplicant.service
diff --git a/source/n/wpa_supplicant/patches/include-unistd_h.diff b/source/n/wpa_supplicant/patches/include-unistd_h.diff
new file mode 100644
index 00000000..a3c6ae83
--- /dev/null
+++ b/source/n/wpa_supplicant/patches/include-unistd_h.diff
@@ -0,0 +1,15 @@
+diff -Nur wpa_supplicant-1.0-rc3.orig/wpa_supplicant/wpa_gui-qt4/wpagui.cpp wpa_supplicant-1.0-rc3/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
+--- wpa_supplicant-1.0-rc3.orig/wpa_supplicant/wpa_gui-qt4/wpagui.cpp 2012-04-16 15:15:40.000000000 -0500
++++ wpa_supplicant-1.0-rc3/wpa_supplicant/wpa_gui-qt4/wpagui.cpp 2012-05-05 17:04:40.706570034 -0500
+@@ -12,10 +12,8 @@
+ * See README and COPYING for more details.
+ */
+
+-#ifdef __MINGW32__
+-/* Need to get getopt() */
++/* Need to get getopt() regardless with gcc-4.7.x */
+ #include <unistd.h>
+-#endif
+
+ #ifdef CONFIG_NATIVE_WINDOWS
+ #include <windows.h>
diff --git a/source/n/wpa_supplicant/patches/libnl3-includes.diff b/source/n/wpa_supplicant/patches/libnl3-includes.diff
new file mode 100644
index 00000000..f8ff01c1
--- /dev/null
+++ b/source/n/wpa_supplicant/patches/libnl3-includes.diff
@@ -0,0 +1,12 @@
+diff -Nur wpa_supplicant-1.0-rc3.orig/src/drivers/drivers.mak wpa_supplicant-1.0-rc3/src/drivers/drivers.mak
+--- wpa_supplicant-1.0-rc3.orig/src/drivers/drivers.mak 2012-04-16 15:15:40.000000000 -0500
++++ wpa_supplicant-1.0-rc3/src/drivers/drivers.mak 2012-05-05 17:16:01.933597117 -0500
+@@ -48,7 +48,7 @@
+ ifdef CONFIG_LIBNL32
+ DRV_LIBS += -lnl-3
+ DRV_LIBS += -lnl-genl-3
+- DRV_CFLAGS += -DCONFIG_LIBNL20
++ DRV_CFLAGS += -DCONFIG_LIBNL20 `pkg-config --cflags libnl-3.0`
+ else
+ ifdef CONFIG_LIBNL_TINY
+ DRV_LIBS += -lnl-tiny
diff --git a/source/n/wpa_supplicant/patches/quiet-scan-results-message.diff b/source/n/wpa_supplicant/patches/quiet-scan-results-message.diff
new file mode 100644
index 00000000..2b3eb672
--- /dev/null
+++ b/source/n/wpa_supplicant/patches/quiet-scan-results-message.diff
@@ -0,0 +1,12 @@
+diff -Nur wpa_supplicant-1.0-rc3.orig/wpa_supplicant/events.c wpa_supplicant-1.0-rc3/wpa_supplicant/events.c
+--- wpa_supplicant-1.0-rc3.orig/wpa_supplicant/events.c 2012-04-16 15:15:40.000000000 -0500
++++ wpa_supplicant-1.0-rc3/wpa_supplicant/events.c 2012-05-05 17:02:38.061179720 -0500
+@@ -1076,7 +1076,7 @@
+ }
+
+ wpa_dbg(wpa_s, MSG_DEBUG, "New scan results available");
+- wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS);
++ wpa_msg_ctrl(wpa_s, MSG_DEBUG, WPA_EVENT_SCAN_RESULTS);
+ wpas_notify_scan_results(wpa_s);
+
+ wpas_notify_scan_done(wpa_s, 1);
diff --git a/source/n/wpa_supplicant/patches/squelch-driver-disconnect-spam.diff b/source/n/wpa_supplicant/patches/squelch-driver-disconnect-spam.diff
new file mode 100644
index 00000000..b8d2be6a
--- /dev/null
+++ b/source/n/wpa_supplicant/patches/squelch-driver-disconnect-spam.diff
@@ -0,0 +1,95 @@
+diff -Nur wpa_supplicant-1.0-rc3.orig/wpa_supplicant/events.c wpa_supplicant-1.0-rc3/wpa_supplicant/events.c
+--- wpa_supplicant-1.0-rc3.orig/wpa_supplicant/events.c 2012-04-16 15:15:40.000000000 -0500
++++ wpa_supplicant-1.0-rc3/wpa_supplicant/events.c 2012-05-06 01:01:17.529134316 -0500
+@@ -1593,6 +1593,15 @@
+ wpa_s->keys_cleared = 0;
+ wpa_clear_keys(wpa_s, wpa_s->bssid);
+ }
++
++ if (wpa_s->wpa_state == WPA_DISCONNECTED) {
++ wpa_s->disconnect_count++;
++ if (!eloop_is_timeout_registered(wpa_disconnect_spam_handle, wpa_s, NULL)) {
++ eloop_register_timeout(6, 0, wpa_disconnect_spam_handle, wpa_s, NULL);
++ wpa_printf(MSG_DEBUG, "%s: scheduled DISCONNECT spam handler", __FUNCTION__);
++ }
++ }
++
+ wpa_supplicant_mark_disassoc(wpa_s);
+
+ if (authenticating && (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME))
+diff -Nur wpa_supplicant-1.0-rc3.orig/wpa_supplicant/wpa_supplicant.c wpa_supplicant-1.0-rc3/wpa_supplicant/wpa_supplicant.c
+--- wpa_supplicant-1.0-rc3.orig/wpa_supplicant/wpa_supplicant.c 2012-04-16 15:15:40.000000000 -0500
++++ wpa_supplicant-1.0-rc3/wpa_supplicant/wpa_supplicant.c 2012-05-06 01:01:17.530134303 -0500
+@@ -434,6 +434,9 @@
+
+ wpa_supplicant_cancel_scan(wpa_s);
+ wpa_supplicant_cancel_auth_timeout(wpa_s);
++ if (eloop_is_timeout_registered(wpa_disconnect_spam_handle, wpa_s, NULL))
++ eloop_cancel_timeout(wpa_disconnect_spam_handle, wpa_s, NULL);
++
+ eloop_cancel_timeout(wpa_supplicant_stop_countermeasures, wpa_s, NULL);
+ #ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
+ eloop_cancel_timeout(wpa_supplicant_delayed_mic_error_report,
+@@ -592,6 +595,23 @@
+ #endif /* CONFIG_BGSCAN */
+
+
++void wpa_disconnect_spam_handle(void *eloop_ctx, void *timeout_ctx)
++{
++ struct wpa_supplicant *wpa_s = eloop_ctx;
++ const u8 bssid[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
++
++ wpa_printf(MSG_DEBUG, "%s: %d disconnect events in 6 seconds",
++ __FUNCTION__, wpa_s->disconnect_count);
++
++ if (wpa_s->disconnect_count >= 3) {
++ wpa_printf(MSG_DEBUG, "%s: forcing SSID/BSSID reset", __FUNCTION__);
++ wpa_drv_disassociate(wpa_s, bssid, WLAN_REASON_DEAUTH_LEAVING);
++ wpa_supplicant_req_scan(wpa_s, 1, 0);
++ }
++ wpa_s->disconnect_count = 0;
++}
++
++
+ /**
+ * wpa_supplicant_set_state - Set current connection state
+ * @wpa_s: Pointer to wpa_supplicant data
+@@ -612,6 +632,18 @@
+ if (state != WPA_SCANNING)
+ wpa_supplicant_notify_scanning(wpa_s, 0);
+
++ if (state != WPA_DISCONNECTED && state != WPA_SCANNING) {
++ /* If the state isn't disconnected, cancel any registered
++ * disconnect spam handler, which should only live while
++ * disconnect events are coming in quickly.
++ */
++ wpa_s->disconnect_count = 0;
++ if (eloop_is_timeout_registered(wpa_disconnect_spam_handle, wpa_s, NULL)) {
++ wpa_printf(MSG_DEBUG, "%s: canceling DISCONNECT spam handler", __FUNCTION__);
++ eloop_cancel_timeout(wpa_disconnect_spam_handle, wpa_s, NULL);
++ }
++ }
++
+ if (state == WPA_COMPLETED && wpa_s->new_connection) {
+ #if defined(CONFIG_CTRL_IFACE) || !defined(CONFIG_NO_STDOUT_DEBUG)
+ struct wpa_ssid *ssid = wpa_s->current_ssid;
+diff -Nur wpa_supplicant-1.0-rc3.orig/wpa_supplicant/wpa_supplicant_i.h wpa_supplicant-1.0-rc3/wpa_supplicant/wpa_supplicant_i.h
+--- wpa_supplicant-1.0-rc3.orig/wpa_supplicant/wpa_supplicant_i.h 2012-04-16 15:15:40.000000000 -0500
++++ wpa_supplicant-1.0-rc3/wpa_supplicant/wpa_supplicant_i.h 2012-05-06 01:01:17.530134303 -0500
+@@ -355,6 +355,8 @@
+ struct wps_er *wps_er;
+ int blacklist_cleared;
+
++ int disconnect_count;
++
+ struct wpabuf *pending_eapol_rx;
+ struct os_time pending_eapol_rx_time;
+ u8 pending_eapol_rx_src[ETH_ALEN];
+@@ -535,6 +537,7 @@
+ int sec, int usec);
+ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
+ enum wpa_states state);
++void wpa_disconnect_spam_handle(void *eloop_ctx, void *timeout_ctx);
+ struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s);
+ const char * wpa_supplicant_get_eap_mode(struct wpa_supplicant *wpa_s);
+ void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s);
diff --git a/source/n/wpa_supplicant/wpa_supplicant.SlackBuild b/source/n/wpa_supplicant/wpa_supplicant.SlackBuild
index 8bbf01db..32165fa9 100755
--- a/source/n/wpa_supplicant/wpa_supplicant.SlackBuild
+++ b/source/n/wpa_supplicant/wpa_supplicant.SlackBuild
@@ -22,8 +22,10 @@
# -----------------------------------------------------------------------------
PKGNAM=wpa_supplicant
-VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-3}
+VERSION=1.0
+BUILD=${BUILD:-1}
+
+SRCVERSION=$(printf $VERSION | tr _ -)
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -37,8 +39,6 @@ fi
NUMJOBS=${NUMJOBS:-" -j7 "}
-DOCS="ChangeLog ../COPYING README README-WPS *.txt examples wpa_supplicant.conf.sample"
-
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
@@ -59,31 +59,16 @@ else
LIBDIRSUFFIX=""
fi
-# Support for some of the wireless drivers needs the header files of those
-# drivers.
-# Change these *_INCLUDES variables to where _your_ driver include directory
-# is located. If any of these directories is found, support for the driver
-# will be added to wpa_supplicant.
-# My madwifi package for Slackware installs the headers here:
-MADWIFI_INCLUDES="/usr/include/madwifi"
-HERMES_INCLUDES=""
-BROADCOM_INCLUDES=""
-
CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM
+
rm -rf $PKG
mkdir -p $TMP $PKG
-
-if ! [ -f $CWD/${PKGNAM}.defconfig ]; then
- echo "Could not find ${PKGNAM}.defconfig!"
- exit 1
-fi
-
cd $TMP
-rm -rf ${PKGNAM}-${VERSION}
-tar xvf $CWD/${PKGNAM}-${VERSION}.tar.?z* || exit 1
-cd ${PKGNAM}-${VERSION}
+rm -rf ${PKGNAM}-${SRCVERSION}
+tar xvf $CWD/${PKGNAM}-${SRCVERSION}.tar.?z* || exit 1
+cd ${PKGNAM}-${SRCVERSION}
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -91,179 +76,91 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-#sed -i -e \
-# "s/^#define VERSION_STR \"\(.*\)\"/#define VERSION_STR \"\1_$VERSION\"/" \
-# src/common/version.h
+# Fixup various paths in the dbus service file
+patch -p1 < $CWD/patches/dbus-service-file-args.diff
+
+# Include unistd.h
+patch -p1 < $CWD/patches/include-unistd_h.diff
-zcat $CWD/hostap-07.git-b80b5639935d37b95d00f86b57f2844a9c775f57.patch.gz | patch -p1 --verbose || exit 1
+# Add libnl3 includes
+patch -p1 < $CWD/patches/libnl3-includes.diff
+
+# Eliminate some logspam
+patch -p1 < $CWD/patches/quiet-scan-results-message.diff
+patch -p1 < $CWD/patches/squelch-driver-disconnect-spam.diff
-# The source code has been re-organized:
cd wpa_supplicant
# Create the configuration file for building wpa_supplicant:
-cat $CWD/${PKGNAM}.defconfig > .config
-if [ ! -z $MADWIFI_INCLUDES -a -d $MADWIFI_INCLUDES ]; then
- echo "Adding madwifi driver (Atheros) support"
- cat <<-EOT >> .config
- CONFIG_DRIVER_MADWIFI=y
- CFLAGS += -I${MADWIFI_INCLUDES}
- EOT
-fi
-if [ ! -z $HERMES_INCLUDES -a -d $HERMES_INCLUDES ]; then
- echo "Adding hermes driver (Agere) support"
- cat <<-EOT >> .config
- CONFIG_DRIVER_HERMES=y
- CFLAGS += -I${HERMES_INCLUDES}
- EOT
-fi
-if [ ! -z $BROADCOM_INCLUDES -a -d $BROADCOM_INCLUDES ]; then
- echo "Adding broadcom driver support"
- cat <<-EOT >> .config
- CONFIG_DRIVER_BROADCOM=y
- CFLAGS += -I${BROADCOM_INCLUDES}
- EOT
-fi
-make $NUMJOBS || make || exit 1
+cat $CWD/config/dot.config > .config
-# Build the Qt4 GUI client
-make wpa_gui-qt4 || exit 1
+# Build the usual binaries
+CFLAGS="$SLKCFLAGS" \
+make $NUMJOBS \
+ BINDIR=/usr/sbin \
+ LIBDIR=/usr/lib${LIBDIRSUFFIX} || exit 1
-# Make man pages if needed
-( cd doc/docbook
- if ! ls *.? >/dev/null 2>&1 ; then
- make man
- fi
-)
+# Build the Qt4 GUI client
+CFLAGS="$SLKCFLAGS" \
+make $NUMJOBS \
+ wpa_gui-qt4 \
+ BINDIR=/usr/sbin \
+ LIBDIR=/usr/lib${LIBDIRSUFFIX} || exit 1
-# Do not build the developer docs:
-#PATH=".:$PATH" make docs
+# Make sure man pages are built
+make -C doc/docbook man
# This goes into the doc directory later on:
-cp wpa_supplicant.conf wpa_supplicant.conf.sample
+mv wpa_supplicant.conf wpa_supplicant.conf.sample
# Install binaries:
mkdir -p $PKG/usr/sbin $PKG/usr/bin
cp wpa_supplicant wpa_passphrase wpa_cli $PKG/usr/sbin/
cp wpa_gui-qt4/wpa_gui $PKG/usr/bin/
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+
# Install dbus configuration file:
mkdir -p $PKG/etc/dbus-1/system.d/
cp dbus/dbus-wpa_supplicant.conf \
$PKG/etc/dbus-1/system.d/dbus-wpa_supplicant.conf
-# This file should actually be shipped with Slackware's wpa_supplicant
-# package, but since we missed it there (just kidding), we'll do it here:
mkdir -p $PKG/usr/share/dbus-1/system-services
-install -m644 dbus/{fi.epitest.hostap.WPASupplicant.service,fi.w1.wpa_supplicant1.service} \
- $PKG/usr/share/dbus-1/system-services/
-sed -e 's#Exec=/sbin/wpa_supplicant#Exec=/usr/sbin/wpa_supplicant#g' \
- -i $PKG/usr/share/dbus-1/system-services/*.service
+install -m644 dbus/*.service $PKG/usr/share/dbus-1/system-services/
-# Install a .desktop file for wpa_gui:
-mkdir -p $PKG/usr/share/applications
-cat <<EOT > $PKG/usr/share/applications/wpa_gui.desktop
-[Desktop Entry]
-Name=wpa_gui
-Comment[en]=Wpa_supplicant management
-Exec=kdesu wpa_gui
-Icon=wpa_gui
-Type=Application
-Categories=Qt;Network;
-EOT
+# Install a .desktop file and icon for wpa_gui:
+# (converted from the wpa_gui.svg in the source)
+mkdir -p $PKG/usr/share/{applications,pixmaps}
+cat $CWD/config/wpa_gui.desktop > $PKG/usr/share/applications/wpa_gui.desktop
+cat $CWD/config/wpa_gui.png > $PKG/usr/share/pixmaps/wpa_gui.png
-# The icon used for the menu (converted from the wpa_gui.svg in the source)
-mkdir -p $PKG/usr/share/pixmaps
-cp -a $CWD/wpa_gui.png $PKG/usr/share/pixmaps/
+# Install a logrotate config
+mkdir -p $PKG/etc/logrotate.d
+cat $CWD/config/wpa_supplicant.logrotate > $PKG/etc/logrotate.d/wpa_supplicant.new
# Install man pages:
for m in 5 8; do
mkdir -p $PKG/usr/man/man${m}
cp doc/docbook/*.${m} $PKG/usr/man/man${m}/
done
+find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
-# Install a default configuration file:
+# Install a default configuration file (only readable by root):
mkdir -p $PKG/etc
-cat <<-_EOT_ > $PKG/etc/wpa_supplicant.conf.new
- # See /usr/doc/${PKGNAM}-${VERSION}/wpa_supplicant.conf.sample
- # for many more options that you can use in this file.
-
- # This line enables the use of wpa_cli which is used by rc.wireless
- # if possible (to check for successful association)
- ctrl_interface=/var/run/wpa_supplicant
- # By default, only root (group 0) may use wpa_cli
- ctrl_interface_group=0
- eapol_version=1
- ap_scan=1
- fast_reauth=1
- #country=US
-
- # WPA protected network, supply your own ESSID and WPAPSK here:
- network={
- scan_ssid=0
- ssid="your_essid_here"
- proto=WPA RSN
- key_mgmt=WPA-PSK
- pairwise=CCMP TKIP
- group=CCMP TKIP WEP104 WEP40
- psk=your_64_char_psk_here
- priority=10
- }
-
- # Plaintext connection (no WPA, no IEEE 802.1X),
- # nice for hotel/airport types of WiFi network.
- network={
- key_mgmt=NONE
- priority=0
- }
- _EOT_
-
-# Create the 'doinst.sh' script:
-mkdir -p $PKG/install 2>/dev/null
-cat <<EOINS > $PKG/install/doinst.sh
-# Handle the incoming configuration files:
-config() {
- for infile in \$1; do
- NEW="\$infile"
- OLD="\`dirname \$NEW\`/\`basename \$NEW .new\`"
- # If there's no config file by that name, mv it over:
- if [ ! -r \$OLD ]; then
- mv \$NEW \$OLD
- elif [ "\`cat \$OLD | md5sum\`" = "\`cat \$NEW | md5sum\`" ]; then
- # toss the redundant copy
- rm \$NEW
- fi
- # Otherwise, we leave the .new copy for the admin to consider...
- done
-}
-config etc/wpa_supplicant.conf.new
-
-EOINS
+cat $CWD/config/wpa_supplicant.conf > $PKG/etc/wpa_supplicant.conf.new
+chmod 600 $PKG/etc/wpa_supplicant.conf.new
-# Add the documentation:
mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
-cp -a $DOCS $PKG/usr/doc/$PKGNAM-$VERSION
-cp -a $CWD/README.slackware $PKG/usr/doc/${PKGNAM}-${VERSION}/
-chmod -R a-w $PKG/usr/doc/$PKGNAM-$VERSION/*
+cp -a \
+ ChangeLog ../COPYING README README-{P2P,WPS} examples *.txt *.sample $CWD/README.slackware \
+ $PKG/usr/doc/$PKGNAM-$VERSION
chown -R root:root $PKG/usr/doc/$PKGNAM-$VERSION/*
+chmod -R a-w $PKG/usr/doc/$PKGNAM-$VERSION/*
-# This should only be read/write by root:
-chmod 600 $PKG/etc/wpa_supplicant.conf.new
-
-# Compress the man page(s):
-find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
-
-# Strip binaries:
-find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
- | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-
-# Add a package description:
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
-if [ -f $CWD/doinst.sh ]; then
- cat $CWD/doinst.sh >> $PKG/install/doinst.sh
-fi
+zcat $CWD/doinst.sh.gz >> $PKG/install/doinst.sh
-# Build the package:
cd $PKG
/sbin/makepkg -l y -c n $TMP/${PKGNAM}-${VERSION}-${ARCH}-${BUILD}.txz
-