public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Paul Howarth <paul@city-fan.org>
To: git-commits@fedoraproject.org
Subject: [rpms/geoipupdate] epel10.3: Update to 4.0.2
Date: Wed, 25 Nov 2026 19:42:02 GMT	[thread overview]
Message-ID: <179563572210.1.14490801842862810753.rpms-geoipupdate-436ffbc03841@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/geoipupdate
            Branch : epel10.3
            Commit : 436ffbc0384155d55bc7348ec2845c62cdee961d
            Author : Paul Howarth <paul@city-fan.org>
            Date   : 2019-01-20T10:46:30+00:00
            Stats  : +176/-94 in 6 file(s)
            URL    : https://src.fedoraproject.org/rpms/geoipupdate/c/436ffbc0384155d55bc7348ec2845c62cdee961d?branch=epel10.3

            Log:
            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

---
diff --git a/.gitignore b/.gitignore
index 25c1dc2..f4a606c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@
 /geoipupdate-2.5.0.tar.gz
 /geoipupdate-3.1.0.tar.gz
 /geoipupdate-3.1.1.tar.gz
+/geoipupdate-4.0.2.tar.gz

diff --git a/geoipupdate-4.0.1-flock.patch b/geoipupdate-4.0.1-flock.patch
new file mode 100644
index 0000000..84b0dc1
--- /dev/null
+++ b/geoipupdate-4.0.1-flock.patch
@@ -0,0 +1,94 @@
+
+ * github.com/theckman/go-flock renamed to github.com/gofrs/flock
+ * flock.NewFlock deprecated: use flock.New instead
+
+diff --git a/Gopkg.lock b/Gopkg.lock
+index 82255c3..47d965c 100644
+--- a/Gopkg.lock
++++ b/Gopkg.lock
+@@ -9,6 +9,14 @@
+   revision = "346938d642f2ec3594ed81d874461961cd0faa76"
+   version = "v1.1.0"
+ 
++[[projects]]
++  digest = "1:70f34ee6d1b188cbd2dfcde62b0e2c600262eb5a03c8a3f3435ecf7c74790470"
++  name = "github.com/gofrs/flock"
++  packages = ["."]
++  pruneopts = "UT"
++  revision = "7f43ea2e6a643ad441fc12d0ecc0d3388b300c53"
++  version = "v0.7.0"
++
+ [[projects]]
+   digest = "1:40e195917a951a8bf867cd05de2a46aaf1806c50cf92eebf4c16f78cd196f747"
+   name = "github.com/pkg/errors"
+@@ -34,7 +42,7 @@
+   version = "v1.0.1"
+ 
+ [[projects]]
+-  digest = "1:befd7181c2f92c9f05abf17cd7e15538919f19cf7871d794cacc45a4fb99c135"
++  digest = "1:c40d65817cdd41fac9aa7af8bed56927bb2d6d47e4fea566a74880f5c2b1c41e"
+   name = "github.com/stretchr/testify"
+   packages = [
+     "assert",
+@@ -44,23 +52,15 @@
+   revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686"
+   version = "v1.2.2"
+ 
+-[[projects]]
+-  digest = "1:e5abcb5d4f4cec8b475f2a812a00c3218fb75f0f792cdeee301e265d22a98cb7"
+-  name = "github.com/theckman/go-flock"
+-  packages = ["."]
+-  pruneopts = "UT"
+-  revision = "b139a2487364247d91814e4a7c7b8fdc69e342b2"
+-  version = "v0.4.0"
+-
+ [solve-meta]
+   analyzer-name = "dep"
+   analyzer-version = 1
+   input-imports = [
++    "github.com/gofrs/flock",
+     "github.com/pkg/errors",
+     "github.com/spf13/pflag",
+     "github.com/stretchr/testify/assert",
+     "github.com/stretchr/testify/require",
+-    "github.com/theckman/go-flock",
+   ]
+   solver-name = "gps-cdcl"
+   solver-version = 1
+diff --git a/Gopkg.toml b/Gopkg.toml
+index 0d37060..59fa533 100644
+--- a/Gopkg.toml
++++ b/Gopkg.toml
+@@ -34,8 +34,8 @@
+   version = "1.2.2"
+ 
+ [[constraint]]
+-  name = "github.com/theckman/go-flock"
+-  version = "0.4.0"
++  name = "github.com/gofrs/flock"
++  version = "0.7.0"
+ 
+ [prune]
+   go-tests = true
+diff --git a/cmd/geoipupdate/main.go b/cmd/geoipupdate/main.go
+index 6693ea6..59932b4 100644
+--- a/cmd/geoipupdate/main.go
++++ b/cmd/geoipupdate/main.go
+@@ -16,7 +16,7 @@ import (
+ 	"time"
+ 
+ 	"github.com/pkg/errors"
+-	flock "github.com/theckman/go-flock"
++	"github.com/gofrs/flock"
+ )
+ 
+ // version is the program's version number.
+@@ -76,7 +76,7 @@ func setup(
+ 		return nil, err
+ 	}
+ 
+-	lock := flock.NewFlock(config.LockFile)
++	lock := flock.New(config.LockFile)
+ 	ok, err := lock.TryLock()
+ 	if err != nil {
+ 		return nil, errors.Wrap(err, "error acquiring a lock")

diff --git a/geoipupdate.rpmlintrc b/geoipupdate.rpmlintrc
index 54539bf..d5305a6 100644
--- a/geoipupdate.rpmlintrc
+++ b/geoipupdate.rpmlintrc
@@ -6,6 +6,9 @@ addFilter("no-documentation")
 # Cron scripts can be edited by end users
 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")
+
 # Technical term
 addFilter("spelling-error Summary\(en_US\) Cron -> ")
 addFilter("spelling-error %description -l en_US Cron -> ")

diff --git a/geoipupdate.spec b/geoipupdate.spec
index 8f60f04..36f9913 100644
--- a/geoipupdate.spec
+++ b/geoipupdate.spec
@@ -1,26 +1,30 @@
-%global _hardened_build 1
-
+%global forgeurl https://github.com/maxmind/geoipupdate
+Version:	4.0.2
+%forgemeta
 Name:		geoipupdate
-Version:	3.1.1
 Release:	1%{?dist}
 Summary:	Update GeoIP2 and GeoIP Legacy binary databases from MaxMind
-License:	GPLv2
+License:	ASL 2.0 or MIT
 URL:		http://dev.maxmind.com/geoip/geoipupdate/
-Source0:	http://github.com/maxmind/geoipupdate/releases/download/v%{version}/geoipupdate-%{version}.tar.gz
+Source0:	%{forgesource}
 Source1:	geoipupdate.cron
-Source2:	geoipupdate6.cron
+Patch0:		geoipupdate-4.0.1-flock.patch
+ExclusiveArch:	%{go_arches}
+BuildRequires:	compiler(go-compiler)
 BuildRequires:	coreutils
-BuildRequires:	gcc
-BuildRequires:	libcurl-devel
+BuildRequires:	crontabs
+BuildRequires:	golang(github.com/pkg/errors)
+BuildRequires:	golang(github.com/spf13/pflag)
+BuildRequires:	golang(github.com/stretchr/testify)
+BuildRequires:	golang(github.com/gofrs/flock)
 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:	pandoc
+BuildRequires:	perl-interpreter
 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
@@ -35,70 +39,87 @@ 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.
+Cron job for weekly updates to GeoIP2 and GeoIP Legacy binary databases 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
+%prep
+%forgesetup
 
-%description cron6
-Cron job for weekly updates to GeoIP IPv6 Legacy database from MaxMind.
+# Remove bundled dependencies
+rm -rf vendor/
 
-%prep
-%setup -q
+# go-flock renamed upstream and new API preferred
+# https://github.com/maxmind/geoipupdate/pull/22
+%patch0 -p1
 
 %build
-%configure --disable-static --disable-dependency-tracking
-make %{?_smp_mflags}
+# Set up temporary build gopath and put our directory there
+mkdir -p ./_build/src/github.com/maxmind
+ln -s $(pwd) ./_build/src/github.com/maxmind/geoipupdate
+export GOPATH=$(pwd)/_build:%{gopath}
+
+# Make the geoipupdate program
+cd cmd/geoipupdate
+export LDFLAGS='-X main.defaultConfigFile=%{_sysconfdir}/GeoIP.conf -X main.defaultDatabaseDirectory=%{_datadir}/GeoIP'
+%gobuild
+cd -
+
+# Work around hardcoded "build" path in dev-bin/make-man-pages.pl
+ln -s _build build
+
+# Prepare the config files and documentation
+make BUILDDIR=$(pwd)/_build CONFFILE=%{_sysconfdir}/GeoIP.conf DATADIR=%{_datadir}/GeoIP data
 
 %install
-make install DESTDIR=%{buildroot}
+# Install the geoipupdate program
+install -d %{buildroot}%{_bindir}
+install -p -m 0755 cmd/geoipupdate/geoipupdate %{buildroot}%{_bindir}/geoipupdate
 
-# 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 -d %{buildroot}%{_sysconfdir}
+install -p -m 0644 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 -d %{buildroot}%{_datadir}/GeoIP
 
+# Install the cron script for fetching weekly updates
 install -D -m 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/cron.weekly/geoipupdate
-install -D -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/cron.weekly/geoipupdate6
 
-# 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 -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
+
+%check
+export GOPATH=$(pwd)/_build:%{gopath}
+cd cmd/geoipupdate
+go test
+cd -
 
 %files
-%if 0%{?_licensedir:1}
-%license LICENSE
-%else
-%doc LICENSE
-%endif
-%doc conf/GeoIP.conf.default README.md ChangeLog.md
+%license LICENSE-APACHE LICENSE-MIT
+%doc conf/GeoIP.conf.default README.md CHANGELOG.md
+%doc doc/GeoIP.conf.md doc/geoipupdate.md Gopkg.lock
 %config(noreplace) %{_sysconfdir}/GeoIP.conf
 %{_bindir}/geoipupdate
+%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
+* 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

diff --git a/geoipupdate6.cron b/geoipupdate6.cron
deleted file mode 100644
index 112d8b8..0000000
--- a/geoipupdate6.cron
+++ /dev/null
@@ -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;
-

diff --git a/sources b/sources
index 94b7d3b..eba083c 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (geoipupdate-3.1.1.tar.gz) = 24e6a9f72449df1a2763314f188828332b5516962dbd75892689e505516af967bece60cc846fe17cfcc1ddb4d6111c9cd7d5c0ebc9d3e8e7af355f8a1c7f1a2f
+SHA512 (geoipupdate-4.0.2.tar.gz) = 48ce2bf5781f19e470f8f5a8b41e1d3b19ad1dd2c8c0244f8d9f6f64688ffd062ac93506fc3e831556cbe5894c514014176254c666ba78680001dc75f27891b2

                 reply	other threads:[~2026-11-25 19:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179563572210.1.14490801842862810753.rpms-geoipupdate-436ffbc03841@fedoraproject.org \
    --to=paul@city-fan.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox