On 2016/05/26 23:55, Frederic Cambus wrote: > Hi ports@, > > Here is a port for net/geoipupdate. > > The update program was previously only useful with a paid subscription, > but it's now also possible to use it to update the free databases. > > From DESCR: > > The GeoIP Update program performs automatic updates of GeoIP2 and GeoIP > Legacy binary databases. > > Configuration instructions for free GeoLite2 and GeoLite Legacy databases > can be found here : https://dev.maxmind.com/geoip/geoipupdate/ >
here are some bits on top; - @sample the config file - patch config to use the directory net/GeoIP is already using (these "updated at runtime" things shouldn't update in /usr/local) - patch to make it easier for free users (commercial users have an online config generator page anyway) but I think maybe we should also add shepherd users towards running it as a non-root user by previding a separate uid to own /var/db/GeoIP files .. diff --git Makefile Makefile index e9c3205..000723f 100644 --- Makefile +++ Makefile @@ -27,4 +27,8 @@ CONFIGURE_ENV = CFLAGS="-I${LOCALBASE}/include" \ FAKE_FLAGS = sysconfdir=${PREFIX}/share/examples/geoipupdate +post-install: + ${SUBST_CMD} ${PREFIX}/share/examples/geoipupdate/GeoIP.conf + rm ${PREFIX}/share/examples/geoipupdate/GeoIP.conf.beforesubst + .include <bsd.port.mk> diff --git patches/patch-conf_GeoIP_conf_default patches/patch-conf_GeoIP_conf_default new file mode 100644 index 0000000..47c7738 --- /dev/null +++ patches/patch-conf_GeoIP_conf_default @@ -0,0 +1,42 @@ +$OpenBSD$ +--- conf/GeoIP.conf.default.orig Wed Feb 25 23:06:59 2015 ++++ conf/GeoIP.conf.default Thu May 26 23:29:23 2016 +@@ -3,18 +3,33 @@ + # pre-filled GeoIP.conf file. + + # Enter your user ID and license key below. These are available from +-# https://www.maxmind.com/en/my_license_key +-UserId YOUR_USER_ID_HERE +-LicenseKey YOUR_LICENSE_KEY_HERE ++# https://www.maxmind.com/en/my_license_key. ++# ++# With the entries below, you can only fetch the free GeoLite databases. ++UserId 999999 ++LicenseKey 000000000000 + + # Enter the product IDs of the databases you would like to update. + # Multiple product IDs are separated by spaces. +-ProductIds GeoIP2-Country GeoIP2-City 106 132 + ++# Free databases: ++# GeoLite2-City - GeoLite 2 City ++# GeoLite2-Country - GeoLite2 Country ++# GeoLite-Legacy-IPv6-City - GeoLite Legacy IPv6 City ++# GeoLite-Legacy-IPv6-Country - GeoLite Legacy IPv6 Country ++# 506 - GeoLite Legacy Country ++# 517 - GeoLite Legacy ASN ++# 533 - GeoLite Legacy City ++ProductIds GeoLite2-City GeoLite2-Country GeoLite-Legacy-IPv6-City GeoLite-Legacy-IPv6-Country 506 517 533 ++ ++# Example for commercial databases: ++# (see https://www.maxmind.com/en/geoipupdate_conf) ++# ProductIds GeoIP2-Country GeoIP2-City 106 132 ++ + # The remaining settings are OPTIONAL. + + # The directory to store the database files. Defaults to /usr/local/share/GeoIP +-# DatabaseDirectory /usr/local/share/GeoIP ++DatabaseDirectory ${LOCALSTATEDIR}/db/GeoIP + + # The server to use. Defaults to "updates.maxmind.com". + # Host updates.maxmind.com diff --git pkg/PLIST pkg/PLIST index e2285c5..8c3e59f 100644 --- pkg/PLIST +++ pkg/PLIST @@ -4,4 +4,5 @@ @man man/man5/GeoIP.conf.5 share/examples/geoipupdate/ share/examples/geoipupdate/GeoIP.conf -share/examples/geoipupdate/GeoIP.conf.default +@sample ${SYSCONFDIR}/GeoIP.conf +@comment share/examples/geoipupdate/GeoIP.conf.default