diff --git a/.gitignore b/.gitignore index d0cb185..c7d3985 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ iptstate-2.2.1.tar.bz2 iptstate-2.2.2.tar.bz2 /iptstate-2.2.5.tar.bz2 /iptstate-2.2.6.tar.bz2 +/iptstate-2.2.7.tar.bz2 diff --git a/0001-Makefile-respect-LDFLAGS.patch b/0001-Makefile-respect-LDFLAGS.patch new file mode 100644 index 0000000..25361a2 --- /dev/null +++ b/0001-Makefile-respect-LDFLAGS.patch @@ -0,0 +1,27 @@ +From d3d373600e32ab1ec79211c7e592e628072951bf Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Fri, 10 Dec 2021 03:10:49 +0000 +Subject: [PATCH] Makefile: respect LDFLAGS + +Signed-off-by: Sam James +(cherry picked from commit 1ac59c1b12b2b53c8620a8195bbb3cd7c07ec9a9) +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 6e85b6c795fdc..f7eb4faa2772d 100644 +--- a/Makefile ++++ b/Makefile +@@ -49,7 +49,7 @@ iptstate: iptstate.cc Makefile + echo "+------------------------------------------------------------+" ;\ + echo ""; + +- $(CXX) $(CXXFLAGS) $(CXXFILES) -o iptstate $(LIBS) $(CPPFLAGS) ++ $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(CXXFILES) -o iptstate $(LIBS) + @touch iptstate + + @\ +-- +2.34.1 + diff --git a/0002-Makefile-Use-pkg-config.patch b/0002-Makefile-Use-pkg-config.patch new file mode 100644 index 0000000..aa91bcc --- /dev/null +++ b/0002-Makefile-Use-pkg-config.patch @@ -0,0 +1,56 @@ +From 323118dcf8c7872d607a77ce6f3f6f05af7fde7b Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Fri, 10 Dec 2021 03:10:42 +0000 +Subject: [PATCH] Makefile: Use pkg-config + +Depending on platform, linking against ncurses may require -ltinfo as well, +and linking against netfilter_conntrack may require -lnetfilter too. + +Signed-off-by: Sam James +(cherry picked from commit 3bac50422fcd8fae153e6787e767a3f7a1953a25) +--- + Makefile | 3 ++- + README.md | 6 +++--- + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/Makefile b/Makefile +index f7eb4faa2772d..ddf0ca552aefe 100644 +--- a/Makefile ++++ b/Makefile +@@ -13,6 +13,7 @@ SBIN?=$(PREFIX)/sbin + INSTALL?=/usr/bin/install + STRIP?=/usr/bin/strip + MAN?=$(PREFIX)/share/man ++PKG_CONFIG?=pkg-config + + ### ADVANCED USERS AND PACKAGERS MIGHT WANT TO CHANGE THIS + +@@ -25,7 +26,7 @@ CXXFLAGS?= -g -Wall -O2 -Werror=format-security -Wformat-truncation=0 + CXXFILES?= iptstate.cc + + # THIS IS FOR NORMAL COMPILATION +-LIBS?= -lncurses -lnetfilter_conntrack ++LIBS?= $(shell $(PKG_CONFIG) --libs ncurses libnetfilter_conntrack) + CPPFLAGS= + + ### YOU SHOULDN'T NEED TO CHANGE ANYTHING BELOW THIS +diff --git a/README.md b/README.md +index de1645169fdb5..3647d6dc6df5e 100644 +--- a/README.md ++++ b/README.md +@@ -28,9 +28,9 @@ Make sure you have some version of curses installed (for most users this is + probably ncurses). Note that if you are using vendor packages you will most + likely need the packaged with '-dev' on the end of of it (i.e. ncurses-dev). + +-Starting with version 2.2.0 you also need libnetfilter_conntrack version 0.0.50 +-or later. These libraries also require nf_conntrack_netlink and nfnetlink +-support in your kernel. ++Starting with version 2.2.0, you also need libnetfilter_conntrack version 0.0.50 ++or later. These libraries also require nf_conntrack_netlink and nfnetlink support ++in your kernel. You will also need pkg-config at build-time. + + ## INSTALLATION + +-- +2.34.1 + diff --git a/0003-Makefile-don-t-override-CPPFLAGS.patch b/0003-Makefile-don-t-override-CPPFLAGS.patch new file mode 100644 index 0000000..a4a01d8 --- /dev/null +++ b/0003-Makefile-don-t-override-CPPFLAGS.patch @@ -0,0 +1,29 @@ +From 23f4b4700a9f995df69650bcddbee8290a56fae1 Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Fri, 10 Dec 2021 03:19:45 +0000 +Subject: [PATCH] Makefile: don't override CPPFLAGS + +There's no need to explicitly blank this and it prevents overrides +from the environment. + +Signed-off-by: Sam James +(cherry picked from commit 9bd435ddbad5a2103d1e562c62f0126fd19f20eb) +--- + Makefile | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/Makefile b/Makefile +index ddf0ca552aefe..61ed786168d22 100644 +--- a/Makefile ++++ b/Makefile +@@ -27,7 +27,6 @@ CXXFILES?= iptstate.cc + + # THIS IS FOR NORMAL COMPILATION + LIBS?= $(shell $(PKG_CONFIG) --libs ncurses libnetfilter_conntrack) +-CPPFLAGS= + + ### YOU SHOULDN'T NEED TO CHANGE ANYTHING BELOW THIS + +-- +2.34.1 + diff --git a/iptstate-2.1-man8.patch b/iptstate-2.1-man8.patch deleted file mode 100644 index 3fb9661..0000000 --- a/iptstate-2.1-man8.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- iptstate-2.1/Makefile.man8 2006-10-06 07:49:11.000000000 +0200 -+++ iptstate-2.1/Makefile 2006-10-06 17:43:16.000000000 +0200 -@@ -68,6 +68,5 @@ - - uninstall: - /bin/rm -rf $(SBIN)/iptstate -- /bin/rm -rf $(MAN)/man1/iptstate.1 - /bin/rm -rf $(MAN)/man8/iptstate.8 - diff --git a/iptstate-2.2.6-no_debug.patch b/iptstate-2.2.6-no_debug.patch deleted file mode 100644 index 24ad628..0000000 --- a/iptstate-2.2.6-no_debug.patch +++ /dev/null @@ -1,18 +0,0 @@ -commit e8f591165f8ff077a183ff02147beb4129519f7d -Author: Thomas Woerner -Date: Wed Sep 28 13:08:49 2016 +0200 - - Drop debug output for tmpint in getopt_long while loop - -diff --git a/iptstate.cc b/iptstate.cc -index b03e566..5c9ddb1 100644 ---- a/iptstate.cc -+++ b/iptstate.cc -@@ -2179,7 +2179,6 @@ int main(int argc, char *argv[]) - // Command Line Arguments - while ((tmpint = getopt_long(argc, argv, "Cd:D:hlmcoLfpR:r1b:s:S:tv", - long_options, &option_index)) != EOF) { -- printf("loop: %d\n", tmpint); - switch (tmpint) { - case 0: - /* Apparently this test is needed?! Seems lame! */ diff --git a/iptstate-2.2.6-rhbz599181.patch b/iptstate-2.2.6-rhbz599181.patch deleted file mode 100644 index b756179..0000000 --- a/iptstate-2.2.6-rhbz599181.patch +++ /dev/null @@ -1,27 +0,0 @@ -commit e78a4bc9a921f597224af07def876ba18b8733c5 -Author: Thomas Woerner -Date: Tue Oct 25 12:40:45 2016 +0200 - - Fix segmentation fault if used with the options -1 -C - - Curses is not used with the "-1" single option, but c_warn is used if - counters are not enabled in the kernel and "-C" option is given. - - Fixes: RHBZ#599181 - -diff --git a/iptstate.cc b/iptstate.cc -index 5874605..b4b6108 100644 ---- a/iptstate.cc -+++ b/iptstate.cc -@@ -2407,7 +2407,10 @@ int main(int argc, char *argv[]) - prompt = "Counters requested, but not enabled in the"; - prompt += " kernel!"; - flags.counters = 0; -- c_warn(mainwin, prompt, flags); -+ if (flags.single) -+ cerr << prompt << endl; -+ else -+ c_warn(mainwin, prompt, flags); - } - - // Sort our table diff --git a/iptstate.spec b/iptstate.spec index af9a7be..977ec0a 100644 --- a/iptstate.spec +++ b/iptstate.spec @@ -1,11 +1,11 @@ Name: iptstate Summary: A top-like display of IP Tables state table entries -Version: 2.2.6 -Release: 15%{?dist} +Version: 2.2.7 +Release: 1%{?dist} Source: https://github.com/jaymzh/iptstate/releases/download/v%{version}/iptstate-%{version}.tar.bz2 -Patch0: iptstate-2.1-man8.patch -Patch1: iptstate-2.2.6-no_debug.patch -Patch2: iptstate-2.2.6-rhbz599181.patch +Patch01: 0001-Makefile-respect-LDFLAGS.patch +Patch02: 0002-Makefile-Use-pkg-config.patch +Patch03: 0003-Makefile-don-t-override-CPPFLAGS.patch URL: http://www.phildev.net/iptstate/ License: zlib Requires: iptables @@ -36,17 +36,13 @@ display the state table once. - much more... %prep -%setup -q -%patch0 -p1 -b .man8 -%patch1 -p1 -b .no_debug -%patch2 -p1 -b .rhbz599181 +%autosetup -p1 %build -make %{?_smp_mflags} CXXFLAGS="$RPM_OPT_FLAGS $RPM_LD_FLAGS" +%make_build %install -rm -rf %{buildroot} -make install PREFIX=%{buildroot}%{_prefix} INSTALL="install -p" +%make_install PREFIX=%{buildroot}%{_prefix} %files %doc LICENSE README.md @@ -54,6 +50,10 @@ make install PREFIX=%{buildroot}%{_prefix} INSTALL="install -p" %{_mandir}/man8/iptstate.* %changelog +* Tue Aug 09 2022 Phil Sutter - 2.2.7-1 +- New version 2.2.7 plus some pending fixes from upstream +- Simplify spec file using some newer macros + * Thu Jul 21 2022 Fedora Release Engineering - 2.2.6-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild diff --git a/sources b/sources index 8f0ca82..c4f4650 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ec96c93b43976960d2e2ba3306cd09e6 iptstate-2.2.6.tar.bz2 +SHA512 (iptstate-2.2.7.tar.bz2) = 43e258639e0f728d4a393d2dd7a834a6df1131da5291559a504800a0918dad3e010baaeb1bca66cb9a62bad6955f678be3302aac916fc956a525cdd7e9d0690a