Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | SUMMARY = "C library for country/city/organization to IP address or hostname mapping" |
| 2 | DESCRIPTION = "GeoIP is a C library that enables the user to find the country that any IP \ |
| 3 | address or hostname originates from. It uses a file based database that is \ |
| 4 | accurate as of March 2003. This database simply contains IP blocks as keys, and \ |
| 5 | countries as values. This database should be more complete and accurate than \ |
| 6 | using reverse DNS lookups." |
| 7 | |
| 8 | HOMEPAGE = "http://dev.maxmind.com/geoip/" |
| 9 | SECTION = "libdevel" |
| 10 | |
| 11 | GEOIP_DATABASE_VERSION = "20181205" |
| 12 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 13 | SRC_URI = "git://github.com/maxmind/geoip-api-c.git;branch=main;protocol=https \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 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 | " |
| 20 | SRCREV = "4b526e7331ca1d692b74a0509ddcc725622ed31a" |
| 21 | |
| 22 | SRC_URI[GeoIP-dat.md5sum] = "d538e57ad9268fdc7955c6cf9a37c4a9" |
| 23 | SRC_URI[GeoIP-dat.sha256sum] = "b9c05eb8bfcf90a6ddfdc6815caf40a8db2710f0ce3dd48fbd6c24d485ae0449" |
| 24 | |
| 25 | SRC_URI[GeoIPv6-dat.md5sum] = "52d6aa0aac1adbfa5eb7fa4742197c11" |
| 26 | SRC_URI[GeoIPv6.sha256sum] = "416ac92fcc35a21d5efbb32e5c88e609c37aec1aa1af6247d088b8da1af6e9bf" |
| 27 | |
| 28 | SRC_URI[GeoLiteCity-dat.md5sum] = "d700c137232f8e077ac8db8577f699d9" |
| 29 | SRC_URI[GeoLiteCity-dat.sha256sum] = "90db2e52195e3d1bcdb2c2789209006d09de5c742812dbd9a1b36c12675ec4cd" |
| 30 | |
| 31 | SRC_URI[GeoLiteCityv6-dat.md5sum] = "6734ccdc644fc0ba76eb276dce73d005" |
| 32 | SRC_URI[GeoLiteCityv6-dat.sha256sum] = "c95a9d2643b7f53d7abeed2114388870e13fbbad4653f450a49efa7e4b86aca4" |
| 33 | |
| 34 | LICENSE = "LGPL-2.1" |
| 35 | |
| 36 | LIC_FILES_CHKSUM = "file://COPYING;md5=243b725d71bb5df4a1e5920b344b86ad \ |
| 37 | file://LICENSE;md5=0388276749a542b0d611601fa7c1dcc8 " |
| 38 | |
| 39 | S = "${WORKDIR}/git" |
| 40 | |
| 41 | inherit autotools |
| 42 | |
| 43 | EXTRA_OECONF = "--disable-static \ |
| 44 | --disable-dependency-tracking " |
| 45 | |
| 46 | do_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 | |
| 56 | PACKAGES =+ "${PN}-database" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 57 | FILES:${PN}-database = "" |
| 58 | FILES:${PN}-database += "${datadir}/GeoIP/*" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 59 | |
| 60 | # We cannot do much looking up without databases. |
| 61 | # |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 62 | RDEPENDS:${PN} += "${PN}-database" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 63 | |
| 64 | inherit ptest |
| 65 | |
| 66 | do_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 | |
| 89 | do_install_ptest() { |
| 90 | oe_runmake -C test DESTDIR=${D} install-testPROGRAMS |
| 91 | install ${S}/test/*.txt ${D}${PTEST_PATH}/tests |
| 92 | } |