1SUMMARY = "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 11GEOIP_DATABASE_VERSION = "20181205" 12 13SRC_URI = "git://github.com/maxmind/geoip-api-c.git;branch=main;protocol=https \ 14 http://sources.openembedded.org/GeoIP.dat.${GEOIP_DATABASE_VERSION}.gz;apply=no;name=GeoIP-dat; \ 15 http://sources.openembedded.org/GeoIPv6.dat.${GEOIP_DATABASE_VERSION}.gz;apply=no;name=GeoIPv6-dat; \ 16 http://sources.openembedded.org/GeoLiteCity.dat.${GEOIP_DATABASE_VERSION}.gz;apply=no;name=GeoLiteCity-dat; \ 17 http://sources.openembedded.org/GeoLiteCityv6.dat.${GEOIP_DATABASE_VERSION}.gz;apply=no;name=GeoLiteCityv6-dat; \ 18 file://run-ptest \ 19" 20SRCREV = "4b526e7331ca1d692b74a0509ddcc725622ed31a" 21 22SRC_URI[GeoIP-dat.md5sum] = "d538e57ad9268fdc7955c6cf9a37c4a9" 23SRC_URI[GeoIP-dat.sha256sum] = "b9c05eb8bfcf90a6ddfdc6815caf40a8db2710f0ce3dd48fbd6c24d485ae0449" 24 25SRC_URI[GeoIPv6-dat.md5sum] = "52d6aa0aac1adbfa5eb7fa4742197c11" 26SRC_URI[GeoIPv6.sha256sum] = "416ac92fcc35a21d5efbb32e5c88e609c37aec1aa1af6247d088b8da1af6e9bf" 27 28SRC_URI[GeoLiteCity-dat.md5sum] = "d700c137232f8e077ac8db8577f699d9" 29SRC_URI[GeoLiteCity-dat.sha256sum] = "90db2e52195e3d1bcdb2c2789209006d09de5c742812dbd9a1b36c12675ec4cd" 30 31SRC_URI[GeoLiteCityv6-dat.md5sum] = "6734ccdc644fc0ba76eb276dce73d005" 32SRC_URI[GeoLiteCityv6-dat.sha256sum] = "c95a9d2643b7f53d7abeed2114388870e13fbbad4653f450a49efa7e4b86aca4" 33 34LICENSE = "LGPL-2.1-only" 35 36LIC_FILES_CHKSUM = "file://COPYING;md5=243b725d71bb5df4a1e5920b344b86ad \ 37 file://LICENSE;md5=0388276749a542b0d611601fa7c1dcc8 " 38 39S = "${WORKDIR}/git" 40 41inherit autotools 42 43EXTRA_OECONF = "--disable-static \ 44 --disable-dependency-tracking " 45 46do_install() { 47 make DESTDIR=${D} install 48 install -d ${D}/${datadir}/GeoIP 49 install ${WORKDIR}/GeoIP.dat.${GEOIP_DATABASE_VERSION} ${D}/${datadir}/GeoIP/GeoIP.dat 50 install ${WORKDIR}/GeoIPv6.dat.${GEOIP_DATABASE_VERSION} ${D}/${datadir}/GeoIP/GeoIPv6.dat 51 install ${WORKDIR}/GeoLiteCity.dat.${GEOIP_DATABASE_VERSION} ${D}/${datadir}/GeoIP/GeoLiteCity.dat 52 install ${WORKDIR}/GeoLiteCityv6.dat.${GEOIP_DATABASE_VERSION} ${D}/${datadir}/GeoIP/GeoLiteCityv6.dat 53 ln -s GeoLiteCity.dat ${D}${datadir}/GeoIP/GeoIPCity.dat 54} 55 56PACKAGES =+ "${PN}-database" 57FILES:${PN}-database = "" 58FILES:${PN}-database += "${datadir}/GeoIP/*" 59 60# We cannot do much looking up without databases. 61# 62RDEPENDS:${PN} += "${PN}-database" 63 64inherit ptest 65 66do_configure_ptest() { 67 sed -i -e "s/noinst_PROGRAMS = /test_PROGRAMS = /g" \ 68 -e 's:SRCDIR=\\"$(top_srcdir)\\":SRCDIR=\\"$(testdir)\\":' \ 69 ${S}/test/Makefile.am 70 71 if ! grep "^testdir = " ${S}/test/Makefile.am ; then 72 sed -e '/EXTRA_PROGRAMS = /itestdir = ${PTEST_PATH}/tests' \ 73 -i ${S}/test/Makefile.am 74 fi 75 76 sed -i -e "s:/usr/local/share:/usr/share:g" \ 77 ${S}/test/benchmark.c 78 79 sed -i -e 's:"../data/:"/usr/share/GeoIP/:g' \ 80 ${S}/test/test-geoip-city.c \ 81 ${S}/test/test-geoip-isp.c \ 82 ${S}/test/test-geoip-asnum.c \ 83 ${S}/test/test-geoip-netspeed.c \ 84 ${S}/test/test-geoip-org.c \ 85 ${S}/test/test-geoip-region.c 86} 87 88 89do_install_ptest() { 90 oe_runmake -C test DESTDIR=${D} install-testPROGRAMS 91 install ${S}/test/*.txt ${D}${PTEST_PATH}/tests 92} 93