From fe1d0726c532b7f73bb81dba931cb70a434d0b99 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 07 2019 05:09:01 +0000 Subject: import ipcalc-0.2.4-3.el8 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2608a8a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/ipcalc-0.2.4.tar.gz diff --git a/.ipcalc.metadata b/.ipcalc.metadata new file mode 100644 index 0000000..34b9d94 --- /dev/null +++ b/.ipcalc.metadata @@ -0,0 +1 @@ +6d6172868651a5b20762980c16e3cfa16f1bb8a7 SOURCES/ipcalc-0.2.4.tar.gz diff --git a/SOURCES/0001-fix-segfault-in-env-without-libmaxmind.so.patch b/SOURCES/0001-fix-segfault-in-env-without-libmaxmind.so.patch new file mode 100644 index 0000000..37077af --- /dev/null +++ b/SOURCES/0001-fix-segfault-in-env-without-libmaxmind.so.patch @@ -0,0 +1,26 @@ +From 2978e6afd68b1e028855e9166af6eff47eb60f41 Mon Sep 17 00:00:00 2001 +From: Martin Sehnoutka +Date: Fri, 3 Aug 2018 10:48:12 +0200 +Subject: [PATCH] fix segfault in env without libmaxmind.so + +--- + ipcalc-maxmind.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/ipcalc-maxmind.c b/ipcalc-maxmind.c +index bb4f495..6f0033b 100644 +--- a/ipcalc-maxmind.c ++++ b/ipcalc-maxmind.c +@@ -113,6 +113,9 @@ void geo_ip_lookup(const char *ip, char **country, char **ccode, char **city, ch + int gai_error, mmdb_error, status, coordinates=0; + double latitude, longitude; + ++ if (geo_setup() != 0) ++ return; ++ + /* Open the system maxmind database with countries */ + status = pMMDB_open(MAXMINDDB_LOCATION_COUNTRY, MMDB_MODE_MMAP, &mmdb); + if (MMDB_SUCCESS == status) { +-- +2.17.1 + diff --git a/SPECS/ipcalc.spec b/SPECS/ipcalc.spec new file mode 100644 index 0000000..4213d72 --- /dev/null +++ b/SPECS/ipcalc.spec @@ -0,0 +1,123 @@ +Name: ipcalc +Version: 0.2.4 +Release: 3%{?dist} +Summary: IP network address calculator + +# This is an updated version of ipcalc originally found +# in Fedora's initscripts at: +# https://fedorahosted.org/releases/i/n/initscripts/ + +License: GPLv2+ +URL: https://gitlab.com/ipcalc/ipcalc +Source0: https://gitlab.com/ipcalc/ipcalc/-/archive/%{version}/%{name}-%{version}.tar.gz + +BuildRequires: gcc, git, libmaxminddb-devel +Recommends: libmaxminddb, geolite2-city, geolite2-country + +# Explicitly conflict with older initscript packages that ship ipcalc +Conflicts: initscripts < 9.63 +# Obsolete ipcalculator +Obsoletes: ipcalculator < 0.41-20 + +Patch1: 0001-fix-segfault-in-env-without-libmaxmind.so.patch + +%description +ipcalc provides a simple way to calculate IP information for a host +or network. Depending on the options specified, it may be used to provide +IP network information in human readable format, in a format suitable for +parsing in scripts, generate random private addresses, resolve an IP address, +or check the validity of an address. + +%prep +%autosetup -S git + +%build +CFLAGS="${CFLAGS:-%optflags} $RPM_LD_FLAGS" \ + USE_RUNTIME_LINKING=yes USE_GEOIP=no USE_MAXMIND=yes LIBPATH=%{_libdir} make %{?_smp_mflags} + +%install +mkdir -p %{buildroot}%{_bindir} +install -p -m 755 ipcalc %{buildroot}%{_bindir}/ +mkdir -p -m 755 %{buildroot}%{_mandir}/man1 +install -p -m 644 ipcalc.1 %{buildroot}%{_mandir}/man1 + +%check +make check + +%files + +%{_bindir}/ipcalc +%license COPYING +%doc README.md +%{_mandir}/man1/ipcalc.1* + +%changelog +* Fri Aug 03 2018 Martin Sehnoutka - 0.2.4-3 +- Fix segfault in the container environment + +* Thu Aug 02 2018 Martin Sehnoutka - 0.2.4-2 +- Recommend databases + +* Tue Jul 24 2018 Martin Sehnoutka - 0.2.4-1 +- Resolves: #1601400 with rebase to 0.2.4 + +* Fri Feb 9 2018 Florian Weimer - 0.2.2-4 +- Another attempt at injecting LDFLAGS + +* Wed Feb 07 2018 Fedora Release Engineering - 0.2.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Feb 1 2018 Florian Weimer - 0.2.2-2 +- Build with linker flags from redhat-rpm-config + +* Tue Jan 02 2018 Nikos Mavrogiannopoulos - 0.2.2-1 +- New upstream release + +* Wed Aug 02 2017 Fedora Release Engineering - 0.2.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 0.2.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon May 15 2017 Nikos Mavrogiannopoulos - 0.2.0-1 +- New upstream release + +* Fri Feb 10 2017 Fedora Release Engineering - 0.1.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Jun 15 2016 Nikos Mavrogiannopoulos - 0.1.8-1 +- New upstream release + +* Fri Apr 1 2016 Nikos Mavrogiannopoulos - 0.1.7-1 +- New upstream release + +* Thu Feb 04 2016 Fedora Release Engineering - 0.1.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Tue Dec 8 2015 Nikos Mavrogiannopoulos - 0.1.6-1 +- New upstream release + +* Wed Oct 14 2015 Nikos Mavrogiannopoulos - 0.1.4-2 +- Corrected issue on --all-info + +* Wed Oct 14 2015 Nikos Mavrogiannopoulos - 0.1.4-1 +- New upstream release + +* Tue Oct 6 2015 Nikos Mavrogiannopoulos - 0.1.3-1 +- New upstream release +- Prints GeoIP information on generic info + +* Mon Sep 21 2015 Nikos Mavrogiannopoulos - 0.1.2-3 +- This package obsoletes ipcalculator + +* Wed Jun 17 2015 Fedora Release Engineering - 0.1.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Tue Jun 9 2015 Nikos Mavrogiannopoulos - 0.1.2-1 +- New upstream release + +* Tue May 19 2015 Nikos Mavrogiannopoulos - 0.1.1-1 +- Compatibility fixes (allow a mask of 0) + +* Mon May 18 2015 Nikos Mavrogiannopoulos - 0.1.0-1 +- First independent release outside initscripts