commit a4b7fd39be5fa7306d6e9150d9101b5b9afd6f97 Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 10:53:26 2019 -0400 Package init diff --git a/iptstate-2.1-man8.patch b/iptstate-2.1-man8.patch new file mode 100644 index 0000000..3fb9661 --- /dev/null +++ b/iptstate-2.1-man8.patch @@ -0,0 +1,9 @@ +--- 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 new file mode 100644 index 0000000..24ad628 --- /dev/null +++ b/iptstate-2.2.6-no_debug.patch @@ -0,0 +1,18 @@ +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 new file mode 100644 index 0000000..b756179 --- /dev/null +++ b/iptstate-2.2.6-rhbz599181.patch @@ -0,0 +1,27 @@ +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-2.2.6.tar.bz2 b/iptstate-2.2.6.tar.bz2 new file mode 100644 index 0000000..2bbd35f Binary files /dev/null and b/iptstate-2.2.6.tar.bz2 differ diff --git a/iptstate.spec b/iptstate.spec new file mode 100644 index 0000000..0d3de49 --- /dev/null +++ b/iptstate.spec @@ -0,0 +1,39 @@ +Name: iptstate +Summary: A top-like display of IP Tables state table entries +Version: 2.2.6 +Release: 8 +License: zlib +URL: http://www.phildev.net/iptstate/ +Source: https://github.com/jaymzh/iptstate/releases/download/v%{version}/%{name}-%{version}.tar.bz2 +Patch0: iptstate-2.1-man8.patch +Patch1: iptstate-2.2.6-no_debug.patch +Patch2: iptstate-2.2.6-rhbz599181.patch + +Requires: iptables +BuildRequires: gcc-c++ ncurses-devel libnetfilter_conntrack-devel + +%description +This package is written to display the top-like in IP Tables + +%package_help + +%prep +%autosetup -n %{name}-%{version} -p1 + +%build +%make_build CXXFLAGS="$RPM_OPT_FLAGS $RPM_LD_FLAGS" + +%install +make install PREFIX=%{buildroot}%{_prefix} INSTALL="install -p" + +%files +%doc LICENSE +%{_sbindir}/iptstate +%{_mandir}/man8/iptstate.* + +%files help +%doc README.md + +%changelog +* Wed Sep 10 2019 openEuler Buildteam - 2.2.6-8 +- Package init