geoip: drop libtool file, permalinkify SOURCE_URI_2, add TEST(). (#832)

This commit is contained in:
fbrosson
2016-10-22 02:38:08 +00:00
committed by waddlesplash
parent 26c6550156
commit 618b7afec1
2 changed files with 50 additions and 5 deletions

View File

@@ -10,12 +10,14 @@ download GeoLite Legacy, GeoLite2 and GeoIP2 databases from MaxMind."
HOMEPAGE="https://dev.maxmind.com/geoip/legacy/"
COPYRIGHT="2002-2016 MaxMind, Inc."
LICENSE="GNU LGPL v2.1"
REVISION="2"
REVISION="3"
SOURCE_URI="https://github.com/maxmind/geoip-api-c/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="05468adbb6bdbddc588ee6f0df990f47b1b24d278519c35d59f7a8058a2a9825"
SOURCE_FILENAME="geoip-api-c-$portVersion.tar.gz"
SOURCE_DIR="geoip-api-c-$portVersion"
SOURCE_URI_2="https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-libs/geoip/files/geoipupdate-r5.sh#noarchive"
SOURCE_FILENAME_2="geoipupdate-r5.sh"
srcGitRev_2="11461b27c10c146db1619bd2b5c9448a4c5e4e0f"
SOURCE_URI_2="https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-libs/geoip/files/$SOURCE_FILENAME_2?id=$srcGitRev_2#noarchive"
CHECKSUM_SHA256_2="4c2b032e280b614ff028e930c9612c27bf4281e189c38e572eecfe36fb5e4cd8"
SOURCE_DIR_2=""
PATCHES="geoip-$portVersion.patchset"
@@ -79,18 +81,20 @@ INSTALL()
{
make install
# remove libtool file
rm -f $libDir/libGeoIP.la
if [ -z "$secondaryArchSuffix" ]; then
CACHE_DIR="`finddir B_SYSTEM_CACHE_DIRECTORY`"
mkdir -p $binDir $prefix${CACHE_DIR#/boot/system}/GeoIP
sed -e "s,^\(GEOIPDIR=\).*,\1${CACHE_DIR#/boot}/GeoIP," \
$sourceDir2/geoipupdate-r5.sh > $binDir/geoipupdate.sh
$sourceDir2/$SOURCE_FILENAME_2 > $binDir/geoipupdate.sh
chmod +x $binDir/geoipupdate.sh
else
rm -rf $binDir $documentationDir
fi
prepareInstalledDevelLibs \
libGeoIP
prepareInstalledDevelLib libGeoIP
fixPkgconfig
@@ -98,3 +102,14 @@ INSTALL()
packageEntries devel \
$developDir
}
TEST()
{
mkdir -p "$sourceDir/data"
if [ ! -f "$sourceDir/data/GeoIP.dat" ]; then
if [ -f /system/cache/GeoIP/GeoIP.dat ]; then
cp /system/cache/GeoIP/GeoIP.dat "$sourceDir/data"
fi
fi
make check
}

View File

@@ -48,3 +48,33 @@ index a56e744..62dddf8 100644
--
2.7.0
From 14a2b588782d2883883a448c83d377c2d35f3ee0 Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Fri, 21 Oct 2016 23:48:53 +0000
Subject: tiny gcc2 patch for test/test-geoip-invalid-file.c
diff --git a/test/test-geoip-invalid-file.c b/test/test-geoip-invalid-file.c
index 089a770..0564259 100644
--- a/test/test-geoip-invalid-file.c
+++ b/test/test-geoip-invalid-file.c
@@ -10,6 +10,7 @@ int main()
return 1;
}
+ {
const char *country = GeoIP_country_code_by_addr(gi, "24.24.24.24");
if (country != NULL) {
fprintf(
@@ -25,6 +26,7 @@ int main()
"Received a non-NULL value on an invalid database from GeoIP_country_code_by_addr_v6\n");
return 1;
}
+ }
return 0;
}
--
2.10.1