diff --git a/_service b/_service
new file mode 100644
index 0000000..29a429c
--- /dev/null
+++ b/_service
@@ -0,0 +1,22 @@
+
+
+ git
+ git://github.com/maxmind/geoipupdate
+ v4.2.2
+ .git
+ @PARENT_TAG@
+ enable
+ v(.*)
+
+
+
+ *.tar
+ gz
+
+
+
+
+
+
+
+
diff --git a/_servicedata b/_servicedata
new file mode 100644
index 0000000..89f6e5c
--- /dev/null
+++ b/_servicedata
@@ -0,0 +1,10 @@
+
+
+ git://github.com/maxmind/geoiplookup.git
+ b7d56e8cecca387a33a2d246897a737eefdee501
+ git://github.com/maxmind/geoipupdate.git
+ b7d56e8cecca387a33a2d246897a737eefdee501
+ https://github.com/maxmind/geoipupdate
+ b7d56e8cecca387a33a2d246897a737eefdee501
+ git://github.com/maxmind/geoipupdate
+ b7d56e8cecca387a33a2d246897a737eefdee501
\ No newline at end of file
diff --git a/disable-pandoc.patch b/disable-pandoc.patch
new file mode 100644
index 0000000..ee8bdb2
--- /dev/null
+++ b/disable-pandoc.patch
@@ -0,0 +1,25 @@
+--- a/Makefile.orig 2020-03-04 10:14:17.209181344 +0100
++++ b/Makefile 2020-03-04 10:14:37.189282590 +0100
+@@ -33,9 +33,7 @@
+ data: \
+ $(BUILDDIR)/GeoIP.conf \
+ $(BUILDDIR)/GeoIP.conf.md \
+- $(BUILDDIR)/geoipupdate.md \
+- $(BUILDDIR)/GeoIP.conf.5 \
+- $(BUILDDIR)/geoipupdate.1
++ $(BUILDDIR)/geoipupdate.md
+
+ $(BUILDDIR):
+ mkdir -p $(BUILDDIR)
+@@ -53,11 +51,6 @@
+ $(BUILDDIR)/geoipupdate.md: $(BUILDDIR) doc/geoipupdate.md
+ sed -e 's|CONFFILE|$(CONFFILE)|g' -e 's|DATADIR|$(DATADIR)|g' -e 's|$$|$(MAYBE_CR)|g' doc/geoipupdate.md > $(BUILDDIR)/geoipupdate.md
+
+-$(BUILDDIR)/GeoIP.conf.5: $(BUILDDIR)/GeoIP.conf.md $(BUILDDIR)/geoipupdate.md
+- dev-bin/make-man-pages.pl "$(BUILDDIR)"
+-
+-$(BUILDDIR)/geoipupdate.1: $(BUILDDIR)/GeoIP.conf.5
+-
+ clean:
+ rm -rf $(BUILDDIR)/GeoIP.conf \
+ $(BUILDDIR)/GeoIP.conf.md \
diff --git a/geoipupdate-4.2.2.tar.gz b/geoipupdate-4.2.2.tar.gz
new file mode 100644
index 0000000..f203afd
--- /dev/null
+++ b/geoipupdate-4.2.2.tar.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6f85928ec0adf46d4d22263ff2f78fd938186d91c9aff684eff23808f09119c5
+size 27073
diff --git a/geoipupdate-legacy-3.1.1.tar.gz b/geoipupdate-legacy-3.1.1.tar.gz
deleted file mode 100644
index 5ffddfd..0000000
--- a/geoipupdate-legacy-3.1.1.tar.gz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:c3bb4a01bded3d9ea2fca1aad0a978a5fc7784e4cfb889126ce4e82bf5cf37d0
-size 33767
diff --git a/geoipupdate.changes b/geoipupdate.changes
index 63c554e..b837b5a 100644
--- a/geoipupdate.changes
+++ b/geoipupdate.changes
@@ -1,3 +1,57 @@
+-------------------------------------------------------------------
+Wed Mar 04 07:24:45 UTC 2020 - info@paolostivanin.com
+
+- Update to version 4.2.2:
+ * Prepare for 4.2.2
+ * Use go get on 1.10
+ * Only use debug.ReadBuildInfo on 1.12+
+ * Update changelog
+ * Set required Go version to 1.10
+ * Test back to Go 1.10
+ * Do not unnecessarily use errors.Is
+ * Add changelog for #76
+ * Update for GoReleaser nfpm section change
+ * Bump copyright year
+
+- Add disable-pandoc.patch
+
+-------------------------------------------------------------------
+Wed Mar 04 07:23:56 UTC 2020 - info@paolostivanin.com
+
+- Update to version 4.2.2:
+ * Prepare for 4.2.2
+ * Use go get on 1.10
+ * Only use debug.ReadBuildInfo on 1.12+
+ * Update changelog
+ * Set required Go version to 1.10
+ * Test back to Go 1.10
+ * Do not unnecessarily use errors.Is
+ * Add changelog for #76
+ * Update for GoReleaser nfpm section change
+ * Bump copyright year
+
+-------------------------------------------------------------------
+Tue Mar 03 15:31:26 UTC 2020 - info@paolostivanin.com
+
+- Update to version 4.2.2:
+ * Prepare for 4.2.2
+ * Use go get on 1.10
+ * Only use debug.ReadBuildInfo on 1.12+
+ * Update changelog
+ * Set required Go version to 1.10
+ * Test back to Go 1.10
+ * Do not unnecessarily use errors.Is
+ * Add changelog for #76
+ * Update for GoReleaser nfpm section change
+ * Bump copyright year
+
+-------------------------------------------------------------------
+Tue Mar 3 13:47:31 UTC 2020 - Paolo Stivanin
+
+- Update to 4.2.2
+ A lot of changes since last release. Please have a look at
+ https://github.com/maxmind/geoipupdate/releases for more info
+
-------------------------------------------------------------------
Thu Jun 20 05:35:01 UTC 2019 - Wolfgang Rosenauer
diff --git a/geoipupdate.spec b/geoipupdate.spec
index 69dccce..59dcf83 100644
--- a/geoipupdate.spec
+++ b/geoipupdate.spec
@@ -1,7 +1,7 @@
#
# spec file for package geoipupdate
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,50 +16,55 @@
#
+# Common info
Name: geoipupdate
-Version: 3.1.1
+Version: 4.2.2
Release: 0
Summary: GeoIP update client code
License: GPL-2.0-only
-Group: Productivity/Networking/System
-URL: https://www.maxmind.com
-Source0: https://github.com/maxmind/geoipupdate-legacy/archive/v%{version}/%{name}-legacy-%{version}.tar.gz
-Source1: geoipupdate.timer
-Source2: geoipupdate.service
-BuildRequires: autoconf
-BuildRequires: libtool
-BuildRequires: pkgconfig
-BuildRequires: pkgconfig(libcurl)
-BuildRequires: pkgconfig(systemd)
-BuildRequires: pkgconfig(zlib)
-Conflicts: GeoIP < 1.6.0
-%{?systemd_requires}
+Group: Productivity/Networking/Other
+URL: https://github.com/maxmind/geoipupdate
+Source0: %{name}-%{version}.tar.gz
+Source1: vendor.tar.gz
+Source2: geoipupdate.timer
+Source3: geoipupdate.service
+Patch0: disable-pandoc.patch
+# Build-time parameters
+BuildRequires: go >= 1.10
+# Manpage
+BuildRequires: perl%{?suse_version:-base}
%description
-The GeoIP Update program performs automatic updates of GeoIP2 and GeoIP
-Legacy binary databases. Currently the program only supports Linux and
-other Unix- like systems.
+The GeoIP Update program performs automatic updates of GeoIP2 and GeoIP Legacy
+binary databases. Currently the program only supports Linux and other
+Unix-like systems.
+# Preparation step (unpackung and patching if necessary)
%prep
-%setup -q -n %{name}-legacy-%{version}
+%setup -q -a1
+%patch0 -p1
%build
-autoreconf --install
-%configure \
- --datadir=%{_localstatedir}/lib
-make %{?_smp_mflags}
+export GOCACHE=$(pwd -P)/.gocache
+export GOTRACEBACK=crash
+export GOFLAGS='-a -mod=vendor -buildmode=pie -gcflags=all=-dwarf=false -ldflags=all=-s -ldflags=all=-w'
+%make_build \
+ CONFFILE=%{_sysconfdir}/GeoIP.conf \
+ DATADIR=%{_localstatedir}/lib/GeoIP \
+ VERSION=%{version}
%install
-%make_install
-install -d %{buildroot}%{_localstatedir}/lib/GeoIP
-install -D -p -m 0644 conf/GeoIP.conf.default \
- %{buildroot}%{_sysconfdir}/GeoIP.conf.default
-rm -rf %{buildroot}%{_datadir}/doc/geoipupdate
-install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.timer
-install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
-
-%check
-make %{?_smp_mflags} check
+install -D -m0644 %{SOURCE2} %{buildroot}%{_unitdir}/geoipupdate.timer
+install -D -m0644 %{SOURCE3} %{buildroot}%{_unitdir}/geoipupdate.service
+install -D -m0755 build/geoipupdate %{buildroot}%{_bindir}/geoipupdate
+install -D -m0644 conf/GeoIP.conf.default %{buildroot}%{_sysconfdir}/GeoIP.conf
+install -d -m0755 %{buildroot}%{_localstatedir}/lib/GeoIP
+sed -ri \
+ -e '/^UserId\s*/ s|YOUR_USER_ID_HERE|999999|' \
+ -e '/^LicenseKey\s*/ s|YOUR_LICENSE_KEY_HERE|000000000000|' \
+ -e '/^ProductIds\s*/ s|^(\w+s*).+$|\1 GeoLite2-City GeoLite2-Country GeoLite-Legacy-IPv6-City GeoLite-Legacy-IPv6-Country 506 517 533|' \
+ -e '/^(#\s*)?DatabaseDirectory/ s|^(#\s*)?(\w+\s*).+$|\2%{_localstatedir}/lib/GeoIP|' \
+ %{buildroot}%{_sysconfdir}/GeoIP.conf
%pre
%service_add_pre %{name}.service
@@ -74,15 +79,12 @@ make %{?_smp_mflags} check
%service_del_postun %{name}.service
%files
-%license LICENSE
-%doc README.md ChangeLog.md
+%doc README.md build/geoipupdate.md build/GeoIP.conf.md
+%license LICENSE-*
%config(noreplace) %{_sysconfdir}/GeoIP.conf
-%config %{_sysconfdir}/GeoIP.conf.default
-%dir %{_localstatedir}/lib/GeoIP
%{_bindir}/geoipupdate
+%dir %{_localstatedir}/lib/GeoIP
%{_unitdir}/%{name}.service
%{_unitdir}/%{name}.timer
-%{_mandir}/man1/geoipupdate.1%{?ext_man}
-%{_mandir}/man5/GeoIP.conf.5%{?ext_man}
%changelog
diff --git a/vendor.tar.gz b/vendor.tar.gz
new file mode 100644
index 0000000..79d83ed
--- /dev/null
+++ b/vendor.tar.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:efab4acbd7f1172c583a4256e110b257b127068a594b6d7088f1b30176ff28c3
+size 154203