diff --git a/.gitignore b/.gitignore index d4eb57f..c37416d 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,12 @@ /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 diff --git a/.packit.yaml b/.packit.yaml new file mode 100644 index 0000000..ec2d521 --- /dev/null +++ b/.packit.yaml @@ -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 diff --git a/geoipupdate.rpmlintrc b/geoipupdate.rpmlintrc index cf120c1..b602642 100644 --- a/geoipupdate.rpmlintrc +++ b/geoipupdate.rpmlintrc @@ -1,5 +1,3 @@ -from Config import * - # Documentation for cron packages is the package %description addFilter("no-documentation") @@ -8,3 +6,11 @@ addFilter("executable-marked-as-config-file /etc/cron.weekly/geoipupdate") # 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") + diff --git a/geoipupdate.spec b/geoipupdate.spec index 3a77c83..03bf648 100644 --- a/geoipupdate.spec +++ b/geoipupdate.spec @@ -1,58 +1,62 @@ -%bcond_without check +# Generated by go2rpm 1.18.0 +%bcond check 1 # https://github.com/maxmind/geoipupdate -%global goipath github.com/maxmind/geoipupdate -Version: 4.11.1 +%global goipath github.com/maxmind/geoipupdate/v7 +Version: 7.1.1 -%gometa +%gometa -L -f -Name: geoipupdate -Release: 1%{?dist} -Summary: Update GeoIP2 binary databases from MaxMind +Name: geoipupdate +Release: 5%{?dist} +Summary: Update GeoIP2 binary databases from MaxMind -License: Apache-2.0 OR MIT -URL: http://dev.maxmind.com/geoip/geoipupdate/ -Source0: %{gosource} -Source1: geoipupdate.cron +# 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: golang(github.com/gofrs/flock) -BuildRequires: golang(github.com/spf13/pflag) -BuildRequires: make -BuildRequires: pandoc -BuildRequires: perl-interpreter -BuildRequires: perl(File::Temp) -BuildRequires: perl(strict) -BuildRequires: perl(warnings) -BuildRequires: sed + +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} - -%if %{with check} -# Tests -BuildRequires: golang(github.com/stretchr/testify/assert) -BuildRequires: golang(github.com/stretchr/testify/require) -%endif +Obsoletes: geoipupdate-cron6 < %{version}-%{release} %description 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 GeoIP2 binary databases from MaxMind. %prep -%goprep +%goprep -A +%setup -q -T -D -a1 %{forgesetupargs} + +%generate_buildrequires +%go_vendor_license_buildrequires -c %{S:2} %build +%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 @@ -63,39 +67,40 @@ ln -s %{gobuilddir} build make BUILDDIR=%{gobuilddir} CONFFILE=%{_sysconfdir}/GeoIP.conf DATADIR=%{_datadir}/GeoIP data %install -# Install the geoipupdate program -install -d %{buildroot}%{_bindir} -install -p -m 0755 %{gobuilddir}/bin/geoipupdate %{buildroot}%{_bindir}/geoipupdate +%go_vendor_license_install -c %{S:2} +install -m 0755 -vd %{buildroot}%{_bindir} +install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ # Install the configuration file # By default we just use the free GeoIP2 databases -install -d %{buildroot}%{_sysconfdir} -install -p -m 0644 conf/GeoIP.conf.default %{buildroot}%{_sysconfdir}/GeoIP.conf +install -m 0755 -vd %{buildroot}%{_sysconfdir} +install -m 0644 -vp conf/GeoIP.conf.default %{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 -d %{buildroot}%{_datadir}/GeoIP +install -m 0755 -vd %{buildroot}%{_datadir}/GeoIP # Install the cron script for fetching weekly updates -install -D -m 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/cron.weekly/geoipupdate +install -m 0755 -vd %{buildroot}%{_sysconfdir}/cron.weekly +install -m 0755 -vp %{S:3} %{buildroot}%{_sysconfdir}/cron.weekly/geoipupdate # Install the manpages -install -d %{buildroot}%{_mandir}/man1 -install -p -m 0644 _build/geoipupdate.1 %{buildroot}%{_mandir}/man1/geoipupdate.1 -install -d %{buildroot}%{_mandir}/man5 -install -p -m 0644 _build/GeoIP.conf.5 %{buildroot}%{_mandir}/man5/GeoIP.conf.5 +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 -%if %{with check} %check -%gocheck +%go_vendor_license_check -c %{S:2} +%if %{with check} +%gotest ./... %endif -%files -%license LICENSE-APACHE LICENSE-MIT -%doc conf/GeoIP.conf.default README.md CHANGELOG.md -%doc doc/GeoIP.conf.md doc/geoipupdate.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* @@ -104,6 +109,149 @@ install -p -m 0644 _build/GeoIP.conf.5 %{buildroot}%{_mandir}/man5/GeoIP.conf.5 %config(noreplace) %{_sysconfdir}/cron.weekly/geoipupdate %changelog +* Sun Oct 19 2025 Robert-André Mauchin - 7.1.1-5 +- Convert to new vendoring guidelines + +* Fri Oct 10 2025 Alejandro Sáez - 7.1.1-4 +- Rebuild + +* Fri Aug 15 2025 Maxwell G - 7.1.1-3 +- Rebuild for golang-1.25.0 + +* Wed Jul 23 2025 Fedora Release Engineering - 7.1.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Fri Jul 11 2025 Paul Howarth - 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 - 7.1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Tue Nov 19 2024 Paul Howarth - 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 - 7.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Tue Apr 9 2024 Paul Howarth - 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 - 6.1.0-4 +- Rebuild for golang 1.22.0 + +* Wed Jan 24 2024 Fedora Release Engineering - 6.1.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jan 19 2024 Fedora Release Engineering - 6.1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Wed Jan 10 2024 Paul Howarth - 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 - 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 - 5.1.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu May 11 2023 Paul Howarth - 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 - 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 - 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 - 4.11.1-1 - Update to 4.11.1 - 'github.com/pkg/errors' is no longer used to wrap errors diff --git a/go-vendor-tools.toml b/go-vendor-tools.toml new file mode 100644 index 0000000..2c22c5e --- /dev/null +++ b/go-vendor-tools.toml @@ -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)" diff --git a/sources b/sources index f4b3fa7..d7f4e69 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -SHA512 (geoipupdate-4.11.1.tar.gz) = eae1abde1b0e64098e6241f3e9b5bb6a489f09bda50833bc6be058d7dd96a5cdc988eb1a3a85e9d3c8d53200fd886b5a75c6a075cc36a75e02ddb7ff895d8fa5 +SHA512 (geoipupdate-7.1.1-vendor.tar.bz2) = 7a107d8158416f9a42c6df7ac542aa7609183717e88bce9f40c6dc4b151a5eec0783cccc53403b0fef15c8bdf78724bf2b85f4242d939e90f3a09689971faf05 +SHA512 (geoipupdate-7.1.1.tar.gz) = 9be4c7db231b453d3583f9130edb3f8eafac73af44a82bf4778e59592a105c6ccd48446ae9193046bd427c178fef9a9a3ea36baee1d4b04389450b5fbad4dc7e