2022-02-12 13:11:32 +01:00
|
|
|
{ lib, stdenv, fetchurl, zstd }:
|
2015-03-31 15:54:06 +02:00
|
|
|
|
2019-08-13 23:52:01 +02:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "geolite-legacy";
|
2022-02-12 13:11:32 +01:00
|
|
|
version = "2022-01-25";
|
|
|
|
|
|
|
|
# We use Arch Linux package as a snapshot, because upstream database is updated in-place.
|
|
|
|
geoip = fetchurl {
|
|
|
|
url = "https://archive.archlinux.org/packages/g/geoip-database/geoip-database-20220125-1-any.pkg.tar.zst";
|
|
|
|
sha256 = "sha256-ieuLpllJTHYu28UXBGfDWbnr9Ei8pGnos+RPWDsAGcM=";
|
|
|
|
};
|
2015-03-31 15:54:06 +02:00
|
|
|
|
2022-02-12 13:11:32 +01:00
|
|
|
extra = fetchurl {
|
|
|
|
url = "https://archive.archlinux.org/packages/g/geoip-database-extra/geoip-database-extra-20220125-1-any.pkg.tar.zst";
|
|
|
|
sha256 = "sha256-xrTnuJvuvtvn+uIARtbuJUlHco3Q+9BXLljt35V3ip0=";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ zstd ];
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
tar -xaf "$geoip"
|
|
|
|
tar -xaf "$extra"
|
|
|
|
mkdir -p $out/share
|
|
|
|
mv usr/share/GeoIP $out/share
|
|
|
|
'';
|
2015-03-31 15:54:06 +02:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2015-03-31 15:54:06 +02:00
|
|
|
description = "GeoLite Legacy IP geolocation databases";
|
2022-02-12 13:11:32 +01:00
|
|
|
homepage = "https://mailfud.org/geoip-legacy/";
|
|
|
|
license = licenses.cc-by-sa-40;
|
2015-08-06 00:30:09 +02:00
|
|
|
platforms = platforms.all;
|
2018-01-16 22:59:13 +01:00
|
|
|
maintainers = with maintainers; [ fpletz ];
|
2015-03-31 15:54:06 +02:00
|
|
|
};
|
|
|
|
}
|