SHA256
1
0
forked from pool/horst

Accepting request 649604 from home:elvigia:branches:network:utilities

- horst-ncurses6w.patch: Must call setlocale too. 

- horst-ncurses6w.patch: switch to ncurses6w. 
- Only modify __DATE__ and __TIME__ in sources if no 
  SOURCE_DATE_EPOCH is set in the environment.

OBS-URL: https://build.opensuse.org/request/show/649604
OBS-URL: https://build.opensuse.org/package/show/network:utilities/horst?expand=0&rev=7
This commit is contained in:
Martin Hauke 2018-11-18 18:52:34 +00:00 committed by Git OBS Bridge
parent 766ed9158e
commit 8c2d0ff4f1
3 changed files with 80 additions and 10 deletions

60
horst-ncurses6w.patch Normal file
View File

@ -0,0 +1,60 @@
Index: horst-5.1/Makefile
===================================================================
--- horst-5.1.orig/Makefile
+++ horst-5.1/Makefile
@@ -54,8 +54,8 @@ OBJS= \
radiotap/radiotap.o \
util.o \
wlan_util.o
-LIBS=-lncurses -lm
-CFLAGS+=-std=gnu99 -Wall -Wextra -g -I. -DVERSION=\"$(VERSION)\"
+LIBS= $(shell pkg-config --libs ncursesw) -lm
+CFLAGS+=-Wall -Wextra -fvisibility=hidden -g -I. -DVERSION=\"$(VERSION)\" $(shell pkg-config --cflags ncursesw) -D_GNU_SOURCE
ifeq ($(OSX),1)
PCAP=1
Index: horst-5.1/display.c
===================================================================
--- horst-5.1.orig/display.c
+++ horst-5.1/display.c
@@ -162,9 +162,7 @@ static void resize_display_all(void)
ioctl(0, TIOCGWINSZ, &winsz); /* ioctl on STDIN */
if (winsz.ws_col && winsz.ws_row)
resizeterm(winsz.ws_row, winsz.ws_col);
- COLS = winsz.ws_col;
- LINES = winsz.ws_row;
-
+/* resizeterm() updates COLS and LINES */
resize_display_main();
if (show_win)
@@ -432,7 +430,7 @@ void init_display(void)
curs_set(0); /* don't show cursor */
noecho();
nodelay(stdscr, TRUE);
- ESCDELAY = 25; /* we don't use ESC sequences */
+ set_escdelay(25); /* we don't use ESC sequences */
init_pair(1, COLOR_WHITE, COLOR_BLACK);
init_pair(2, COLOR_GREEN, COLOR_BLACK);
Index: horst-5.1/main.c
===================================================================
--- horst-5.1.orig/main.c
+++ horst-5.1/main.c
@@ -28,6 +28,7 @@
#include <err.h>
#include <sys/socket.h>
#include <net/if.h>
+#include <locale.h>
#include "main.h"
#include "util.h"
@@ -621,6 +622,8 @@ int main(int argc, char** argv)
struct sigaction sigint_action;
struct sigaction sigpipe_action;
+ setlocale(LC_ALL, "");
+
list_head_init(&essids.list);
list_head_init(&nodes);
init_spectrum();

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Fri Nov 16 14:43:09 UTC 2018 - Cristian Rodríguez <crrodriguez@opensuse.org>
- horst-ncurses6w.patch: Must call setlocale too.
-------------------------------------------------------------------
Fri Nov 16 13:28:49 UTC 2018 - Cristian Rodríguez <crrodriguez@opensuse.org>
- horst-ncurses6w.patch: switch to ncurses6w.
- Only modify __DATE__ and __TIME__ in sources if no
SOURCE_DATE_EPOCH is set in the environment.
-------------------------------------------------------------------
Mon Apr 2 21:07:44 UTC 2018 - jengelh@inai.de

View File

@ -13,7 +13,7 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
@ -21,7 +21,7 @@ Name: horst
Version: 5.1
Release: 0
Summary: IEEE 802.11 wireless LAN analyzer
License: GPL-2.0
License: GPL-2.0-only
Group: Productivity/Networking/Diagnostic
URL: http://br1.einfach.org/tech/horst/
Source: https://github.com/br101/horst/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
@ -29,11 +29,8 @@ BuildRequires: pkgconfig
BuildRequires: pkgconfig(libnl-3.0)
BuildRequires: pkgconfig(libnl-genl-3.0)
Recommends: iw
%if 0%{?suse_version} < 1500
BuildRequires: ncurses-devel
%else
BuildRequires: ncurses5-devel
%endif
BuildRequires: pkgconfig(ncursesw)
Patch0: horst-ncurses6w.patch
%description
horst is an IEEE 802.11 WLAN analyzer with a text interface. Its
@ -45,16 +42,17 @@ mesh networks.
%prep
%setup -q
%patch0 -p1
if [ -z "$SOURCE_DATE_EPOCH" ]; then
# Remove build time references so build-compare can do its work
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M:%%S')
sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/" *.c
sed -i "s/__TIME__/\"$FAKE_BUILDTIME\"/" *.c
fi
%build
export CFLAGS="%{optflags} `ncursesw5-config --cflags`"
export LDFLAGS="`ncursesw5-config --libs`"
export CFLAGS="%{optflags}"
make %{?_smp_mflags}
%install