import UBI ipcalc-1.0.3-12.el10

This commit is contained in:
eabdullin 2025-05-14 19:03:44 +00:00
parent a8922ae70b
commit 14e0f83ec3
7 changed files with 239 additions and 183 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/ipcalc-0.2.4.tar.gz
ipcalc-1.0.3.tar.gz

View File

@ -1 +0,0 @@
6d6172868651a5b20762980c16e3cfa16f1bb8a7 SOURCES/ipcalc-0.2.4.tar.gz

View File

@ -1,26 +0,0 @@
From 2978e6afd68b1e028855e9166af6eff47eb60f41 Mon Sep 17 00:00:00 2001
From: Martin Sehnoutka <msehnout@redhat.com>
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

View File

@ -1,28 +0,0 @@
diff --git a/ipcalc.c b/ipcalc.c
index f2bc47a..04c9372 100644
--- a/ipcalc.c
+++ b/ipcalc.c
@@ -146,7 +146,12 @@ static struct in_addr calc_broadcast(struct in_addr addr, int prefix)
mask.s_addr = prefix2mask(prefix);
memset(&broadcast, 0, sizeof(broadcast));
- broadcast.s_addr = (addr.s_addr & mask.s_addr) | ~mask.s_addr;
+
+ /* if prefix is set to 31 return 255.255.255.255 (RFC3021) */
+ if (mask.s_addr == htonl(0xFFFFFFFE))
+ broadcast.s_addr = htonl(0xFFFFFFFF);
+ else
+ broadcast.s_addr = (addr.s_addr & mask.s_addr) | ~mask.s_addr;
return broadcast;
}
diff --git a/tests/192.168.1.5-31 b/tests/192.168.1.5-31
index fee8227..b720b56 100644
--- a/tests/192.168.1.5-31
+++ b/tests/192.168.1.5-31
@@ -1,4 +1,4 @@
NETMASK=255.255.255.254
PREFIX=31
-BROADCAST=192.168.1.5
+BROADCAST=255.255.255.255
NETWORK=192.168.1.4

View File

@ -1,127 +0,0 @@
Name: ipcalc
Version: 0.2.4
Release: 4%{?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
Patch2: 0002-add-support-for-RFC3021.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
* Thu Oct 10 2019 Martin Osvald <mosvald@redhat.com> - 0.2.4-4
- Add support for RFC3021 (#1638834)
* Fri Aug 03 2018 Martin Sehnoutka <msehnout@redhat.com> - 0.2.4-3
- Fix segfault in the container environment
* Thu Aug 02 2018 Martin Sehnoutka <msehnout@redhat.com> - 0.2.4-2
- Recommend databases
* Tue Jul 24 2018 Martin Sehnoutka <msehnout@redhat.com> - 0.2.4-1
- Resolves: #1601400 with rebase to 0.2.4
* Fri Feb 9 2018 Florian Weimer <fweimer@redhat.com> - 0.2.2-4
- Another attempt at injecting LDFLAGS
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Feb 1 2018 Florian Weimer <fweimer@redhat.com> - 0.2.2-2
- Build with linker flags from redhat-rpm-config
* Tue Jan 02 2018 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.2.2-1
- New upstream release
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Mon May 15 2017 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.2.0-1
- New upstream release
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Wed Jun 15 2016 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.8-1
- New upstream release
* Fri Apr 1 2016 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.7-1
- New upstream release
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Dec 8 2015 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.6-1
- New upstream release
* Wed Oct 14 2015 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.4-2
- Corrected issue on --all-info
* Wed Oct 14 2015 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.4-1
- New upstream release
* Tue Oct 6 2015 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.3-1
- New upstream release
- Prints GeoIP information on generic info
* Mon Sep 21 2015 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.2-3
- This package obsoletes ipcalculator
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Tue Jun 9 2015 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.2-1
- New upstream release
* Tue May 19 2015 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.1-1
- Compatibility fixes (allow a mask of 0)
* Mon May 18 2015 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.0-1
- First independent release outside initscripts

237
ipcalc.spec Normal file
View File

@ -0,0 +1,237 @@
## START: Set by rpmautospec
## (rpmautospec version 0.6.5)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 12;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec
Name: ipcalc
Version: 1.0.3
Release: %autorelease
Summary: IP network address calculator
License: GPL-2.0-or-later
URL: https://gitlab.com/ipcalc/ipcalc
Source0: https://gitlab.com/ipcalc/ipcalc/-/archive/%{version}/ipcalc-%{version}.tar.gz
BuildRequires: gcc, libmaxminddb-devel, meson, rubygem-ronn-ng
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
%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
%build
%meson -Duse_maxminddb=enabled -Duse_runtime_linking=enabled
%meson_build
%install
%meson_install
%check
%meson_test
%files
%{_bindir}/ipcalc
%license COPYING
%doc README.md
%{_mandir}/man1/ipcalc.1*
%changelog
## START: Generated by rpmautospec
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1.0.3-12
- Bump release for October 2024 mass rebuild:
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1.0.3-11
- Bump release for June 2024 mass rebuild
* Wed Jun 19 2024 Ondrej Mejzlik <omejzlik@redhat.com> - 1.0.3-10
- update plans
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sat Jan 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Aug 23 2023 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com> - 1.0.3-7
- Added packit config
* Wed Aug 23 2023 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com> - 1.0.3-6
- use %%autorelease and %%autochangelog
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jul 18 2023 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com> - 1.0.3-4
- packit: added issue_repository
* Tue Jul 18 2023 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com> - 1.0.3-3
- packit: added koji and bodhi updates
* Tue Jul 18 2023 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com> - 1.0.3-2
- Added packit.yaml for automating updates
* Wed Jun 07 2023 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com> - 1.0.3-1
- updated to 1.0.3
* Thu Feb 16 2023 Richard Lescak <rlescak@redhat.com> - 1.0.2-3
- SPDX migration
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Nov 26 2022 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com> - 1.0.2-1
- updated to 1.0.2
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu Jun 17 2021 Richard Lescak <rlescak@redhat.com> - 1.0.1-1
- Updated to 1.0.1
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Nov 23 2020 Nikos Mavrogiannopoulos <nmav@redhat.com> - 1.0.0-3
- updated nvr
* Mon Nov 23 2020 Nikos Mavrogiannopoulos <nmav@redhat.com> - 1.0.0-2
- replaced ronn with its successor
* Sat Oct 03 2020 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com> - 1.0.0-1
- ipcalc: updated to latest release
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed May 13 2020 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.4.1-2
- corrected date
* Fri Apr 24 2020 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com> - 0.4.1-1
- updated to 0.4.1
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sat Dec 28 2019 Nikos Mavrogiannopoulos <nmav@gnutls.org> - 0.4.0-1
- updated to 0.4.0
* Sat Nov 23 2019 Nikos Mavrogiannopoulos <nmav@gnutls.org> - 0.3.0-1
- updated to 0.3.0
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Tue Feb 19 2019 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.2.5-2
- Re-added the geolite2-city, geolite2-country dependencies
* Mon Feb 18 2019 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.2.5-1
- updated to 0.2.5
* Mon Feb 18 2019 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.2.4-4
- added libmaxminddb dependency
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Thu Aug 09 2018 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.2.4-2
- Fix crash when -g option is used
* Mon Jul 23 2018 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.2.4-1
- updated to 0.2.4
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu May 31 2018 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.2.3-1
- updated to 0.2.3
* Fri Feb 09 2018 Florian Weimer <fweimer@redhat.com> - 0.2.2-4
- Another attempt at injecting LDFLAGS
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Feb 01 2018 Florian Weimer <fweimer@redhat.com> - 0.2.2-2
- Build with linker flags from redhat-rpm-config
* Tue Jan 02 2018 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.2.2-1
- new upstream release
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-3
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Mon May 15 2017 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.2.0-1
- updated to 0.2.0
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Wed Jun 15 2016 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.8-2
- updated sources
* Wed Jun 15 2016 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.8-1
- updated to ipcalc 0.1.8
* Fri Apr 01 2016 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.7-1
- updated to ipcalc 0.1.7
* Thu Feb 04 2016 Dennis Gilmore <dennis@ausil.us> - 0.1.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Dec 08 2015 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.6-1
- updated to ipcalc 0.1.6
* Wed Oct 14 2015 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.4-2
- corrected issue in --all-info
* Wed Oct 14 2015 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.4-1
- updated to 0.1.4
* Tue Oct 06 2015 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.3-1
- updated to 0.1.3
* Mon Sep 21 2015 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.2-4
- bumped version to obsolete ipcalculator
* Thu Aug 13 2015 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.2-3
- added header to obsolete ipcalculator (#1250082)
* Wed Jun 17 2015 Dennis Gilmore <dennis@ausil.us> - 0.1.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Tue Jun 09 2015 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.2-1
- updated to 0.1.2
* Tue May 19 2015 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.1-1
- updated to 0.1.1
* Mon May 18 2015 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.1.0-1
- Added ipcalc package from initscripts
## END: Generated by rpmautospec

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (ipcalc-1.0.3.tar.gz) = 9f6415e68c75858cea404200dcaa6cbde9676fc48b01253bd30fad1b0c1f0cd3e6d9b1fbf78392bf8c2eb06d0c8b0220c5e7c519b8e29dde1694fd09c41038cb