diff --git a/horst-ncurses6w.patch b/horst-ncurses6w.patch new file mode 100644 index 0000000..139673d --- /dev/null +++ b/horst-ncurses6w.patch @@ -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 + #include + #include ++#include + + #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(); diff --git a/horst.changes b/horst.changes index ad20e4a..d5cfd69 100644 --- a/horst.changes +++ b/horst.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Fri Nov 16 14:43:09 UTC 2018 - Cristian Rodríguez + +- horst-ncurses6w.patch: Must call setlocale too. + +------------------------------------------------------------------- +Fri Nov 16 13:28:49 UTC 2018 - Cristian Rodríguez + +- 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 diff --git a/horst.spec b/horst.spec index 801991e..83817b2 100644 --- a/horst.spec +++ b/horst.spec @@ -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