Bug 258400

Summary: net-mgmt/gnu-ipcalc: GeoIP info not displayed
Product: Ports & Packages Reporter: Rob LA LAU <freebsd>
Component: Individual Port(s)Assignee: Emanuel Haupt <ehaupt>
Status: Closed FIXED    
Severity: Affects Many People Flags: bugzilla: maintainer-feedback? (ehaupt)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Fix hardcoded path to geoip db none

Description Rob LA LAU 2021-09-10 11:22:36 UTC
Hi,

GeoIP information is not displayed. I guess this is because in the file ipcalc-maxmind.c the paths to the MaxMind databases are hardcoded as /usr/share/GeoIP, while `geoipupdate' on FreeBSD stores the databases in /usr/local/share/GeoIP.
See also /usr/local/etc/GeoIP.conf, which is part of net/geoipupdate.

Cheers,
  Rob
Comment 1 Emanuel Haupt freebsd_committer freebsd_triage 2021-09-10 16:37:53 UTC
Created attachment 227810 [details]
Fix hardcoded path to geoip db

Thanks again for the report. As I don't have an account, could you please test the attached patch? I'm also displaying a message on how to update the database. I've checked other ports and it seems to be the preferred way to handle this instead of registering it as a dependency.
Comment 2 Emanuel Haupt freebsd_committer freebsd_triage 2021-09-10 17:02:44 UTC
I've just got myself an account and it seems to work as expected:

root@portjail:/usr/ports/net-mgmt/gnu-ipcalc # ipcalc -g 1.1.1.1
COUNTRYCODE=AU
COUNTRY=Australia
COORDINATES="-33.494000,143.210400"

But I still appreciate your feedback :-)
Comment 3 Rob LA LAU 2021-09-10 17:06:46 UTC
Works like a charm.
Thanks again, Emanuel!
Comment 4 commit-hook freebsd_committer freebsd_triage 2021-09-10 17:21:46 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1817b81260d995086bbb8dafed2b7a8b168a449d

commit 1817b81260d995086bbb8dafed2b7a8b168a449d
Author:     Emanuel Haupt <ehaupt@FreeBSD.org>
AuthorDate: 2021-09-10 16:32:39 +0000
Commit:     Emanuel Haupt <ehaupt@FreeBSD.org>
CommitDate: 2021-09-10 16:32:39 +0000

    net-mgmt/gnu-ipcalc: Fix hardcoded path to geoip database

    PR:             258400
    Reported by:    freebsd@ohreally.nl

 net-mgmt/gnu-ipcalc/Makefile                   | 6 ++++++
 net-mgmt/gnu-ipcalc/files/pkg-message.in (new) | 8 ++++++++
 2 files changed, 14 insertions(+)
Comment 5 Emanuel Haupt freebsd_committer freebsd_triage 2021-09-10 17:22:18 UTC
Committed, thanks Rob.