Bug 233947 - net/GeoIP: geoipupdate.sh has wrong file name for city database file
Summary: net/GeoIP: geoipupdate.sh has wrong file name for city database file
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Adam Weinberger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-11 22:29 UTC by Vincent Milum Jr
Modified: 2018-12-12 22:48 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (adamw)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Milum Jr 2018-12-11 22:29:26 UTC
The script will download the file GeoLiteCity.dat.gz and extract it as GeoLiteCity.dat, however the geoiplookup command is expecting the filename to be GeoIPCity.dat. As such, this file is never actually used by the command.

https://github.com/freebsd/freebsd-ports/blob/master/net/GeoIP/files/geoipupdate.sh.in#L44

NOTE: I've not investigated the proper name for the IPv6 version, but it probably follows the same renaming pattern, so most likely needs renamed too.
Comment 1 Adam Weinberger freebsd_committer freebsd_triage 2018-12-12 00:22:37 UTC
Hi Vincent,

You are absolutely right. However, that is as intended. geoiplookup looks for the paid filenames, while geoipupdate.sh (and net/geoipupdate if so configured) will download the free databases.

You'll need to create symlinks for those databases as described in https://github.com/maxmind/geoip-api-c/blob/master/NEWS.md

I'm closing this PR as it is working as intended, though I'm going to amend the pkg-message with instructions to create those symlinks.
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-12-12 00:29:32 UTC
A commit references this bug:

Author: adamw
Date: Wed Dec 12 00:28:53 UTC 2018
New revision: 487269
URL: https://svnweb.freebsd.org/changeset/ports/487269

Log:
  Add pkg-message instructions to fix geoiplookup with the free databases

  GeoIP has free and paid databases with differing granularity. The
  geoiplookup and geoiplookup6 tools look only for the paid databases.
  Users with the free databases (as would be obtained through the
  included geoipupdate.sh script, or though specification of free
  data files in net/geoipupdate) will need to create symlinks to
  enable those tools to work with the free database files.

  The upstream NEWS.md enumerates those symlinks, so this patch includes
  a link to that file in the upstream repo.

  PORTREVISION bump for the pkg-message change.

  PR:		233947
  Reported by:	Vincent Milum
  MFH:		2018Q4

Changes:
  head/net/GeoIP/Makefile
  head/net/GeoIP/files/pkg-message.in
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-12-12 00:32:36 UTC
A commit references this bug:

Author: adamw
Date: Wed Dec 12 00:31:47 UTC 2018
New revision: 487270
URL: https://svnweb.freebsd.org/changeset/ports/487270

Log:
  MFH: r487269

  Add pkg-message instructions to fix geoiplookup with the free databases

  GeoIP has free and paid databases with differing granularity. The
  geoiplookup and geoiplookup6 tools look only for the paid databases.
  Users with the free databases (as would be obtained through the
  included geoipupdate.sh script, or though specification of free
  data files in net/geoipupdate) will need to create symlinks to
  enable those tools to work with the free database files.

  The upstream NEWS.md enumerates those symlinks, so this patch includes
  a link to that file in the upstream repo.

  PORTREVISION bump for the pkg-message change.

  PR:		233947
  Reported by:	Vincent Milum

  Approved by:	portmgr (with hat)

Changes:
_U  branches/2018Q4/
  branches/2018Q4/net/GeoIP/Makefile
  branches/2018Q4/net/GeoIP/files/pkg-message.in
Comment 4 Vincent Milum Jr 2018-12-12 22:48:09 UTC
This seems highly counter-intuitive to the entire ideals of what a computer is even supposed to be though, as the entire point of computers is to automate otherwise human performed tasks. Instead of solving the problem at hand, you're just adding a note telling the user "just do it yourself" - If anything, it should at least be an optional flag in the script to do this automatically. 

The other thing with this is that on Debian, installing their versions of the GeoIP packages handles this as expected, just install the packages and they just "WORK" - so by NOT having this on FreeBSD, it is creating another barrier to entry to someone trying to use this system that may be new to it.