From 7b8be6428f449b6ea602a798555be75688371371 Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Wed, 30 Mar 2016 22:47:18 +0000
Subject: Search for xasprintf in libroot.


diff --git a/configure.ac b/configure.ac
index 124dfd3..8d37da8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,6 +29,7 @@ AC_CHECK_HEADERS(curl/curl.h, , AC_MSG_ERROR(curl header (curl/curl.h) not found
 
 AC_CHECK_LIB(z, gzopen, [], [AC_MSG_ERROR([libz not found.])])
 AC_CHECK_LIB(curl, curl_easy_setopt, [], [AC_MSG_ERROR([libcurl not found.])])
+AC_CHECK_LIB(root, xasprintf, [], [])
 
 AC_CHECK_FUNCS([ getline fgets asprintf strcasecmp memset socket strchr strdup strstr strrchr memchr strspn])
 
-- 
2.13.1


From f052949a0f4ac5e016f56ff9deb106a5a4cb40aa Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Wed, 30 Mar 2016 22:47:18 +0000
Subject: Use $sharedStateDir/GeoIP/ instead of $datadir/GeoIP/

We need to use the default $dataDir for the installation of the
default config file in system/data/geoipupdate/GeoIP.conf.default
and, at the same time, pass "`finddir B_SYSTEM_CACHE_DIRECTORY`" as
$sharedStateDir.

diff --git a/bin/Makefile.am b/bin/Makefile.am
index 345ac55..99ff5ba 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -1,5 +1,5 @@
-AM_CPPFLAGS = -I$(top_srcdir)/src -DSYSCONFDIR=\"$(sysconfdir)\" -DDATADIR=\"$(datadir)/GeoIP\" \
-			  -std=c99 -Wall -Wextra
+AM_CPPFLAGS = -I$(top_srcdir)/src -DSYSCONFDIR=\"$(sysconfdir)\" -DSHAREDSTATEDIR=\"$(sharedstatedir)\" \
+			  -Wall
 
 bin_PROGRAMS = geoipupdate
 
diff --git a/bin/geoipupdate_s.c b/bin/geoipupdate_s.c
index 095e8f5..d8273e5 100644
--- a/bin/geoipupdate_s.c
+++ b/bin/geoipupdate_s.c
@@ -13,7 +13,7 @@ geoipupdate_s *geoipupdate_s_new(void)
     exit_if(NULL == gu->license_file,
             "Unable to allocate memory for license file path.\n");
 
-    gu->database_dir = strdup(DATADIR);
+    gu->database_dir = strdup(SHAREDSTATEDIR "/GeoIP");
     exit_if(NULL == gu->database_dir,
             "Unable to allocate memory for database directory path.\n");
 
-- 
2.13.1


From 15efa168158a57fe650a2702333741c45531e93e Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Thu, 5 Jan 2017 01:22:18 +0000
Subject: Add table of ProductIds to GeoIP.conf


diff --git a/conf/GeoIP.conf.default b/conf/GeoIP.conf.default
index d3caf4f..615774a 100644
--- a/conf/GeoIP.conf.default
+++ b/conf/GeoIP.conf.default
@@ -8,6 +8,19 @@
 UserId 0
 LicenseKey 000000000000
 
+# List of databases available without an account:
+# (Source: https://dev.maxmind.com/geoip/geoipupdate/)
+
+# ProductIds                  Filename              Database name
+# --------------------------- --------------------- ---------------------------
+# 506                         GeoLiteCountry.dat    GeoLite Legacy Country
+# 517                         GeoLiteASNum.dat      GeoLite Legacy ASN
+# 533                         GeoLiteCity.dat       GeoLite Legacy City
+# GeoLite-Legacy-IPv6-Country GeoIPv6.dat           GeoLite Legacy IPv6 Country
+# GeoLite-Legacy-IPv6-City    GeoLiteCityv6.dat     GeoLite Legacy IPv6 City
+# GeoLite2-Country            GeoLite2-Country.mmdb GeoLite2 Country
+# GeoLite2-City               GeoLite2-City.mmdb    GeoLite2 City
+
 # Enter the product IDs of the databases you would like to update.
 # Multiple product IDs are separated by spaces.
 ProductIds GeoLite2-Country GeoLite2-City
-- 
2.13.1

