# Detect the distribution in use %global __despace head -n 1 | tr -d '[:space:]' | sed -e 's/[(].*[)]//g' %global __lower4 cut -c 1-4 | tr '[:upper:]' '[:lower:]' %global __distfile %([ -f /etc/SuSE-release ] && echo /etc/SuSE-release || echo /etc/redhat-release) %global __distinit %(sed -e 's/ release .*//' -e 's/\\([A-Za-z]\\)[^ ]*/\\1/g' %{__distfile} | %{__despace} | %{__lower4}) %global __distvers %(sed -e 's/.* release \\([^. ]*\\).*/\\1/' %{__distfile} | %{__despace}) # Identify Alma, CentOS, CentOS Stream and Rocky Linux as rhel %if "%{__distinit}" == "a" || "%{__distinit}" == "c" || "%{__distinit}" == "cl" || "%{__distinit}" == "cs" || "%{__distinit}" == "rl" %global __distinit rhel %endif # Dist tag for Fedora is still "fc" %if "%{__distinit}" == "f" %global __distinit fc %endif Name: GeoIP Version: 1.6.12 Release: 14.0.cf.%{__distinit}%{__distvers} Summary: Library for country/city/organization to IP address or hostname mapping # Note: bundled GeoIP.dat data is CC-BY-SA-3.0 but we don't use or package it License: LGPL-2.1-or-later URL: http://www.maxmind.com/app/c Source0: https://github.com/maxmind/geoip-api-c/releases/download/v%{version}/GeoIP-%{version}.tar.gz BuildRequires: coreutils BuildRequires: gcc BuildRequires: make BuildRequires: sed BuildRequires: zlib-devel Requires: GeoIP-data # For compatibility with original release of GeoIP in old distributions %if (0%{?rhel} && 0%{?rhel} <= 7) || (0%{?fedora} && 0%{?fedora} <= 21) Requires: geoipupdate %endif # Old name of GeoIP library package Obsoletes: geoip < %{version}-%{release} Provides: geoip = %{version}-%{release} %description GeoIP is a C library that enables the user to find the country that any IP address or hostname originates from. It uses file based databases that can optionally be updated on a weekly basis by installing the geoipupdate-cron (IPv4) and/or geoipupdate-cron6 (IPv6) packages. %package devel Summary: Development headers and libraries for GeoIP Requires: %{name} = %{version}-%{release} Provides: geoip-devel = %{version}-%{release} Obsoletes: geoip-devel < %{version}-%{release} %description devel Development headers and static libraries for building GeoIP-based applications. %prep %setup -q %build %configure --disable-static --disable-dependency-tracking # Kill bogus rpaths sed -i -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool make %{?_smp_mflags} %install make DESTDIR=%{buildroot} INSTALL="install -p" install # nix the stuff we don't need like .la files. rm -f %{buildroot}%{_libdir}/*.la %check LD_LIBRARY_PATH=%{buildroot}%{_libdir} make check %if (0%{?rhel} && 0%{?rhel} <= 7) || (0%{?fedora} && 0%{?fedora} <= 27) # ldconfig replaced by RPM File Triggers from Fedora 28 %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %endif %files %license COPYING LICENSE %doc AUTHORS ChangeLog NEWS.md README.md %{_bindir}/geoiplookup %{_bindir}/geoiplookup6 %{_libdir}/libGeoIP.so.1 %{_libdir}/libGeoIP.so.1.* %{_mandir}/man1/geoiplookup.1* %{_mandir}/man1/geoiplookup6.1* %files devel %{_includedir}/GeoIP.h %{_includedir}/GeoIPCity.h %{_libdir}/libGeoIP.so %{_libdir}/pkgconfig/geoip.pc %changelog * Fri Mar 3 2023 Paul Howarth - 1.6.12-14.0.cf - Use SPDX-format license tag - Package LICENSE file * Thu Jul 22 2021 Paul Howarth - 1.6.12-10.0.cf - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - Fix dist tags for Alma and Rocky Linux * Tue Jan 26 2021 Paul Howarth - 1.6.12-9.0.cf - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - Use %%license unconditionally * Mon Jul 27 2020 Paul Howarth - 1.6.12-8.0.cf - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Sat Dec 14 2019 Paul Howarth - 1.6.12-7.0.cf - Rebuilt for EPEL-8 * Thu Jul 25 2019 Paul Howarth - 1.6.12-6.0.cf - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Fri Feb 1 2019 Paul Howarth - 1.6.12-5.0.cf - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Fri Jul 13 2018 Paul Howarth - 1.6.12-4.0.cf - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Wed Feb 14 2018 Paul Howarth - 1.6.12-3.0.cf - ldconfig replaced by RPM File Triggers from Fedora 28 - Use forward-looking conditionals * Thu Jan 18 2018 Paul Howarth - 1.6.12-1.0.cf - Update to 1.6.12 - Populate metro and area code when performing lookups in IPv6 City databases; previously this was only done when using IPv4 City databases * Thu Aug 3 2017 Paul Howarth - 1.6.11-3.0.cf - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild * Wed Jul 26 2017 Paul Howarth - 1.6.11-2.0.cf - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Tue May 16 2017 Paul Howarth - 1.6.11-1.0.cf - Update to 1.6.11 - Fix use of a NULL pointer when opening a corrupt database with 'GeoIP_open' (GH#87) - Drop support for old distributions prior to F-13 - Drop redundant BuildRoot: and Group: tags - Drop EL5-only dependency on GeoIP-GeoLite-data - Drop explicit pkgconfig dependency in devel package - Drop buildroot cleaning in %%install section - Drop explicit %%clean section * Thu Mar 30 2017 Paul Howarth - 1.6.10-1.0.cf - Update to 1.6.10 - GeoIP_database_info now returns the full version string rather than incorrectly truncating it (GH#79) - This API is now distributed with a small test copy of GeoIP.dat rather than a full copy - Fix issue where Visual Studio 2015 was optimizing out initialization code (GH#81) - Fix test/benchmark on Windows (GH#75) * Sun Feb 26 2017 Paul Howarth - 1.6.9-4.0.cf - Fix GeoIP_database_info truncation issue (#1426853, GH#79, GH#80) * Fri Feb 10 2017 Paul Howarth - 1.6.9-3.0.cf - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Wed Feb 3 2016 Paul Howarth - 1.6.9-2.0.cf - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Tue Jan 12 2016 Paul Howarth - 1.6.9-1.0.cf - Update to 1.6.9 - Allow compilation on older systems by relaxing the autoconf and automake minimum versions - Avoid potential problems in multi-threaded environments by consistently using pread() rather than read() - Fix various small issues reported by clang's static analyser - Fix a regression introduced in version 1.6.8, which caused GeoIP_database_info to erroneously return NULL * Sun Nov 1 2015 Paul Howarth - 1.6.7-1.0.cf - Update to 1.6.7 - Fixed a MSVC parser stack overflow when parsing 'regionName.c' and 'timeZone.c' (GH#54) - Updated region codes and timezones - When using 'GEOIP_MEMORY_CACHE' with an invalid database file, the search tree traversal could attempt to read memory outside of the memory allocated for the memory cache, resulting in a segmentation fault; a check was added to ensure that the traversal code does not try to read beyond the end of the file, whether in memory, memory mapped, or on disk - Previously the return values from file reads were ignored; we now check these values to ensure that there were no errors * Thu Jul 30 2015 Paul Howarth - 1.6.6-1.0.cf - Update to 1.6.6 - Replaced usage of deprecated fileno, read, and lseek on Visual Studio 2005+ with their ISO C++ conformant replacements (GH#55) - A warning about using a double as a float was fixed (GH#56) - Fixed segfault when doing a lookup on an empty database (GH#62) - Fixed a memcheck error from valgrind in the '_check_mtime' function (GH#60) - Fixed '_check_mtime' to check the return value of 'gettimeofday' rather than just assuming it worked * Wed Jun 17 2015 Paul Howarth - 1.6.5-3.0.cf - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Thu Apr 23 2015 Paul Howarth - 1.6.5-2.0.cf - Work around problems with old GeoIP-data package in CentOS 5 Extras repo (http://bugs.centos.org/view.php?id=8488) by requiring GeoIP-GeoLite-data rather than the virtual GeoIP-data for EL-5 builds only * Mon Mar 2 2015 Paul Howarth - 1.6.5-1.0.cf - Update to 1.6.5 - Fixed a segmentation fault in geoiplookup when the utility was passed an invalid database (#1180874) - Additional validation was added for the size used in the creation of the index cache (#832913) - Changed the code to only look up country codes by using functions that ensure that we do not try to look past the end of an array (GitHub #53) * Fri Feb 20 2015 Paul Howarth - 1.6.4-4.0.cf - Databases now unbundled to the GeoIP-GeoLite-data package - Drop long-unused perl helper scripts - Add explicit pkgconfig dependency for EL-5 build - Drop timestamp hack for configure, no longer needed * Tue Feb 10 2015 Paul Howarth - 1.6.4-3.0.cf - Sub-package the data; going forward, this would be better as a separate package, since it has separate upstream releases than the library * Tue Feb 3 2015 Paul Howarth - 1.6.4-1.0.cf - Update to 1.6.4 - Unbundle geoipupdate; require it for older releases that had 1.5.x * Mon Aug 18 2014 Paul Howarth - 1.5.1-6.0.cf - Use %%license where possible * Sat Jun 7 2014 Paul Howarth - 1.5.1-5.0.cf - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Tue Feb 25 2014 Paul Howarth - 1.5.1-4.0.cf - Add %%check - Update databases from upstream * Sun Aug 4 2013 Paul Howarth - 1.5.1-3.0.cf - Properly provide all of the GeoLite databases and their IPv6 equivalents, as per the geoip-geolite package that we're obsoleting/providing - Provide compatibility symlinks for database files that historically had different names in GeoIP and geoip-geolite - Don't distribute unbundled LICENSE files, as per packaging guidelines - Update license tag to reflect distribution of CC-BY-SA database content - No longer try to update the databases in %%post - Maintain timestamps where possible - Set up GeoIP.dat symlink in package and don't touch it again - Add update6 package to update the IPv6 databases; have to use wget for this rather than geoipupdate as the databases are still in beta * Thu Jun 13 2013 Paul Howarth - 1.5.1-1.0.cf - Update to 1.5.1 (see ChangeLog for details) - Fix exit codes for various situations (MaxMind support #129155) - Obsolete/Provide geoip-geolite (#968074) - Update UTF8 patch * Mon Jun 10 2013 Paul Howarth - 1.5.0-6.0.cf - Update sub-package requires main package for geoipupdate script * Mon Jun 10 2013 Paul Howarth - 1.5.0-5.0.cf - Version bump to 1.5.0 - Have GeoIP.dat be a symlink to the real data, and install the canned GeoIP.dat as GeoIP-initial.dat - Change config as per Boris' instructions to use 'lite' databases, which are regularly updated - Add pkgconfig (.pc) file into devel subpackage - Add cron support for refreshing the lite databases and make a separate subpackage - Update %%description to mention database updates - Update UTF-8 patch - Drop aarch64 patch, no longer needed - Drop outdated README.Fedora * Sun Mar 24 2013 Paul Howarth - 1.4.8-6.0.cf - Fix config.guess and config.sub to add aarch64 support (#925403) * Wed Feb 13 2013 Paul Howarth - 1.4.8-5.0.cf - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Mon Oct 22 2012 Paul Howarth - 1.4.8-4.0.cf - libGeoIPUpdate and geoipupdate (which is linked against it) are GPL-licensed rather than LGPL-licensed (#840896) - Don't package generic INSTALL file (#661625) * Tue Jul 24 2012 Paul Howarth - 1.4.8-3.2.cf - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Wed Jan 18 2012 Paul Howarth - 1.4.8-2.2.cf - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Thu Oct 6 2011 Paul Howarth - 1.4.8-1.3.cf - Fix dist tag for CentOS 6 and Scientific Linux * Wed Sep 7 2011 Paul Howarth - 1.4.8-1.2.cf - Fix autotools timestamps to remove RPATH on x86_64 builds again * Mon Jun 27 2011 Paul Howarth - 1.4.8-1.0.cf - Update to 1.4.8 - Fix GEOIP_DOMAIN_EDITION_V6 - Fix GEOIP_ORG_EDITION_V6 and GEOIP_ISP_EDITION_V6 - Add new Datatypes GEOIP_NETSPEED_EDITION_REV1_V6 and GEOIP_NETSPEED_EDITION_REV1 - Fix possible directory traversal weakness in geoipupdate-pureperl.pl with malicious update server - Update UTF-8 patch * Fri Jun 3 2011 Paul Howarth - 1.4.7-1.0.cf - Update to 1.4.7 (see ChangeLog for details) - Drop upstreamed IPv6 patch - Nobody else likes macros for commands * Mon Nov 1 2010 Paul Howarth - 1.4.7-0.2.20090931cvs - Import from Fedora - Recode docs as UTF-8 - Kill bogus rpaths on x86_64 - Clean up IPv6 patch somewhat * Mon Aug 31 2009 Matt Domsch - 1.4.7-0.1.20090931cvs - Apply CVS HEAD 20090931 which includes IPv6 functions * Fri Jul 24 2009 Fedora Release Engineering - 1.4.6-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Sun Mar 08 2009 Michael Fleming - 1.4.6-1 - Add geoiplookup6 man page - Update to 1.4.6 * Mon Feb 23 2009 Fedora Release Engineering - 1.4.5-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Sat Nov 29 2008 Michael Fleming 1.4.5-2 - Update to 1.4.5 - Fix database URL locations in Perl helper scripts * Tue Feb 19 2008 Fedora Release Engineering - 1.4.4-2 - Autorebuild for GCC 4.3 * Mon Jan 28 2008 Michael Fleming 1.4.4-1 - New upstream release * Wed Sep 5 2007 Michael Fleming 1.4.3-1 - New upstream release - Fix GeoIPCity fetcher script - Update License tag * Mon Feb 12 2007 Michael Fleming 1.4.2-1 - New upstream release * Mon Jan 8 2007 Michael Fleming 1.4.1-2 - License is actually LGPL now * Sun Jan 7 2007 Michael Fleming 1.4.1-1 - New upstream release - Add fetch-geoipdata* scripts to pull free databases automatically if desired (bz #198137) - README.fedora added to briefly explain above * Mon Nov 27 2006 Michael Fleming 1.4.0-4 - Fix %%install scripts to satisfy newer mock builds * Sun Sep 3 2006 Michael Fleming 1.4.0-3 - Upstream upgrade - Added LICENSE.txt file to %%doc, covering GeoIP country/city data license (bz #198137) * Mon May 15 2006 Michael Fleming 1.3.17-1 - New upstream release (minor fixes) * Mon May 1 2006 Michael Fleming 1.3.16-1 - New upstream release - Add INSTALL document to package * Sat Feb 18 2006 Michael Fleming 1.3.14-3 - Fix Obsoletes/Provides for old "geoip"-convention packages - Move .so symlinks to -devel where they should be * Fri Feb 10 2006 Michael Fleming 1.3.14-2 - Remamed to match upstream tarball name - Removed static libraries - Added symlinks to packages - Mark config file noreplace * Sun Feb 5 2006 Michael Fleming 1.3.14-1 - Initial review package for Extras