diff --git a/.GeoIP.metadata b/.GeoIP.metadata index 2a01620..39d2f86 100644 --- a/.GeoIP.metadata +++ b/.GeoIP.metadata @@ -1,7 +1 @@ -09abf240ad4c4c3743113465d01b7c74b3140b9f SOURCES/GeoIP-1.5.0.tar.gz -1342a88b7ec340f7047f34de5ed722ac37c38fe0 SOURCES/GeoIP.dat.gz -4ec0df2fd67f7d17d581ad5c1b96aa87d6c838e8 SOURCES/GeoIPASNum.dat.gz -4085ecf9a64a10214f33a350c2a299b4c292117b SOURCES/GeoIPASNumv6.dat.gz -3b7cc30ddfc2f559c14b798f1d7e52241a7d9cdc SOURCES/GeoIPv6.dat.gz -bb7eca125c87d4df7d41035d3eaafd8be9da9e18 SOURCES/GeoLiteCity.dat.gz -a15de3d2059fef4b0e77f3a3bb1b95ac6090eba1 SOURCES/GeoLiteCityv6.dat.gz +ac1a6809afbb7624aff2f6e12ceb300b12de1715 SOURCES/GeoIP-1.6.12.tar.gz diff --git a/SPECS/GeoIP.spec b/SPECS/GeoIP.spec index dab5b3c..66f27ac 100644 --- a/SPECS/GeoIP.spec +++ b/SPECS/GeoIP.spec @@ -1,63 +1,39 @@ -# Noarch subpackages available from Fedora 10, RHEL 6 -%global noarch_subpkgs 0%{?fedora} > 9 || 0%{?rhel} > 5 +# Tests require network access so fail in koji; build using --with tests to run them yourself +%bcond_with tests Name: GeoIP -Version: 1.5.0 -Release: 14%{?dist} +Version: 1.6.12 +Release: 9%{?dist} Summary: Library for country/city/organization to IP address or hostname mapping -Group: Development/Libraries -License: LGPLv2+ and GPLv2+ and CC-BY-SA +License: LGPLv2+ URL: http://www.maxmind.com/app/c -Source0: http://www.maxmind.com/download/geoip/api/c/GeoIP-%{version}.tar.gz -Source1: LICENSE.txt -Source2: fetch-geoipdata-city.pl -Source3: fetch-geoipdata.pl -Source5: geoipupdate.cron -# Data sources indexed at http://dev.maxmind.com/geoip/legacy/geolite -Source10: http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz -Source11: http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz -Source12: http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz -Source13: http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz -Source14: http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz -Source15: http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz -Patch10: GeoIP-1.5.0-UTF8.patch -Patch11: GeoIP-1.5.0-geoipupdate-message.patch - -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu) +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%{?fedora} < 22 && 0%{?rhel} < 8 +Requires: geoipupdate +%endif + +# Old name of GeoIP library package Obsoletes: geoip < %{version}-%{release} Provides: geoip = %{version}-%{release} -Requires: geoipupdate %description GeoIP is a C library that enables the user to find the country that any IP -address or hostname originates from. It uses a file based database that is -accurate as of June 2007 and can optionally be updated on a weekly -basis by installing the GeoIP-update package. This database simply contains IP -blocks as keys, and countries as values. This database should be more complete -and accurate than using reverse DNS lookups. - -This package includes GeoLite data created by MaxMind, available from -http://www.maxmind.com/ - -%package data -Summary: Static snapshot of GeoIP databases -Group: Applications/Databases -Requires: %{name} = %{version}-%{release} -%if %{noarch_subpkgs} -BuildArch: noarch -%endif - -%description data -Snapshot of IPv4 and IPv6 databases for GeoIP. These databases are not -regularly updated, use a cron job from GeoIP-update package to get fresh ones. +address or hostname originates from. -This package includes GeoLite data created by MaxMind, available from -http://www.maxmind.com/ +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 -Group: Development/Libraries Requires: %{name} = %{version}-%{release} Provides: geoip-devel = %{version}-%{release} Obsoletes: geoip-devel < %{version}-%{release} @@ -68,35 +44,7 @@ Development headers and static libraries for building GeoIP-based applications. %prep %setup -q -# Recode docs as UTF-8 -%patch10 -p1 -%patch11 -p1 - -install -D -m644 %{SOURCE1} LICENSE.txt -install -D -m644 %{SOURCE2} fetch-geoipdata-city.pl -install -D -m644 %{SOURCE3} fetch-geoipdata.pl - -# Distribute all databases as *-inital.dat files in GeoIP packages. -# User then can download real .dat files without replacing the ones from -# package. -install -p -m 644 %{SOURCE10} data/GeoIP-initial.dat.gz; gunzip data/GeoIP-initial.dat -install -p -m 644 %{SOURCE11} data/GeoIPv6-initial.dat.gz; gunzip data/GeoIPv6-initial.dat -# City and ASN databases will be in GeoIP-data subpackage as -initial files -# and linked to non--initial on installation of the subpackage. -install -p -m 644 %{SOURCE12} data/GeoIPCity-initial.dat.gz; gunzip data/GeoIPCity-initial.dat -install -p -m 644 %{SOURCE13} data/GeoIPCityv6-initial.dat.gz; gunzip data/GeoIPCityv6-initial.dat -install -p -m 644 %{SOURCE14} data/GeoIPASNum-initial.dat.gz; gunzip data/GeoIPASNum-initial.dat -install -p -m 644 %{SOURCE15} data/GeoIPASNumv6-initial.dat.gz; gunzip data/GeoIPASNumv6-initial.dat - %build -# Fix timestamp order to avoid trying to re-run autotools and configure, -# thus clobbering our hacked libtool later on -touch aclocal.m4 -touch configure -touch config.h.in -touch config.status -find . -name Makefile.in -exec touch {} \; - %configure --disable-static --disable-dependency-tracking # Kill bogus rpaths @@ -106,138 +54,213 @@ sed -i -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ make %{?_smp_mflags} %install -rm -rf %{buildroot} -make DESTDIR=%{buildroot} install +make DESTDIR=%{buildroot} INSTALL="install -p" install # nix the stuff we don't need like .la files. rm -f %{buildroot}%{_libdir}/*.la -# install downloaded GeoLite databases -for db in \ - GeoIP-initial.dat \ - GeoIPv6-initial.dat \ - GeoIPCity-initial.dat \ - GeoIPCityv6-initial.dat \ - GeoIPASNum-initial.dat \ - GeoIPASNumv6-initial.dat -do - install -p -m 644 data/$db %{buildroot}%{_datadir}/GeoIP/ -done - -# create empty files for initial %%ghost databases -touch %{buildroot}%{_datadir}/GeoIP/GeoIP{ASNum,City,Country}{,v6}.dat -chmod 644 %{buildroot}%{_datadir}/GeoIP/GeoIP{ASNum,City,Country}{,v6}.dat - -# make the default GeoIP.dat a symlink to our -initial data file. -ln -sf GeoIP-initial.dat %{buildroot}%{_datadir}/GeoIP/GeoIP.dat -ln -sf GeoIPv6-initial.dat %{buildroot}%{_datadir}/GeoIP/GeoIPv6.dat - -#links used when invoking geoiplookup -v -ln -sf GeoIPCity-initial.dat %{buildroot}%{_datadir}/GeoIP/GeoIPCity.dat -ln -sf GeoIPCityv6-initial.dat %{buildroot}%{_datadir}/GeoIP/GeoIPCityv6.dat - -# Add compat symlinks for GeoIPASNum.dat and GeoLiteASNumv6.dat -# ([upstream] database names used in the old geoip-geolite package) -ln -sf GeoIPASNum.dat %{buildroot}%{_datadir}/GeoIP/GeoIPASNum.dat -ln -sf GeoIPASNumv6.dat %{buildroot}%{_datadir}/GeoIP/GeoIPASNumv6.dat - -#Remove files used by geoipupdate - it has its own package -rm %{buildroot}%{_bindir}/geoipupdate -rm %{buildroot}%{_includedir}/GeoIPUpdate.h -rm %{buildroot}%{_libdir}/libGeoIPUpdate.so* -rm %{buildroot}%{_mandir}/man1/geoipupdate.1* -rm %{buildroot}/etc/GeoIP.conf* - -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - -%post data -# Link *-initial.dat files as official GeoIP database files. Make sure not to -# overwrite any user databases! -for db in GeoIPCity.dat GeoIPCityv6.dat GeoIPASNum.dat GeoIPASNumv6.dat ; do - db_initial=${db%.dat}-initial.dat - if [ ! -e "/usr/share/GeoIP/$db" ]; then - ln -s "/usr/share/GeoIP/$db_initial" "/usr/share/GeoIP/$db" &>/dev/null || : - fi -done - -%postun data -if [ "$1" == "0" ]; then - for db in GeoIPCity.dat GeoIPCityv6.dat GeoIPASNum.dat GeoIPASNumv6.dat ; do - db_initial=${db%.dat}-initial.dat - # Remove links to -initial files, ignoring links anywhere else - if [ -h "/usr/share/GeoIP/$db" -a $(readlink /usr/share/GeoIP/$db) = "/usr/share/GeoIP/$db_initial" ]; then - rm "/usr/share/GeoIP/$db" &>/dev/null || : - fi - done -fi +%check +# Tests require network access so fail in koji; build using --with tests to run them yourself +%{?with_tests:LD_LIBRARY_PATH=%{buildroot}%{_libdir} make check} +%ldconfig_scriptlets %files -# LGPLv2+ -%doc AUTHORS COPYING ChangeLog README TODO LICENSE* fetch-* +%if 0%{?_licensedir:1} +%license COPYING +%else +%doc COPYING +%endif +%doc AUTHORS ChangeLog NEWS.md README.md %{_bindir}/geoiplookup %{_bindir}/geoiplookup6 -%dir %{_datadir}/GeoIP/ -%{_datadir}/GeoIP/GeoIP-initial.dat -%{_datadir}/GeoIP/GeoIPv6-initial.dat -# The other databases are %%verify(not md5 size mtime) so that they can be updated via the cron scripts -# and rpm will not moan about the files having changed -%verify(not md5 size link mtime) %{_datadir}/GeoIP/GeoIP.dat -%verify(not md5 size link mtime) %{_datadir}/GeoIP/GeoIPv6.dat -%ghost %{_datadir}/GeoIP/GeoIPASNum.dat -%ghost %{_datadir}/GeoIP/GeoIPCity.dat -%ghost %{_datadir}/GeoIP/GeoIPCountry.dat -%ghost %{_datadir}/GeoIP/GeoIPASNumv6.dat -%ghost %{_datadir}/GeoIP/GeoIPCityv6.dat -%ghost %{_datadir}/GeoIP/GeoIPCountryv6.dat %{_libdir}/libGeoIP.so.1 %{_libdir}/libGeoIP.so.1.* %{_mandir}/man1/geoiplookup.1* %{_mandir}/man1/geoiplookup6.1* -%files data -%{_datadir}/GeoIP/GeoIPCity-initial.dat -%{_datadir}/GeoIP/GeoIPCityv6-initial.dat -%{_datadir}/GeoIP/GeoIPASNum-initial.dat -%{_datadir}/GeoIP/GeoIPASNumv6-initial.dat - %files devel -# LGPLv2+ %{_includedir}/GeoIP.h %{_includedir}/GeoIPCity.h %{_libdir}/libGeoIP.so %{_libdir}/pkgconfig/geoip.pc %changelog -* Mon Feb 18 2019 Michal Ruprich - 1.5.0-14 -- Resolves: #1666767 - Remove geoipupdate binary from GeoIP - -* Tue Jul 31 2018 Michal Ruprich - 1.5.0-13 -- Related: #1409060 - Missing symlink at the GeoIP-update package - -* Tue Jun 19 2018 Michal Ruprich - 1.5.0-12 -- Removed clean section -- Resolves: #1589860 - Update GeoIP legacy databases -- Resolves: #1409060 - Missing symlink at the GeoIP-update package - -* Wed Jun 29 2016 Jan Safranek - 1.5.0-11 -- Fixed rpmlint errors - -* Wed Jun 29 2016 Jan Safranek - 1.5.0-10 -- Added base IPv6 database to GeoIP package -- Added GeoIP-data subpackage with all other databases (#1201857) - -* Fri Jan 24 2014 Daniel Mach - 1.5.0-9 -- Mass rebuild 2014-01-24 - -* Fri Dec 27 2013 Daniel Mach - 1.5.0-8 -- Mass rebuild 2013-12-27 - -* Wed Nov 13 2013 Jan Safranek - 1.5.0-7 -- Don't download the database in %post (#1029807) -- Don't download GeoLiteASNum as it's no longer provided. +* Mon Jan 25 2021 Fedora Release Engineering - 1.6.12-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Mon Jul 27 2020 Fedora Release Engineering - 1.6.12-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jan 28 2020 Fedora Release Engineering - 1.6.12-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Jul 24 2019 Fedora Release Engineering - 1.6.12-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu Jan 31 2019 Fedora Release Engineering - 1.6.12-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Jul 12 2018 Fedora Release Engineering - 1.6.12-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Feb 07 2018 Fedora Release Engineering - 1.6.12-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sat Feb 03 2018 Igor Gnatenko - 1.6.12-2 +- Switch to %%ldconfig_scriptlets + +* Thu Jan 18 2018 Paul Howarth - 1.6.12-1 +- 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 + +* Wed Aug 02 2017 Fedora Release Engineering - 1.6.11-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.6.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Tue May 16 2017 Paul Howarth - 1.6.11-1 +- Update to 1.6.11 + - Fix use of a NULL pointer when opening a corrupt database with 'GeoIP_open' + (GH#87) +- Drop EL-5 support + - 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 +- 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 +- Fix GeoIP_database_info truncation issue (#1426853, GH#79, GH#80) + +* Fri Feb 10 2017 Fedora Release Engineering - 1.6.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Feb 03 2016 Fedora Release Engineering - 1.6.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Tue Jan 12 2016 Paul Howarth - 1.6.9-1 +- 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 +- 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 +- 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 + +* Tue Jun 16 2015 Fedora Release Engineering - 1.6.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Thu Apr 23 2015 Paul Howarth - 1.6.5-2 +- 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 +- 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 +- 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 +- Sub-package the data; going forward, this would be better as a separate + package, since it has separate upstream releases than the library + +* Fri Feb 6 2015 Paul Howarth - 1.6.4-2 +- Only require geoipupdate prior to F-22, for back-compatibility +- Use %%license where possible +- GeoIP-devel provides geoip-devel as well as obsoleting it +- Update bundled databases + +* Thu Jan 29 2015 Philip Prindeville - 1.6.4-1 +- Require geoipupdate per Paul + +* Tue Jan 20 2015 Philip Prindeville - 1.6.4-0 +- Version bump to 1.6.4 per bz #1158667 (okay, that bug was for 1.6.3) +- Remove geoipupdate as it will be moving into its own package + +* Fri Aug 15 2014 Fedora Release Engineering - 1.5.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Fri Jun 06 2014 Fedora Release Engineering - 1.5.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue Feb 25 2014 Paul Howarth - 1.5.1-4 +- Add %%check, so we can run tests by building using --with tests +- Update databases from upstream + +* Fri Aug 02 2013 Fedora Release Engineering - 1.5.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Tue Jun 18 2013 Paul Howarth - 1.5.1-2 +- 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 + +* Wed Jun 12 2013 Philip Prindeville - 1.5.1-1 +- Bump to version 1.5.1 +- Fix exit codes for various situations (MaxMind support #129155) +- Use versioned obsoletes/provides for geoip-geolite +- Update UTF8 patch +- Change symlink from GeoIP-initial.dat to GeoLiteCountry.dat if we had a + successful download and now have the latter file. + +* Mon Jun 10 2013 Philip Prindeville - 1.5.0-7 +- Annotate conflict with geoip-geolite package (#968074) * Mon Jun 10 2013 Paul Howarth - 1.5.0-6 - Update sub-package requires main package for geoipupdate script @@ -353,7 +376,7 @@ fi - New upstream release (minor fixes) * Mon May 1 2006 Michael Fleming 1.3.16-1 -- New upstream release +- New upstream release - Add INSTALL document to package. * Sat Feb 18 2006 Michael Fleming 1.3.14-3