move from unstable: wavemon

Moved to root packages because it requires SELinux to be in permissive mode.
This commit is contained in:
Leonid Plyushch 2019-11-10 18:38:42 +02:00 committed by Yaksh Bariya
parent de21da06d4
commit 20e53150e5
No known key found for this signature in database
GPG Key ID: F7486BA7D3D27581
6 changed files with 88 additions and 0 deletions

View File

@ -0,0 +1,15 @@
TERMUX_PKG_HOMEPAGE=https://github.com/uoaerg/wavemon
TERMUX_PKG_DESCRIPTION="Ncurses-based monitoring application for wireless network devices"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com>"
TERMUX_PKG_VERSION=0.9.0
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://github.com/uoaerg/wavemon/archive/v$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=5823ef9459d6147a457b390b6744a77465584e93d37c2809fa7a0be557070166
TERMUX_PKG_DEPENDS="libcap, libnl, ncurses"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_lib_pthread_pthread_create=yes"
termux_step_pre_configure() {
CPPFLAGS+=" -I$TERMUX_PREFIX/include/libnl3"
}

View File

@ -0,0 +1,12 @@
diff -uNr wavemon-0.9.0/configure wavemon-0.9.0.mod/configure
--- wavemon-0.9.0/configure 2018-12-30 03:08:25.000000000 +0200
+++ wavemon-0.9.0.mod/configure 2019-07-03 16:41:58.114071620 +0300
@@ -3986,7 +3986,7 @@
fi
# Testing library functions
-for ac_func in gettimeofday ether_ntohost
+for ac_func in gettimeofday
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"

View File

@ -0,0 +1,11 @@
diff -uNr wavemon-0.9.0/iw_nl80211.h wavemon-0.9.0.mod/iw_nl80211.h
--- wavemon-0.9.0/iw_nl80211.h 2018-12-30 03:08:25.000000000 +0200
+++ wavemon-0.9.0.mod/iw_nl80211.h 2019-07-03 16:49:23.890816614 +0300
@@ -5,6 +5,7 @@
#include <netlink/genl/genl.h>
#include <netlink/genl/ctrl.h>
+#include <net/ethernet.h>
#include <netinet/ether.h>
#include <stdbool.h>

View File

@ -0,0 +1,24 @@
diff -uNr wavemon-0.9.0/iw_scan.c wavemon-0.9.0.mod/iw_scan.c
--- wavemon-0.9.0/iw_scan.c 2018-12-30 03:08:25.000000000 +0200
+++ wavemon-0.9.0.mod/iw_scan.c 2019-07-03 19:33:39.729820897 +0300
@@ -368,6 +368,10 @@
sr->num.ch_stats = n < MAX_CH_STATS ? n : MAX_CH_STATS;
}
+void on_exit_hook() {
+ if_set_down_on_exit(0, conf_ifname());
+}
+
/** The actual scan thread. */
void *do_scan(void *sr_ptr)
{
@@ -430,8 +434,7 @@
if (if_set_up(conf_ifname()) < 0)
err_sys("Can not bring up interface '%s'", conf_ifname());
- if (on_exit(if_set_down_on_exit, (void *)conf_ifname()) < 0)
- snprintf(sr->msg, sizeof(sr->msg), "Warning: unable to restore %s down state on exit", conf_ifname());
+ atexit(on_exit_hook);
break;
}
/* fall through */

View File

@ -0,0 +1,12 @@
diff -uNr wavemon-0.9.0/scan_scr.c wavemon-0.9.0.mod/scan_scr.c
--- wavemon-0.9.0/scan_scr.c 2018-12-30 03:08:25.000000000 +0200
+++ wavemon-0.9.0.mod/scan_scr.c 2019-07-03 16:51:31.595109371 +0300
@@ -250,7 +250,7 @@
void scr_aplst_fini(void)
{
- pthread_cancel(scan_thread);
+ pthread_kill(scan_thread, 0);
free_scan_list(sr.head);
free(sr.channel_stats);

View File

@ -0,0 +1,14 @@
diff -uNr wavemon-0.9.0/utils.c wavemon-0.9.0.mod/utils.c
--- wavemon-0.9.0/utils.c 2018-12-30 03:08:25.000000000 +0200
+++ wavemon-0.9.0.mod/utils.c 2019-07-03 16:40:46.503509776 +0300
@@ -39,10 +39,6 @@
/* Print mac-address translation from /etc/ethers if available */
char *ether_lookup(const struct ether_addr *ea)
{
- static char hostname[BUFSIZ];
-
- if (ether_ntohost(hostname, ea) == 0)
- return hostname;
return ether_addr(ea);
}