Files
haikuports/dev-libs/geoip/geoip-1.6.9.recipe
2016-04-12 08:35:46 +00:00

101 lines
2.7 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="2"
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"
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
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
chmod +x $binDir/geoipupdate.sh
else
rm -rf $binDir $documentationDir
fi
prepareInstalledDevelLibs \
libGeoIP
fixPkgconfig
# devel package
packageEntries devel \
$developDir
}