geoip: spruce it up a bit
Update metadata (dead URL), add myself as a maintainer, and do some minor touchups, including moving to `pname+version`. Signed-off-by: Austin Seipp <aseipp@pobox.com>
This commit is contained in:
parent
c2eed8b9b0
commit
2c858f06aa
|
@ -1,12 +1,19 @@
|
||||||
# in geoipDatabase, you can insert a package defining ${geoipDatabase}/share/GeoIP
|
|
||||||
# e.g. geolite-legacy
|
|
||||||
{ stdenv, fetchFromGitHub, autoreconfHook
|
{ stdenv, fetchFromGitHub, autoreconfHook
|
||||||
, drvName ? "geoip", geoipDatabase ? "/var/lib/geoip-databases" }:
|
, drvName ? "geoip"
|
||||||
|
|
||||||
let version = "1.6.12";
|
# in geoipDatabase, you can insert a package defining
|
||||||
dataDir = if (stdenv.lib.isDerivation geoipDatabase) then "${toString geoipDatabase}/share/GeoIP" else geoipDatabase;
|
# "${geoipDatabase}/share/GeoIP" e.g. geolite-legacy
|
||||||
in stdenv.mkDerivation {
|
, geoipDatabase ? "/var/lib/geoip-databases"
|
||||||
name = "${drvName}-${version}";
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
dataDir = if stdenv.lib.isDerivation geoipDatabase
|
||||||
|
then "${toString geoipDatabase}/share/GeoIP"
|
||||||
|
else geoipDatabase;
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = drvName;
|
||||||
|
version = "1.6.12";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "maxmind";
|
owner = "maxmind";
|
||||||
|
@ -17,21 +24,22 @@ in stdenv.mkDerivation {
|
||||||
|
|
||||||
nativeBuildInputs = [ autoreconfHook ];
|
nativeBuildInputs = [ autoreconfHook ];
|
||||||
|
|
||||||
|
# Cross compilation shenanigans
|
||||||
configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
||||||
"ac_cv_func_malloc_0_nonnull=yes"
|
"ac_cv_func_malloc_0_nonnull=yes"
|
||||||
"ac_cv_func_realloc_0_nonnull=yes"
|
"ac_cv_func_realloc_0_nonnull=yes"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Fix up the default data directory
|
||||||
postConfigure = ''
|
postConfigure = ''
|
||||||
find . -name Makefile.in -exec sed -i -r 's#^pkgdatadir\s*=.+$#pkgdatadir = ${dataDir}#' {} \;
|
find . -name Makefile.in -exec sed -i -r 's#^pkgdatadir\s*=.+$#pkgdatadir = ${dataDir}#' {} \;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = with stdenv.lib; {
|
||||||
description = "Geolocation API";
|
description = "An API for GeoIP/Geolocation databases";
|
||||||
maintainers = [ stdenv.lib.maintainers.raskin ];
|
maintainers = with maintainers; [ thoughtpolice raskin ];
|
||||||
license = stdenv.lib.licenses.lgpl21;
|
license = licenses.lgpl21;
|
||||||
platforms = stdenv.lib.platforms.unix;
|
platforms = platforms.unix;
|
||||||
homepage = http://geolite.maxmind.com/;
|
homepage = "http://maxmind.com";
|
||||||
downloadPage = "http://geolite.maxmind.com/download/";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue