Files
haikuports/dev-libs/geoip/geoip-1.6.9.recipe

116 lines
3.1 KiB
Bash

SUMMARY="Non-DNS IP-to-country resolver C library & utils"
DESCRIPTION="The GeoIP Legacy C library enables the user to find geographical \
and network information of an IP address. geoiplookup and geoiplookup6 will \
use any GeoIP Legacy databases available in /system/cache/GeoIP. Call
\"geoipupdate.sh -a\" after installation to download the GeoIP(v6), \
GeoLiteCity(v6) and GeoIPASNum(v6) free databases for the first time. Call \
\"geoipupdate.sh\" (without any argument) from time to time (e.g. once per \
month) to update them later. Another package, geoipupdate, may be used to \
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="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_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"
PATCHES_2="geoipupdate-r5.patchset"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
PROVIDES="
geoip$secondaryArchSuffix = $portVersion
lib:libGeoIP$secondaryArchSuffix = $portVersion
"
if [ -z "$secondaryArchSuffix" ]; then
PROVIDES="$PROVIDES
cmd:geoiplookup
cmd:geoiplookup6
cmd:geoipupdate.sh
"
fi
REQUIRES="
haiku$secondaryArchSuffix
cmd:curl
"
PROVIDES_devel="
geoip${secondaryArchSuffix}_devel = $portVersion
devel:libGeoIP$secondaryArchSuffix = $portVersion
"
REQUIRES_devel="
geoip$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:ar$secondaryArchSuffix
cmd:autoconf
cmd:autom4te
cmd:automake
cmd:make
cmd:gcc$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
"
BUILD()
{
aclocal
libtoolize
autoconf
automake --add-missing
runConfigure --omit-dirs dataDir ./configure \
--datadir="`finddir B_SYSTEM_CACHE_DIRECTORY`"
make $jobArgs
}
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/$SOURCE_FILENAME_2 > $binDir/geoipupdate.sh
chmod +x $binDir/geoipupdate.sh
else
rm -rf $binDir $documentationDir
fi
prepareInstalledDevelLib libGeoIP
fixPkgconfig
# devel package
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
}