Compare commits

...
Sign in to create a new pull request.

47 commits

Author SHA1 Message Date
Paul Howarth
c5f6854232 Tidy up after merging PR for new vendoring guidelines
https://src.fedoraproject.org/rpms/geoipupdate/pull-request/1

 * Remove duplicate Name/Release/Summary tags
 * Remove use of tabs for whitespace consistency
 * Drop redundant %autopatch
 * Update rpmlintrc for new warnings
2025-10-20 13:36:05 +01:00
Robert-André Mauchin
60545ed742 Add Packit integration for maintenance 2025-10-19 09:20:44 +02:00
Robert-André Mauchin
a8733a47ed Convert to new vendoring guidelines 2025-10-19 09:20:42 +02:00
Alejandro Sáez
149658a686 rebuild 2025-10-10 13:18:58 +02:00
Maxwell G
1474e4588b Rebuild for golang-1.25.0 2025-08-15 14:38:55 -05:00
Fedora Release Engineering
9d526cea54 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-23 21:16:18 +00:00
Paul Howarth
17471191b6 Update to 7.1.1
- New upstream release 7.1.1
  - Update dependencies and re-build binaries with new Go version; no
    substantive changes
2025-07-11 12:33:41 +01:00
Fedora Release Engineering
68e339bb82 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-16 19:47:24 +00:00
Paul Howarth
56d0f43fab Update to 7.1.0
- New upstream release 7.1.0
  - Allow the 'Host' configuration directive and the 'GEOIPUPDATE_HOST'
    environment variable to accept a value with the scheme set; if not set, it
    will continue to default to 'https://' (GH#310)
  - Export 'HTTPError' to enable fine-grained error handling for users of
    'github.com/maxmind/geoipupdate/client' (GH#341)
2024-11-19 08:40:55 +00:00
Fedora Release Engineering
4d9987523b Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-18 00:27:04 +00:00
Paul Howarth
93ae7046db Update to 7.0.1
- New upstream release 7.0.1
  - BREAKING CHANGE: Improvements to the HTTP download API
    - The client now calls two new endpoints:
      - '/geoip/updates/metadata', which is responsible for getting information
        about a database edition
      - '/geoip/databases/{edition-id}/download', which is responsible for
        downloading the content of a database edition; this new endpoint
        redirects downloads to R2 presigned URLs, so systems running
        'geoipupdate' need to be able to reach
        'mm-prod-geoip-databases.a2649acb697e2c09b632799562c076f2.r2.cloudflarestorage.com'
        in addition to 'updates.maxmind.com'
  - BREAKING CHANGE: The public package API has been redesigned
    - The previous API was not easy to use and had become a maintenance burden
    - We now expose a 'Client' at 'github.com/maxmind/geoipupdate/client' with
      a 'Download()' method
    - The intention is to expose less of the 'geoipupdate' internals and
      provide a simpler and easier to use package; many previously exposed
      methods and types are now either internal only or have been removed
  - BREAKING CHANGE: If set, 'GEOIPUPDATE_VERBOSE' must either be '0' or '1'
    - All other values will return an error
  - Setting 'GEOIPUPDATE_VERBOSE' to '1' now works as expected; in the 6.0.0
    and 6.1.0 releases, the flag was ignored (GH#298)
  - 'geoipupdate' now supports retrying on more types of errors such as HTTP2
    INTERNAL_ERROR
  - Now 'geoipupdate' doesn't require the user to specify the config file if
    all the other arguments are set via the environment variables (GH#284)
2024-04-09 10:11:37 +01:00
Maxwell G
e40aad9100
Rebuild for golang 1.22.0 2024-02-11 22:04:38 +00:00
Fedora Release Engineering
9600e47d39 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-24 12:47:38 +00:00
Fedora Release Engineering
be45c4b3ac Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-19 20:32:22 +00:00
Paul Howarth
05db224588 Update to 6.1.0
- New upstream release 6.1.0
  - 'geoipupdate' now sets the version in the 'User-Agent' header to the
    version in the binary; while there were no issues with the version in the
    header, this makes sure it will match the binary (the header also now
    includes build information, such as OS and architecture)
  - White spaces in secret files 'GEOIPUPDATE_ACCOUNT_ID_FILE',
    'GEOIPUPDATE_LICENSE_KEY_FILE' are ignored (GH#262)
2024-01-10 14:47:32 +00:00
Paul Howarth
73feb196e2 Update to 6.0.0
- New upstream release 6.0.0
  - 'geoipupdate' now supports configuration via environment variables: any
    configuration set this way will override any value from the config file,
    but still be overridden by any associated command line option (if any)
  - The following new environment variables are supported:
    - GEOIPUPDATE_ACCOUNT_ID
    - GEOIPUPDATE_ACCOUNT_ID_FILE
    - GEOIPUPDATE_CONF_FILE
    - GEOIPUPDATE_DB_DIR
    - GEOIPUPDATE_EDITION_IDS
    - GEOIPUPDATE_HOST
    - GEOIPUPDATE_LICENSE_KEY
    - GEOIPUPDATE_LICENSE_KEY_FILE
    - GEOIPUPDATE_LOCK_FILE
    - GEOIPUPDATE_PARALLELISM
    - GEOIPUPDATE_PRESERVE_FILE_TIMES
    - GEOIPUPDATE_PROXY
    - GEOIPUPDATE_PROXY_USER_PASSWORD
    - GEOIPUPDATE_RETRY_FOR
    - GEOIPUPDATE_VERBOSE
  - Changed the signature of 'NewConfig' in 'pkg/geoipupdate' to no longer
    accept a positional config file path argument, which can now be passed in
    using the option from 'WithConfigFile' along with the other optional
    parameters
  - 'geoipupdate' and 'NewConfig' no longer require a config file to exist
  - The '--stack-trace' flag has been removed; this flag has been broken since
    4.11.0
2023-07-20 14:52:46 +01:00
Fedora Release Engineering
8036e7601b Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-19 21:04:30 +00:00
Paul Howarth
dfe545e6af Update to 5.1.1
- New upstream release 5.1.1
  - Fixed the Docker health-check script to use the correct time of the last
    update attempt (GH#225)
  - Added new '--output' flag to print JSON to standard output describing the
    result of the run
  - Compilation with Go versions before 1.19 is no longer supported
2023-05-11 11:35:48 +01:00
Paul Howarth
c5587ab28e Update to 5.0.4
- New upstream release 5.0.4
  - The 5.0.0 release mistakenly set the file permissions on downloaded
    databases to 0600; this restores the previous behavior of using 0644
    (GH#217, GH#218)
  - "Database ... up to date" messages are now only shown if the verbose flag
    is set (GH#219)
  - Since version 5.0.0, the default database directory was not being correctly
    set for Debian and RPM package builds -  the directory
    '/usr/local/share/GeoIP' was being used rather than '/usr/share/GeoIP';
    this build restores '/usr/share/GeoIP' as the default directory for these
    builds (GH#222)
  - Since version 4.9.0, the incorrect commit was tagged; this release attempts
    to fix the release process to prevent this issue
2023-04-19 09:48:51 +01:00
Paul Howarth
648ef7e821 Update to 5.0.0
- New upstream release 5.0.0
  - Redefined the 'Reader' and 'Writer' interface APIs in
    'pkg/geoipupdate/database'; this change aims to to make it easier to
    introduce custom implementations of these interfaces
  - Changed the signature of 'NewConfig' in 'pkg/geoipupdate' to accept
    optional parameters; this change allows the introduction of new flags or
    config options without making breaking changes to the function's signature
  - Introduced 'Parallelism' as a new flag and config option to enable
    concurrent database updates
2023-04-13 14:00:24 +01:00
Paul Howarth
6a51f2bb83 Update to 4.11.1
- New upstream release 4.11.1
  - 'github.com/pkg/errors' is no longer used to wrap errors
  - Docker secrets are now supported for the MaxMind account ID and license
    key (GH#197)
  - The Dockerfile now has a Healthcheck that makes sure the modification date
    of the database directory is within the update period
  - The Docker images are now published to the GitHub Container Registry,
    'ghcr.io'; we will likely stop publishing to Docker Hub in the near future
2023-03-17 10:38:48 +00:00
Fedora Release Engineering
8b196bad29 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-19 04:38:38 +00:00
Paul Howarth
2b71005535 Update to 4.10.0
- New upstream release 4.10.0
  - HTTPS proxies are now supported (GH#172)
  - An HTTP request to get the filename for the edition ID has been removed;
    this was previously required as the GeoIP Legacy edition IDs bore little
    relation to the name of the database on disk
- Use SPDX-format license tag
2022-09-27 09:50:15 +01:00
Fedora Release Engineering
9c5486e743 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-21 04:23:32 +00:00
Maxwell G
5b622338f8
Rebuild for CVE-2022-{1705,32148,30631,30633,28131,30635,30632,30630,1962} in golang 2022-07-19 13:55:02 -05:00
Robert-André Mauchin
b7219dd05f Rebuilt for CVE-2022-1996, CVE-2022-24675, CVE-2022-28327, CVE-2022-27191, CVE-2022-29526, CVE-2022-30629 2022-06-18 10:58:03 +02:00
Robert-André Mauchin
0f047593bd Rebuilt for CVE-2022-1996, CVE-2022-24675, CVE-2022-28327, CVE-2022-27191, CVE-2022-29526, CVE-2022-30629 2022-06-17 22:31:50 +02:00
Paul Howarth
fd7ae0e5ba Update to 4.9.0
- New upstream release 4.9.0
  - The client now sets the User-Agent header
  - The error handling has been improved
2022-02-16 09:36:31 +00:00
Fedora Release Engineering
f57ba7a128 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 04:12:33 +00:00
Fedora Release Engineering
fa8fbee239 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-22 00:02:16 +00:00
Paul Howarth
a51a89139a Update to 4.8.0
- New upstream release 4.8.0
  - Go 1.13 or greater is now required
  - In verbose mode, we now print a message before each HTTP request; previously
    we would not print anything for retried requests
  - Expected response errors no longer cause request retries; for example, we no
    longer retry the download request if the database subscription has lapsed
2021-07-21 14:25:39 +01:00
Fedora Release Engineering
37c33eda21 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 06:35:49 +00:00
Paul Howarth
27710cf70d Update to 4.6.0
- New upstream release 4.6.0
  - Show version number in verbose output
  - Retry downloads in more scenarios: previously we would not retry failures
    occurring when reading the response body, but now we do
2020-12-15 11:05:56 +00:00
Paul Howarth
ed4530d00c Update to 4.5.0
- New upstream release 4.5.0
  - The edition ID is now included when there is a failure retrieving a
    database
  - The Docker image no longer prints the generated GeoIP.conf when starting
    up, which prevents a possible leak of the account's license key (GH#109)
  - The minimum Go version is now 1.11
  - Failing HTTP requests are now retried using an exponential backoff: the
    period to keep retrying any failed request is set to 5 minutes by default
    and can be adjusted using the new RetryFor configuration option
  - When using the go package rather than the command-line tool, the default
    value for RetryFor will be 0 seconds, which means no retries will be
    performed: to change that, set RetryFor explicitly in the Config you
    provide, or obtain your Config value via geoipupdate.NewConfig
2020-10-29 15:36:37 +00:00
Fedora Release Engineering
ce662a7efd - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-27 18:30:43 +00:00
Paul Howarth
75b62872d8 Update to 4.3.0
- New upstream release 4.3.0
  - First release to Docker Hub (GH#24)
  - The binary builds are now built with CGO_ENABLED=0 (GH#63)
2020-04-17 10:10:40 +01:00
Paul Howarth
0121d95bc5 Update to 4.2.2
- New upstream release 4.2.2
  - The major version of the module is now included at the end of the module
    path; previously, it was not possible to import the module in projects that
    were using Go modules (GH#81)
  - A valid account ID and license key combination is now required for database
    downloads, so those configuration options are now required
  - The error handling when closing a local database file would previously
    ignore errors and, upon upgrading to 'github.com/pkg/errors' 0.9.0, would
    fail to ignore expected errors (GH#69, GH#70)
  - The RPM release was previously lacking the correct owner and group on files
    and directories: among other things, this caused the package to conflict
    with the 'GeoIP' package in CentOS 7 and 'GeoIP-GeoLite-data' in CentOS 8;
    the files are now owned by 'root' (GH#76)
2020-02-24 15:39:51 +00:00
Fedora Release Engineering
a4d9866f60 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-28 19:54:45 +00:00
Paul Howarth
ed11ffa9d3 Update to 4.1.5
- New uostream release 4.1.5
  - Respect the defaultConfigFile and defaultDatabaseDirectory variables in the
    main package again; they were ignored in 4.1.0 through 4.1.4 (if not
    specified, the GitHub and PPA releases for these versions used the config
    /usr/local/etc/GeoIP.conf instead of /etc/GeoIP.conf and the database
    directory /usr/local/share/GeoIP instead of /usr/share/GeoIP)
2019-11-10 11:33:49 +00:00
Paul Howarth
f39a876d59 Update to 4.1.4
- New upstream release 4.1.4
  - Improve man page formatting and organization (GH#44)
  - Provide update functionality as an importable package as well as a
    standalone program (GH#48)
  - Remove formatting, linting, and testing from the geoipupdate target in the
    Makefile
2019-11-08 13:07:30 +00:00
Paul Howarth
fce6705236 Update to 4.0.6
- New upstream release 4.0.6
  - Ignore errors when syncing file system: these errors were primarily due to
    the file system not supporting the sync call (GH#37)
  - Use CRLF line endings on Windows for text files
  - Fix tests on Windows
  - Improve man page formatting (GH#38)
  - Dependencies are no longer vendored (GH#39)
2019-09-14 15:32:07 +01:00
Paul Howarth
34f862e647 Update to 4.0.4
- New upstream release 4.0.4
  - Do not try to sync the database directory when running on Windows; syncing
    this way is not supported there and would lead to an error (GH#32)
2019-09-01 15:02:19 +01:00
Fedora Release Engineering
cb8e54db9d - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 01:46:38 +00:00
Elliott Sales de Andrade
31b7c702fb Update to latest Go macros. 2019-07-13 01:51:24 -04:00
Paul Howarth
fc0d813fbb Update to 4.0.3
- New upstream release 4.0.3
  - Update flock dependency from 'theckman/go-flock' to 'gofrs/flock' (GH#22)
  - Switch to Go modules and update dependencies
  - Fix version output on Ubuntu PPA and Homebrew releases
- Revert switch to Go Modules as our tooling isn't ready for that yet
2019-06-10 19:59:08 +01:00
Fedora Release Engineering
05edf83dfa - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-01-31 20:51:25 +00:00
Paul Howarth
436ffbc038 Update to 4.0.2
- New upstream release 4.0.2
  - Completely rewritten in the go language
  - New version licensed ASL 2.0 or MIT rather than GPLv2
- Legacy databases no longer available, so drop/obsolete the cron6
  sub-package
2019-01-20 10:46:30 +00:00
7 changed files with 458 additions and 117 deletions

23
.gitignore vendored
View file

@ -6,3 +6,26 @@
/geoipupdate-2.5.0.tar.gz
/geoipupdate-3.1.0.tar.gz
/geoipupdate-3.1.1.tar.gz
/geoipupdate-4.0.2.tar.gz
/geoipupdate-4.0.3.tar.gz
/geoipupdate-4.0.4.tar.gz
/geoipupdate-4.0.6.tar.gz
/geoipupdate-4.1.4.tar.gz
/geoipupdate-4.1.5.tar.gz
/geoipupdate-4.2.2.tar.gz
/geoipupdate-4.3.0.tar.gz
/geoipupdate-4.5.0.tar.gz
/geoipupdate-4.6.0.tar.gz
/geoipupdate-4.8.0.tar.gz
/geoipupdate-4.9.0.tar.gz
/geoipupdate-4.10.0.tar.gz
/geoipupdate-4.11.1.tar.gz
/geoipupdate-5.0.0.tar.gz
/geoipupdate-5.0.4.tar.gz
/geoipupdate-5.1.1.tar.gz
/geoipupdate-6.0.0.tar.gz
/geoipupdate-6.1.0.tar.gz
/geoipupdate-7.0.1.tar.gz
/geoipupdate-7.1.0.tar.gz
/geoipupdate-7.1.1.tar.gz
/geoipupdate-7.1.1-vendor.tar.bz2

35
.packit.yaml Normal file
View file

@ -0,0 +1,35 @@
specfile_path: geoipupdate.spec
upstream_package_name: geoipupdate
upstream_project_url: https://github.com/maxmind/geoipupdate
downstream_package_name: geoipupdate
upstream_tag_template: v{version}
jobs:
- job: pull_from_upstream
trigger: release
dist_git_branches:
- rawhide
- job: koji_build
trigger: commit
dist_git_branches:
- rawhide
actions:
post-modifications:
# https://fedora.gitlab.io/sigs/go/go-vendor-tools/scenarios/#manual-update
- |
sh -xeuc "
cd $PACKIT_DOWNSTREAM_REPO
export GOTOOLCHAIN=auto
go_vendor_archive create --config go-vendor-tools.toml geoipupdate.spec
go_vendor_license \
--config go-vendor-tools.toml \
--path geoipupdate.spec \
report \
--verify-spec
"
create_sync_note: false

View file

@ -1,12 +1,16 @@
from Config import *
# Documentation for cron packages is the package %description
addFilter("no-documentation")
# Cron scripts can be edited by end users
addFilter("executable-marked-as-config-file /etc/cron.weekly/geoipupdate")
# Technical term
addFilter("spelling-error Summary\(en_US\) Cron -> ")
addFilter("spelling-error %description -l en_US Cron -> ")
# geoipupdate-cron6 is obsolete (upstream stopped providing free IPv6 databases) and not replaced
addFilter("obsolete-not-provided geoipupdate-cron6")
# Consequence of vendoring dependencies
addFilter("invalid-url Source1: geoipupdate-.*-vendor.tar.bz2")
# Nobody will ever have separate filesystems for subdirectories here
addFilter("cross-directory-hard-link /usr/share/licenses/geoipupdate/vendor/.*/LICENSE /usr/share/licenses/geoipupdate/vendor/.*/LICENSE")
addFilter("cross-directory-hard-link /usr/share/licenses/geoipupdate/vendor/.*/PATENTS /usr/share/licenses/geoipupdate/vendor/.*/PATENTS")

View file

@ -1,104 +1,411 @@
%global _hardened_build 1
# Generated by go2rpm 1.18.0
%bcond check 1
Name: geoipupdate
Version: 3.1.1
Release: 1%{?dist}
Summary: Update GeoIP2 and GeoIP Legacy binary databases from MaxMind
License: GPLv2
URL: http://dev.maxmind.com/geoip/geoipupdate/
Source0: http://github.com/maxmind/geoipupdate/releases/download/v%{version}/geoipupdate-%{version}.tar.gz
Source1: geoipupdate.cron
Source2: geoipupdate6.cron
BuildRequires: coreutils
BuildRequires: gcc
BuildRequires: libcurl-devel
BuildRequires: make
BuildRequires: zlib-devel
# Perl modules used by IPv6 cron script
BuildRequires: perl-generators
BuildRequires: perl(File::Copy)
BuildRequires: perl(File::Spec)
BuildRequires: perl(LWP::Simple)
BuildRequires: perl(PerlIO::gzip)
BuildRequires: perl(strict)
# https://github.com/maxmind/geoipupdate
%global goipath github.com/maxmind/geoipupdate/v7
Version: 7.1.1
%gometa -L -f
Name: geoipupdate
Release: 5%{?dist}
Summary: Update GeoIP2 binary databases from MaxMind
# Generated by go-vendor-tools
License: Apache-2.0 AND BSD-3-Clause AND ISC AND MIT
URL: %{gourl}
Source0: %{gosource}
# Generated by go-vendor-tools
Source1: %{archivename}-vendor.tar.bz2
Source2: go-vendor-tools.toml
Source3: geoipupdate.cron
BuildRequires: coreutils
BuildRequires: crontabs
BuildRequires: go-vendor-tools
BuildRequires: make
BuildRequires: pandoc
BuildRequires: perl-interpreter
BuildRequires: perl(File::Temp)
BuildRequires: perl(strict)
BuildRequires: perl(warnings)
BuildRequires: sed
# Legacy databases fetched by cron6 sub-package no longer available
Obsoletes: geoipupdate-cron6 < %{version}-%{release}
%description
The GeoIP Update program performs automatic updates of GeoIP2 and GeoIP
Legacy binary databases.
The GeoIP Update program performs automatic updates of GeoIP2 binary databases.
%package cron
Summary: Cron job to do weekly updates of GeoIP databases
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: crontabs
Obsoletes: GeoIP-update < 1.6.0
Provides: GeoIP-update = 1.6.0
Summary: Cron job to do weekly updates of GeoIP databases
BuildArch: noarch
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: crontabs
Obsoletes: GeoIP-update < 1.6.0
Provides: GeoIP-update = 1.6.0
%description cron
Cron job for weekly updates to GeoIP Legacy database from MaxMind.
%package cron6
Summary: Cron job to do weekly updates of GeoIP IPv6 databases
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: crontabs
Requires: wget
Obsoletes: GeoIP-update6 < 1.6.0
Provides: GeoIP-update6 = 1.6.0
%description cron6
Cron job for weekly updates to GeoIP IPv6 Legacy database from MaxMind.
Cron job for weekly updates to GeoIP2 binary databases from MaxMind.
%prep
%setup -q
%goprep -A
%setup -q -T -D -a1 %{forgesetupargs}
%generate_buildrequires
%go_vendor_license_buildrequires -c %{S:2}
%build
%configure --disable-static --disable-dependency-tracking
make %{?_smp_mflags}
%global gomodulesmode GO111MODULE=on
export LDFLAGS='-X main.defaultConfigFile=%{_sysconfdir}/GeoIP.conf -X main.defaultDatabaseDirectory=%{_datadir}/GeoIP '
%gobuild -o %{gobuilddir}/bin/geoipupdate %{goipath}/cmd/geoipupdate
# Work around hardcoded "build" path in dev-bin/make-man-pages.pl
ln -s %{gobuilddir} build
# Prepare the config files and documentation
make BUILDDIR=%{gobuilddir} CONFFILE=%{_sysconfdir}/GeoIP.conf DATADIR=%{_datadir}/GeoIP data
%install
make install DESTDIR=%{buildroot}
%go_vendor_license_install -c %{S:2}
install -m 0755 -vd %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
# We'll package the documentation ourselves
rm -rf %{buildroot}%{_datadir}/doc/geoipupdate
# Install the configuration file
# By default we just use the free GeoIP2 databases
install -m 0755 -vd %{buildroot}%{_sysconfdir}
install -m 0644 -vp conf/GeoIP.conf.default %{buildroot}%{_sysconfdir}/GeoIP.conf
# Fix up the config file to have geoipupdate fetch the free legacy databases by default
sed -i -e 's/^\(ProductIds\) .*$/\1 506 517 533/' \
%{buildroot}%{_sysconfdir}/GeoIP.conf
# Ensure the GeoIP data directory exists
# Note: not using %%ghost files for default databases to avoid issues when co-existing with the geolite2 package
install -m 0755 -vd %{buildroot}%{_datadir}/GeoIP
install -D -m 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/cron.weekly/geoipupdate
install -D -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/cron.weekly/geoipupdate6
# Install the cron script for fetching weekly updates
install -m 0755 -vd %{buildroot}%{_sysconfdir}/cron.weekly
install -m 0755 -vp %{S:3} %{buildroot}%{_sysconfdir}/cron.weekly/geoipupdate
# Make the download directory for the IPv6 data cron job and some ghost files
mkdir -p %{buildroot}%{_datadir}/GeoIP/download/
: > %{buildroot}%{_datadir}/GeoIP/download/GeoIPv6.dat.gz
: > %{buildroot}%{_datadir}/GeoIP/download/GeoLiteCityv6.dat.gz
: > %{buildroot}%{_datadir}/GeoIP/download/GeoIPASNumv6.dat.gz
# Install the manpages
install -m 0755 -vd %{buildroot}%{_mandir}/man1
install -m 0644 -vp _build/geoipupdate.1 %{buildroot}%{_mandir}/man1/geoipupdate.1
install -m 0755 -vd %{buildroot}%{_mandir}/man5
install -m 0644 -vp _build/GeoIP.conf.5 %{buildroot}%{_mandir}/man5/GeoIP.conf.5
%files
%if 0%{?_licensedir:1}
%license LICENSE
%else
%doc LICENSE
%check
%go_vendor_license_check -c %{S:2}
%if %{with check}
%gotest ./...
%endif
%doc conf/GeoIP.conf.default README.md ChangeLog.md
%config(noreplace) %{_sysconfdir}/GeoIP.conf
%files -f %{go_vendor_license_filelist}
%license vendor/modules.txt
%doc doc CHANGELOG.md README.dev.md README.md
%{_bindir}/geoipupdate
%config(noreplace) %{_sysconfdir}/GeoIP.conf
%dir %{_datadir}/GeoIP/
%{_mandir}/man1/geoipupdate.1*
%{_mandir}/man5/GeoIP.conf.5*
%files cron
%config(noreplace) %{_sysconfdir}/cron.weekly/geoipupdate
%files cron6
%config(noreplace) %{_sysconfdir}/cron.weekly/geoipupdate6
%dir %{_datadir}/GeoIP/
%dir %{_datadir}/GeoIP/download/
%ghost %{_datadir}/GeoIP/download/GeoIPv6.dat.gz
%ghost %{_datadir}/GeoIP/download/GeoLiteCityv6.dat.gz
%ghost %{_datadir}/GeoIP/download/GeoIPASNumv6.dat.gz
%changelog
* Sun Oct 19 2025 Robert-André Mauchin <eclipseo@mauchin.fr> - 7.1.1-5
- Convert to new vendoring guidelines
* Fri Oct 10 2025 Alejandro Sáez <asm@redhat.com> - 7.1.1-4
- Rebuild
* Fri Aug 15 2025 Maxwell G <maxwell@gtmx.me> - 7.1.1-3
- Rebuild for golang-1.25.0
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 7.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Fri Jul 11 2025 Paul Howarth <paul@city-fan.org> - 7.1.1-1
- Update to 7.1.1
- Update dependencies and re-build binaries with new Go version; no
substantive changes
* Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 7.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Tue Nov 19 2024 Paul Howarth <paul@city-fan.org> - 7.1.0-1
- Update to 7.1.0
- Allow the 'Host' configuration directive and the 'GEOIPUPDATE_HOST'
environment variable to accept a value with the scheme set; if not set, it
will continue to default to 'https://' (GH#310)
- Export 'HTTPError' to enable fine-grained error handling for users of
'github.com/maxmind/geoipupdate/client' (GH#341)
* Thu Jul 18 2024 Fedora Release Engineering <releng@fedoraproject.org> - 7.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Tue Apr 9 2024 Paul Howarth <paul@city-fan.org> - 7.0.1-1
- Update to 7.0.1
BREAKING CHANGE: Improvements to the HTTP download API
- The client now calls two new endpoints:
- '/geoip/updates/metadata', which is responsible for getting information
about a database edition
- '/geoip/databases/{edition-id}/download', which is responsible for
downloading the content of a database edition; this new endpoint
redirects downloads to R2 presigned URLs, so systems running
'geoipupdate' need to be able to reach
'mm-prod-geoip-databases.a2649acb697e2c09b632799562c076f2.r2.cloudflarestorage.com'
in addition to 'updates.maxmind.com'
BREAKING CHANGE: The public package API has been redesigned
- The previous API was not easy to use and had become a maintenance burden
- We now expose a 'Client' at 'github.com/maxmind/geoipupdate/client' with a
'Download()' method
- The intention is to expose less of the 'geoipupdate' internals and provide
a simpler and easier to use package; many previously exposed methods and
types are now either internal only or have been removed
BREAKING CHANGE: If set, 'GEOIPUPDATE_VERBOSE' must either be '0' or '1';
all other values will return an error
- Setting 'GEOIPUPDATE_VERBOSE' to '1' now works as expected; in the 6.0.0
and 6.1.0 releases, the flag was ignored (GH#298)
- 'geoipupdate' now supports retrying on more types of errors such as HTTP2
INTERNAL_ERROR
- Now 'geoipupdate' doesn't require the user to specify the config file if
all the other arguments are set via the environment variables (GH#284)
* Sun Feb 11 2024 Maxwell G <maxwell@gtmx.me> - 6.1.0-4
- Rebuild for golang 1.22.0
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 6.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 6.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Jan 10 2024 Paul Howarth <paul@city-fan.org> - 6.1.0-1
- Update to 6.1.0
- 'geoipupdate' now sets the version in the 'User-Agent' header to the
version in the binary; while there were no issues with the version in the
header, this makes sure it will match the binary (the header also now
includes build information, such as OS and architecture)
- White spaces in secret files 'GEOIPUPDATE_ACCOUNT_ID_FILE',
'GEOIPUPDATE_LICENSE_KEY_FILE' are ignored (GH#262)
* Thu Jul 20 2023 Paul Howarth <paul@city-fan.org> - 6.0.0-1
- Update to 6.0.0
- 'geoipupdate' now supports configuration via environment variables: any
configuration set this way will override any value from the config file,
but still be overridden by any associated command line option (if any)
- The following new environment variables are supported:
- GEOIPUPDATE_ACCOUNT_ID
- GEOIPUPDATE_ACCOUNT_ID_FILE
- GEOIPUPDATE_CONF_FILE
- GEOIPUPDATE_DB_DIR
- GEOIPUPDATE_EDITION_IDS
- GEOIPUPDATE_HOST
- GEOIPUPDATE_LICENSE_KEY
- GEOIPUPDATE_LICENSE_KEY_FILE
- GEOIPUPDATE_LOCK_FILE
- GEOIPUPDATE_PARALLELISM
- GEOIPUPDATE_PRESERVE_FILE_TIMES
- GEOIPUPDATE_PROXY
- GEOIPUPDATE_PROXY_USER_PASSWORD
- GEOIPUPDATE_RETRY_FOR
- GEOIPUPDATE_VERBOSE
- Changed the signature of 'NewConfig' in 'pkg/geoipupdate' to no longer
accept a positional config file path argument, which can now be passed in
using the option from 'WithConfigFile' along with the other optional
parameters
- 'geoipupdate' and 'NewConfig' no longer require a config file to exist
- The '--stack-trace' flag has been removed; this flag has been broken since
4.11.0
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 5.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu May 11 2023 Paul Howarth <paul@city-fan.org> - 5.1.1-1
- Update to 5.1.1
- Fixed the Docker health-check script to use the correct time of the last
update attempt (GH#225)
- Added new '--output' flag to print JSON to standard output describing the
result of the run
- Compilation with Go versions before 1.19 is no longer supported
* Wed Apr 19 2023 Paul Howarth <paul@city-fan.org> - 5.0.4-1
- Update to 5.0.4
- The 5.0.0 release mistakenly set the file permissions on downloaded
databases to 0600; this restores the previous behavior of using 0644
(GH#217, GH#218)
- "Database ... up to date" messages are now only shown if the verbose flag
is set (GH#219)
- Since version 5.0.0, the default database directory was not being correctly
set for Debian and RPM package builds - the directory
'/usr/local/share/GeoIP' was being used rather than '/usr/share/GeoIP';
this build restores '/usr/share/GeoIP' as the default directory for these
builds (GH#222)
- Since version 4.9.0, the incorrect commit was tagged; this release attempts
to fix the release process to prevent this issue
* Thu Apr 13 2023 Paul Howarth <paul@city-fan.org> - 5.0.0-1
- Update to 5.0.0
- Redefined the 'Reader' and 'Writer' interface APIs in
'pkg/geoipupdate/database'; this change aims to to make it easier to
introduce custom implementations of these interfaces
- Changed the signature of 'NewConfig' in 'pkg/geoipupdate' to accept
optional parameters; this change allows the introduction of new flags or
config options without making breaking changes to the function's signature
- Introduced 'Parallelism' as a new flag and config option to enable
concurrent database updates
* Fri Mar 17 2023 Paul Howarth <paul@city-fan.org> - 4.11.1-1
- Update to 4.11.1
- 'github.com/pkg/errors' is no longer used to wrap errors
- Docker secrets are now supported for the MaxMind account ID and license
key (GH#197)
- The Dockerfile now has a Healthcheck that makes sure the modification date
of the database directory is within the update period
- The Docker images are now published to the GitHub Container Registry,
'ghcr.io'; we will likely stop publishing to Docker Hub in the near future
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 4.10.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Sep 27 2022 Paul Howarth <paul@city-fan.org> - 4.10.0-1
- Update to 4.10.0
- HTTPS proxies are now supported (GH#172)
- An HTTP request to get the filename for the edition ID has been removed;
this was previously required as the GeoIP Legacy edition IDs bore little
relation to the name of the database on disk
- Use SPDX-format license tag
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.9.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Tue Jul 19 2022 Maxwell G <gotmax@e.email> - 4.9.0-3
- Rebuild for CVE-2022-{1705,32148,30631,30633,28131,30635,30632,30630,1962} in
golang
* Fri Jun 17 2022 Robert-André Mauchin <zebob.m@gmail.com> - 4.9.0-2
- Rebuilt for CVE-2022-1996, CVE-2022-24675, CVE-2022-28327, CVE-2022-27191,
CVE-2022-29526, CVE-2022-30629
* Wed Feb 16 2022 Paul Howarth <paul@city-fan.org> - 4.9.0-1
- Update to 4.9.0
- The client now sets the User-Agent header
- The error handling has been improved
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.8.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.8.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Wed Jul 21 2021 Paul Howarth <paul@city-fan.org> - 4.8.0-1
- Update to 4.8.0
- Go 1.13 or greater is now required
- In verbose mode, we now print a message before each HTTP request; previously
we would not print anything for retried requests
- Expected response errors no longer cause request retries; for example, we no
longer retry the download request if the database subscription has lapsed
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.6.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Dec 15 2020 Paul Howarth <paul@city-fan.org> - 4.6.0-1
- Update to 4.6.0
- Show version number in verbose output
- Retry downloads in more scenarios: previously we would not retry failures
occurring when reading the response body, but now we do
* Thu Oct 29 2020 Paul Howarth <paul@city-fan.org> - 4.5.0-1
- Update to 4.5.0
- The edition ID is now included when there is a failure retrieving a
database
- The Docker image no longer prints the generated GeoIP.conf when starting
up, which prevents a possible leak of the account's license key (GH#109)
- The minimum Go version is now 1.11
- Failing HTTP requests are now retried using an exponential backoff: the
period to keep retrying any failed request is set to 5 minutes by default
and can be adjusted using the new RetryFor configuration option
- When using the go package rather than the command-line tool, the default
value for RetryFor will be 0 seconds, which means no retries will be
performed: to change that, set RetryFor explicitly in the Config you
provide, or obtain your Config value via geoipupdate.NewConfig
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Apr 17 2020 Paul Howarth <paul@city-fan.org> - 4.3.0-1
- Update to 4.3.0
- First release to Docker Hub (GH#24)
- The binary builds are now built with CGO_ENABLED=0 (GH#63)
* Mon Feb 24 2020 Paul Howarth <paul@city-fan.org> - 4.2.2-1
- Update to 4.2.2
- The major version of the module is now included at the end of the module
path; previously, it was not possible to import the module in projects that
were using Go modules (GH#81)
- A valid account ID and license key combination is now required for database
downloads, so those configuration options are now required
- The error handling when closing a local database file would previously
ignore errors and, upon upgrading to 'github.com/pkg/errors' 0.9.0, would
fail to ignore expected errors (GH#69, GH#70)
- The RPM release was previously lacking the correct owner and group on files
and directories: among other things, this caused the package to conflict
with the 'GeoIP' package in CentOS 7 and 'GeoIP-GeoLite-data' in CentOS 8;
the files are now owned by 'root' (GH#76)
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sun Nov 10 2019 Paul Howarth <paul@city-fan.org> - 4.1.5-1
- Update to 4.1.5
- Respect the defaultConfigFile and defaultDatabaseDirectory variables in the
main package again; they were ignored in 4.1.0 through 4.1.4 (if not
specified, the GitHub and PPA releases for these versions used the config
/usr/local/etc/GeoIP.conf instead of /etc/GeoIP.conf and the database
directory /usr/local/share/GeoIP instead of /usr/share/GeoIP)
* Fri Nov 8 2019 Paul Howarth <paul@city-fan.org> - 4.1.4-1
- Update to 4.1.4
- Improve man page formatting and organization (GH#44)
- Provide update functionality as an importable package as well as a
standalone program (GH#48)
- Remove formatting, linting, and testing from the geoipupdate target in the
Makefile
* Sat Sep 14 2019 Paul Howarth <paul@city-fan.org> - 4.0.6-1
- Update to 4.0.6
- Ignore errors when syncing file system: these errors were primarily due to
the file system not supporting the sync call (GH#37)
- Use CRLF line endings on Windows for text files
- Fix tests on Windows
- Improve man page formatting (GH#38)
- Dependencies are no longer vendored (GH#39)
* Sun Sep 1 2019 Paul Howarth <paul@city-fan.org> - 4.0.4-1
- Update to 4.0.4
- Do not try to sync the database directory when running on Windows; syncing
this way is not supported there and would lead to an error (GH#32)
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Jul 12 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 4.0.3-2
- Update to latest Go macros
* Mon Jun 10 2019 Paul Howarth <paul@city-fan.org> - 4.0.3-1
- Update to 4.0.3
- Update flock dependency from 'theckman/go-flock' to 'gofrs/flock' (GH#22)
- Switch to Go modules and update dependencies
- Fix version output on Ubuntu PPA and Homebrew releases
- Revert switch to Go Modules as our tooling isn't ready for that yet
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jan 18 2019 Paul Howarth <paul@city-fan.org> - 4.0.2-1
- Update to 4.0.2
- Completely rewritten in the go language
- New version licensed ASL 2.0 or MIT rather than GPLv2
- Legacy databases no longer available, so drop/obsolete the cron6
sub-package
* Tue Sep 11 2018 Paul Howarth <paul@city-fan.org> - 3.1.1-1
- Update to 3.1.1
- Allow parsing of license keys longer than 12 characters

View file

@ -1,37 +0,0 @@
#!/usr/bin/perl
# This script is based on geolite-mirror-simple.pl from Maxmind's Geo::IP perl module
use strict;
our $VERSION = '0.01';
use LWP::Simple qw/ mirror RC_NOT_MODIFIED RC_OK $ua /;
use File::Copy qw/ mv /;
use File::Spec;
use PerlIO::gzip;
# Make sure the directories exist
-d ( my $download_dir = '/usr/share/GeoIP/download' ) or die $!;
-d ( my $dest_dir = '/usr/share/GeoIP' ) or die $!;
my %mirror = ( # local-filename geolite-name
'GeoIPv6.dat.gz' => 'http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz',
'GeoLiteCityv6.dat.gz' => 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz',
'GeoIPASNumv6.dat.gz' => 'http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz'
);
$ua->agent("geoipupdate6.cron/$VERSION");
chdir $download_dir or die $!;
for my $f ( keys %mirror ) {
my $rc = mirror( $mirror{$f}, $f );
next if $rc == RC_NOT_MODIFIED;
if ( $rc == RC_OK ) {
( my $outfile = $f ) =~ s/\.gz$//;
open my $in, '<:gzip', $f or die $!;
open my $out, '>', $outfile or die $!;
print $out $_ or die $! while <$in>;
mv( $outfile, File::Spec->catfile( $dest_dir, $outfile ) ) or die $!;
}
}
exit 0;

8
go-vendor-tools.toml Normal file
View file

@ -0,0 +1,8 @@
[archive]
[licensing]
detector = "askalono"
[[licensing.licenses]]
path = "vendor/gopkg.in/yaml.v3/LICENSE"
sha256sum = "d18f6323b71b0b768bb5e9616e36da390fbd39369a81807cca352de4e4e6aa0b"
expression = "MIT AND (MIT AND Apache-2.0)"

View file

@ -1 +1,2 @@
SHA512 (geoipupdate-3.1.1.tar.gz) = 24e6a9f72449df1a2763314f188828332b5516962dbd75892689e505516af967bece60cc846fe17cfcc1ddb4d6111c9cd7d5c0ebc9d3e8e7af355f8a1c7f1a2f
SHA512 (geoipupdate-7.1.1-vendor.tar.bz2) = 7a107d8158416f9a42c6df7ac542aa7609183717e88bce9f40c6dc4b151a5eec0783cccc53403b0fef15c8bdf78724bf2b85f4242d939e90f3a09689971faf05
SHA512 (geoipupdate-7.1.1.tar.gz) = 9be4c7db231b453d3583f9130edb3f8eafac73af44a82bf4778e59592a105c6ccd48446ae9193046bd427c178fef9a9a3ea36baee1d4b04389450b5fbad4dc7e