aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorpi <pi@FreeBSD.org>2016-09-14 04:18:00 +0800
committerpi <pi@FreeBSD.org>2016-09-14 04:18:00 +0800
commitd61cb2fc9ec25ada5af2950ee381be1fb70e1b8d (patch)
tree1423a7fb19d95823c2e88e44636a6273b684cd98 /net
parent497cfa30c2ac15673a68d81e2e9b08f1b651a582 (diff)
downloadfreebsd-ports-graphics-d61cb2fc9ec25ada5af2950ee381be1fb70e1b8d.tar.gz
freebsd-ports-graphics-d61cb2fc9ec25ada5af2950ee381be1fb70e1b8d.tar.zst
freebsd-ports-graphics-d61cb2fc9ec25ada5af2950ee381be1fb70e1b8d.zip
net/wpa_gui: Several improvements
- Adds DEBUG option to simplify troubleshooting - Adds debug logging of wpa_supplicant control interface - Installs the manpage - Adds USE_QT4=corelib - Makes wpa_gui executable setuid to allow it to easily connect to wpa_supplicant control socket - Fixes the problem that wpa_gui sometimes picks up .pid file instead of the control interface PR: 211214 Submitted by: Yuri Victorovich <yuri@rawbw.com> Reviewed by: koobs
Diffstat (limited to 'net')
-rw-r--r--net/wpa_gui/Makefile27
-rw-r--r--net/wpa_gui/files/patch-wpa_ctrl.c23
-rw-r--r--net/wpa_gui/files/patch-wpagui.cpp12
-rw-r--r--net/wpa_gui/files/pkg-message.in13
4 files changed, 70 insertions, 5 deletions
diff --git a/net/wpa_gui/Makefile b/net/wpa_gui/Makefile
index 6e703af2bd1..3c7af1376dc 100644
--- a/net/wpa_gui/Makefile
+++ b/net/wpa_gui/Makefile
@@ -3,6 +3,7 @@
PORTNAME= wpa_gui
PORTVERSION= 2.5
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= http://w1.fi/releases/ \
http://partmedia.users.sourceforge.net/dist/:icons \
@@ -18,19 +19,33 @@ LICENSE= BSD3CLAUSE
WRKSRC_SUBDIR= wpa_supplicant/wpa_gui-qt4
-PLIST_FILES= sbin/wpa_gui \
+PLIST_FILES= "@mode 4555" \
+ sbin/wpa_gui \
+ "@mode" \
share/applications/wpa_gui.desktop \
share/icons/hicolor/16x16/apps/wpa_gui.png \
- share/icons/hicolor/scalable/apps/wpa_gui.svg
+ share/icons/hicolor/scalable/apps/wpa_gui.svgz \
+ man/man8/wpa_gui.8.gz
-USE_QT4= gui moc_build rcc_build uic_build
+SUB_FILES= pkg-message
+SUB_LIST= LOCALBASE=${LOCALBASE}
+
+USE_QT4= corelib gui moc_build rcc_build uic_build
USES= qmake
+INSTALLS_ICONS= yes
+
+OPTIONS_DEFINE= DEBUG
post-patch:
@${REINPLACE_CMD} -e \
'/^Exec/s|=.*|=${PREFIX}/sbin/wpa_gui|' \
${WRKSRC}/wpa_gui.desktop
+post-patch-DEBUG-on:
+ @${REINPLACE_CMD} -e \
+ 's| release| debug|' \
+ ${WRKSRC}/wpa_gui.pro
+
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/sbin
${INSTALL_DATA} ${WRKSRC}/wpa_gui.desktop ${STAGEDIR}${PREFIX}/share/applications
@@ -38,7 +53,9 @@ do-install:
${INSTALL_DATA} ${WRKDIR}/icons/hicolor/16x16/apps/wpa_gui.png \
${STAGEDIR}${PREFIX}/share/icons/hicolor/16x16/apps
${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps
- ${INSTALL_DATA} ${WRKSRC}/icons/wpa_gui.svg \
- ${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps
+ @${GZIP_CMD} < ${WRKSRC}/icons/wpa_gui.svg \
+ > ${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps/wpa_gui.svgz
+ @${GZIP_CMD} < ${WRKSRC}/../doc/docbook/wpa_gui.8 \
+ > ${STAGEDIR}${PREFIX}/man/man8/wpa_gui.8.gz
.include <bsd.port.mk>
diff --git a/net/wpa_gui/files/patch-wpa_ctrl.c b/net/wpa_gui/files/patch-wpa_ctrl.c
new file mode 100644
index 00000000000..023f81bb243
--- /dev/null
+++ b/net/wpa_gui/files/patch-wpa_ctrl.c
@@ -0,0 +1,23 @@
+--- ../../src/common/wpa_ctrl.c.orig 2016-07-18 19:31:51.725862000 -0700
++++ ../../src/common/wpa_ctrl.c
+@@ -477,6 +477,10 @@
+ char *cmd_buf = NULL;
+ size_t _cmd_len;
+
++#ifndef QT_NO_DEBUG
++ fprintf(stderr, "CMD-SEND: %*s\n", cmd_len, cmd);
++#endif // QT_NO_DEBUG
++
+ #ifdef CONFIG_CTRL_IFACE_UDP
+ if (ctrl->cookie) {
+ char *pos;
+@@ -554,6 +558,9 @@
+ continue;
+ }
+ *reply_len = res;
++#ifndef QT_NO_DEBUG
++ fprintf(stderr, "CMD-RECV: %*s\n", *reply_len, reply);
++#endif // QT_NO_DEBUG
+ break;
+ } else {
+ return -2;
diff --git a/net/wpa_gui/files/patch-wpagui.cpp b/net/wpa_gui/files/patch-wpagui.cpp
new file mode 100644
index 00000000000..1369a8bb16d
--- /dev/null
+++ b/net/wpa_gui/files/patch-wpagui.cpp
@@ -0,0 +1,12 @@
+--- wpagui.cpp.orig 2015-09-27 19:02:05 UTC
++++ wpagui.cpp
+@@ -302,7 +302,8 @@ int WpaGui::openCtrlConnection(const cha
+ #endif /* _DIRENT_HAVE_D_TYPE */
+
+ if (strcmp(dent->d_name, ".") == 0 ||
+- strcmp(dent->d_name, "..") == 0)
++ strcmp(dent->d_name, "..") == 0 ||
++ (strlen(dent->d_name) > strlen(".pid") && !strcmp(dent->d_name + strlen(dent->d_name) - strlen(".pid"), ".pid")))
+ continue;
+ debug("Selected interface '%s'",
+ dent->d_name);
diff --git a/net/wpa_gui/files/pkg-message.in b/net/wpa_gui/files/pkg-message.in
new file mode 100644
index 00000000000..0b2a2f3bb02
--- /dev/null
+++ b/net/wpa_gui/files/pkg-message.in
@@ -0,0 +1,13 @@
+======================================================================
+You installed wpa_gui: Qt frontend for wpa_supplicant.
+
+It expects the running wpa_supplicant from the port
+security/wpa_supplicant. In order to use wpa_gui you need:
+* to have the functioning wifi network interface
+* to install the wpa_supplicant port security/wpa_supplicant
+* to run the wpa_supplicant:
+ # sysrc wpa_supplicant_enable="YES"
+ # sysrc wpa_supplicant_program="%%PREFIX%%/sbin/wpa_supplicant"
+ and possibly
+ # service wpa_supplicant start wlan0
+======================================================================