geoip_1.6.9.bb 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. HOMEPAGE = "http://dev.maxmind.com/geoip/"
  8. SECTION = "libdevel"
  9. SRC_URI = "git://github.com/maxmind/geoip-api-c.git \
  10. http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz;apply=no;name=GeoIP-dat \
  11. http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz;apply=no;name=GeoIPv6-dat \
  12. http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz;apply=no;name=GeoLiteCity-dat \
  13. http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz;apply=no;name=GeoLiteCityv6-dat \
  14. file://run-ptest \
  15. "
  16. SRCREV = "4f487bf95532e0bba7783d591faff178ab0aa462"
  17. SRC_URI[GeoIP-dat.md5sum] = "37c84ead332dda0362a5ac7b049b72d4"
  18. SRC_URI[GeoIP-dat.sha256sum] = "79ff1099e96c2dc1c2539c9a18aaa13a9afd085cae477df60d95f1644d42bc07"
  19. SRC_URI[GeoIPv6-dat.md5sum] = "e75b84a4044e81d6d4484e33816bc762"
  20. SRC_URI[GeoIPv6-dat.sha256sum] = "a009b0f21968d2868e6dd19d14f3c3b8cd60ae84a4bfc2970df34d771a04811e"
  21. SRC_URI[GeoLiteCity-dat.md5sum] = "4b6588d0bfe1af22e267ac90aa97f769"
  22. SRC_URI[GeoLiteCity-dat.sha256sum] = "8a6467033a528f68b1a97de24d9d0ce86c8e8e83683820e16e433ddbd3f712f7"
  23. SRC_URI[GeoLiteCityv6-dat.md5sum] = "ad0cb42518af7f752499425dca0952bb"
  24. SRC_URI[GeoLiteCityv6-dat.sha256sum] = "eda67f4204ba9fa5204a53cdb629167cca9394c712f5378bc723a8c29c0b440f"
  25. LICENSE = "LGPL-2.1"
  26. LIC_FILES_CHKSUM = "file://COPYING;md5=243b725d71bb5df4a1e5920b344b86ad \
  27. file://LICENSE;md5=0388276749a542b0d611601fa7c1dcc8 "
  28. S = "${WORKDIR}/git"
  29. inherit autotools
  30. EXTRA_OECONF = "--disable-static \
  31. --disable-dependency-tracking "
  32. do_install() {
  33. make DESTDIR=${D} install
  34. install -d ${D}/${datadir}/GeoIP
  35. install ${WORKDIR}/GeoIP.dat ${D}/${datadir}/GeoIP/
  36. install ${WORKDIR}/GeoIPv6.dat ${D}/${datadir}/GeoIP/
  37. install ${WORKDIR}/GeoLiteCity.dat ${D}/${datadir}/GeoIP/
  38. install ${WORKDIR}/GeoLiteCityv6.dat ${D}/${datadir}/GeoIP/
  39. ln -s GeoLiteCity.dat ${D}${datadir}/GeoIP/GeoIPCity.dat
  40. }
  41. PACKAGES =+ "${PN}-database"
  42. FILES_${PN}-database = ""
  43. FILES_${PN}-database += "${datadir}/GeoIP/*"
  44. # We cannot do much looking up without databases.
  45. #
  46. RDEPENDS_${PN} += "${PN}-database"
  47. inherit ptest
  48. do_configure_ptest() {
  49. sed -i -e "s/noinst_PROGRAMS = /test_PROGRAMS = /g" \
  50. -e 's:SRCDIR=\\"$(top_srcdir)\\":SRCDIR=\\"$(testdir)\\":' \
  51. ${S}/test/Makefile.am
  52. if ! grep "^testdir = " ${S}/test/Makefile.am ; then
  53. sed -e '/EXTRA_PROGRAMS = /itestdir = ${PTEST_PATH}/tests' \
  54. -i ${S}/test/Makefile.am
  55. fi
  56. sed -i -e "s:/usr/local/share:/usr/share:g" \
  57. ${S}/test/benchmark.c
  58. sed -i -e 's:"../data/:"/usr/share/GeoIP/:g' \
  59. ${S}/test/test-geoip-city.c \
  60. ${S}/test/test-geoip-isp.c \
  61. ${S}/test/test-geoip-asnum.c \
  62. ${S}/test/test-geoip-netspeed.c \
  63. ${S}/test/test-geoip-org.c \
  64. ${S}/test/test-geoip-region.c
  65. }
  66. do_install_ptest() {
  67. oe_runmake -C test DESTDIR=${D} install-testPROGRAMS
  68. install ${S}/test/*.txt ${D}${PTEST_PATH}/tests
  69. }