blob: 3527d0cba7922ec8f80be47d242182e78646593d [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001SUMMARY = "C library for country/city/organization to IP address or hostname mapping"
2DESCRIPTION = "GeoIP is a C library that enables the user to find the country that any IP \
3address or hostname originates from. It uses a file based database that is \
4accurate as of March 2003. This database simply contains IP blocks as keys, and \
5countries as values. This database should be more complete and accurate than \
6using reverse DNS lookups."
7
8HOMEPAGE = "http://dev.maxmind.com/geoip/"
9SECTION = "libdevel"
10
11SRC_URI = "git://github.com/maxmind/geoip-api-c.git \
12 http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz;apply=no;name=GeoIP-dat \
13 http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz;apply=no;name=GeoIPv6-dat \
14 http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz;apply=no;name=GeoLiteCity-dat \
15 http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz;apply=no;name=GeoLiteCityv6-dat \
16 file://run-ptest \
17"
18SRCREV = "3169a8a88808c8df862e0b0355f99c738cce9f7e"
19
20SRC_URI[GeoIP-dat.md5sum] = "37c84ead332dda0362a5ac7b049b72d4"
21SRC_URI[GeoIP-dat.sha256sum] = "79ff1099e96c2dc1c2539c9a18aaa13a9afd085cae477df60d95f1644d42bc07"
22
23SRC_URI[GeoIPv6-dat.md5sum] = "e75b84a4044e81d6d4484e33816bc762"
24SRC_URI[GeoIPv6-dat.sha256sum] = "a009b0f21968d2868e6dd19d14f3c3b8cd60ae84a4bfc2970df34d771a04811e"
25
26SRC_URI[GeoLiteCity-dat.md5sum] = "4b6588d0bfe1af22e267ac90aa97f769"
27SRC_URI[GeoLiteCity-dat.sha256sum] = "8a6467033a528f68b1a97de24d9d0ce86c8e8e83683820e16e433ddbd3f712f7"
28
29SRC_URI[GeoLiteCityv6-dat.md5sum] = "ad0cb42518af7f752499425dca0952bb"
30SRC_URI[GeoLiteCityv6-dat.sha256sum] = "eda67f4204ba9fa5204a53cdb629167cca9394c712f5378bc723a8c29c0b440f"
31
32LICENSE = "LGPL-2.1"
33
34LIC_FILES_CHKSUM = "file://COPYING;md5=243b725d71bb5df4a1e5920b344b86ad \
35 file://LICENSE;md5=0388276749a542b0d611601fa7c1dcc8 "
36
37S = "${WORKDIR}/git"
38
39inherit autotools
40
41EXTRA_OECONF = "--disable-static \
42 --disable-dependency-tracking "
43
44do_install() {
45 make DESTDIR=${D} install
46 install -d ${D}/${datadir}/GeoIP
47 install ${WORKDIR}/GeoIP.dat ${D}/${datadir}/GeoIP/
48 install ${WORKDIR}/GeoIPv6.dat ${D}/${datadir}/GeoIP/
49 install ${WORKDIR}/GeoLiteCity.dat ${D}/${datadir}/GeoIP/
50 install ${WORKDIR}/GeoLiteCityv6.dat ${D}/${datadir}/GeoIP/
51 ln -s GeoLiteCity.dat ${D}${datadir}/GeoIP/GeoIPCity.dat
52}
53
54PACKAGES =+ "${PN}-database"
55FILES_${PN}-database = ""
56FILES_${PN}-database += "${datadir}/GeoIP/*"
57
58# We cannot do much looking up without databases.
59#
60RDEPENDS_${PN} += "${PN}-database"
61
62inherit ptest
63
64do_configure_ptest() {
65 sed -i -e "s/noinst_PROGRAMS = /test_PROGRAMS = /g" \
66 -e 's:SRCDIR=\\"$(top_srcdir)\\":SRCDIR=\\"$(testdir)\\":' \
67 ${S}/test/Makefile.am
68
69 if ! grep "^testdir = " ${S}/test/Makefile.am ; then
70 sed -e '/EXTRA_PROGRAMS = /itestdir = ${PTEST_PATH}/tests' \
71 -i ${S}/test/Makefile.am
72 fi
73
74 sed -i -e "s:/usr/local/share:/usr/share:g" \
75 ${S}/test/benchmark.c
76
77 sed -i -e 's:"../data/:"/usr/share/GeoIP/:g' \
78 ${S}/test/test-geoip-city.c \
79 ${S}/test/test-geoip-isp.c \
80 ${S}/test/test-geoip-asnum.c \
81 ${S}/test/test-geoip-netspeed.c \
82 ${S}/test/test-geoip-org.c \
83 ${S}/test/test-geoip-region.c
84}
85
86
87do_install_ptest() {
88 oe_runmake -C test DESTDIR=${D} install-testPROGRAMS
89 install ${S}/test/*.txt ${D}${PTEST_PATH}/tests
90}