From c099f8f17048d559a574a68b03f9ecfc1f946286 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 06:23:23 +0000 Subject: import GeoIP-1.5.0-11.el7 --- diff --git a/.GeoIP.metadata b/.GeoIP.metadata index 9c462ff..c7a7640 100644 --- a/.GeoIP.metadata +++ b/.GeoIP.metadata @@ -1 +1,7 @@ 09abf240ad4c4c3743113465d01b7c74b3140b9f SOURCES/GeoIP-1.5.0.tar.gz +33f8591f3c5a835cdde7c4f2a8f3ca410672a574 SOURCES/GeoIP.dat.gz +65bf38a1bef6121b3e230ea81c63a6e55c777e9d SOURCES/GeoIPASNum.dat.gz +2edb7344c32b78e6525d56674fb481e350033eaa SOURCES/GeoIPASNumv6.dat.gz +d024122356cb94bcc35019cf0232ddf1c4133e91 SOURCES/GeoIPv6.dat.gz +e7931b124c52c8ddf0b7c1df15d7189def2ff30b SOURCES/GeoLiteCity.dat.gz +60f5f6d278b407f8fdfbe1f390cb7a0d2e3cca9f SOURCES/GeoLiteCityv6.dat.gz diff --git a/.gitignore b/.gitignore index ed21239..abae301 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,7 @@ SOURCES/GeoIP-1.5.0.tar.gz +SOURCES/GeoIP.dat.gz +SOURCES/GeoIPASNum.dat.gz +SOURCES/GeoIPASNumv6.dat.gz +SOURCES/GeoIPv6.dat.gz +SOURCES/GeoLiteCity.dat.gz +SOURCES/GeoLiteCityv6.dat.gz diff --git a/SPECS/GeoIP.spec b/SPECS/GeoIP.spec index aa6e1bd..d3b813a 100644 --- a/SPECS/GeoIP.spec +++ b/SPECS/GeoIP.spec @@ -3,16 +3,23 @@ Name: GeoIP Version: 1.5.0 -Release: 9%{?dist} +Release: 11%{?dist} Summary: Library for country/city/organization to IP address or hostname mapping Group: Development/Libraries -License: LGPLv2+ and GPLv2+ +License: LGPLv2+ and GPLv2+ and CC-BY-SA 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 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu) BuildRequires: zlib-devel @@ -27,6 +34,9 @@ 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 update Summary: Crontab entry to facilitate automatic updates of databases Group: Applications/Databases @@ -39,6 +49,21 @@ BuildArch: noarch %description update Crontab entry to provide weekly updates of the GeoIP free databases. +%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. + +This package includes GeoLite data created by MaxMind, available from +http://www.maxmind.com/ + %package devel Summary: Development headers and libraries for GeoIP Group: Development/Libraries @@ -60,6 +85,18 @@ install -D -m644 %{SOURCE2} fetch-geoipdata-city.pl install -D -m644 %{SOURCE3} fetch-geoipdata.pl install -D -m644 %{SOURCE5} geoipupdate.cron +# 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 @@ -79,7 +116,7 @@ make %{?_smp_mflags} %install rm -rf %{buildroot} -make DESTDIR=%{buildroot} DEFAULT_DB_FILE="%{_datadir}/GeoIP/GeoIP-initial.dat" install +make DESTDIR=%{buildroot} install # fetch database updates weekly install -D -m755 geoipupdate.cron %{buildroot}%{_sysconfdir}/cron.weekly/geoipupdate @@ -94,13 +131,25 @@ sed -i \ -e 's/106$/506 533/' \ %{buildroot}%{_sysconfdir}/GeoIP.conf -# make the default GeoIP.dat a symlink to GeoIP-initial.dat, -# at least until %%post has run -ln -sf GeoIP-initial.dat %{buildroot}%{_datadir}/GeoIP/GeoIP.dat +# 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/GeoLite{ASNum,City,Country}.dat -chmod 644 %{buildroot}%{_datadir}/GeoIP/GeoLite{ASNum,City,Country}.dat +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 %clean rm -rf %{buildroot} @@ -109,6 +158,28 @@ rm -rf %{buildroot} %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 + + %files # LGPLv2+ %doc AUTHORS COPYING ChangeLog README TODO LICENSE* fetch-* @@ -118,10 +189,17 @@ rm -rf %{buildroot} %{_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 -%ghost %{_datadir}/GeoIP/GeoLiteASNum.dat -%ghost %{_datadir}/GeoIP/GeoLiteCity.dat -%ghost %{_datadir}/GeoIP/GeoLiteCountry.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* @@ -135,6 +213,12 @@ rm -rf %{buildroot} %files update %{_sysconfdir}/cron.weekly/geoipupdate +%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 @@ -146,6 +230,13 @@ rm -rf %{buildroot} %{_libdir}/libGeoIPUpdate.so %changelog +* 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