diff options
author | Joe Slater <jslater@windriver.com> | 2016-01-12 14:56:04 -0800 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2016-01-20 21:41:47 -0500 |
commit | a9c2fe6cd1fe7dd8555772cd2bfde2952e8de564 (patch) | |
tree | e045e3cb62dad6ba17376fca5d04d1dbacfa4402 /meta-networking/recipes-support/geoip | |
parent | 514149c972489479dbb3f9babf4f6257c5dd5ab6 (diff) | |
download | meta-openembedded-a9c2fe6cd1fe7dd8555772cd2bfde2952e8de564.tar.gz |
geoip: add ptest functionality
Also make geoip package rdepend on geoip-database and
add symbolic link to GeoIPCity.dat.
Signed-off-by: Joe Slater <jslater@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-support/geoip')
-rw-r--r-- | meta-networking/recipes-support/geoip/files/run-ptest | 11 | ||||
-rw-r--r-- | meta-networking/recipes-support/geoip/geoip_1.6.6.bb | 38 |
2 files changed, 49 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/geoip/files/run-ptest b/meta-networking/recipes-support/geoip/files/run-ptest new file mode 100644 index 000000000..14e96191f --- /dev/null +++ b/meta-networking/recipes-support/geoip/files/run-ptest | |||
@@ -0,0 +1,11 @@ | |||
1 | #!/bin/sh | ||
2 | pdir=`dirname $0` | ||
3 | cd ${pdir}/tests | ||
4 | for i in ./benchmark ./test-geoip-city ; do | ||
5 | ${i} 1>/dev/null 2>&1; | ||
6 | if [ $? == 0 ]; then | ||
7 | echo PASS: $i; | ||
8 | else | ||
9 | echo FAIL: $i; | ||
10 | fi; | ||
11 | done | ||
diff --git a/meta-networking/recipes-support/geoip/geoip_1.6.6.bb b/meta-networking/recipes-support/geoip/geoip_1.6.6.bb index 5037ae300..06051542c 100644 --- a/meta-networking/recipes-support/geoip/geoip_1.6.6.bb +++ b/meta-networking/recipes-support/geoip/geoip_1.6.6.bb | |||
@@ -13,6 +13,7 @@ SRC_URI = "git://github.com/maxmind/geoip-api-c.git \ | |||
13 | http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz;apply=no;name=GeoIPv6-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 \ | 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 \ | 15 | http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz;apply=no;name=GeoLiteCityv6-dat \ |
16 | file://run-ptest \ | ||
16 | " | 17 | " |
17 | SRCREV = "ed3f3e2b87fba05a8f2a5b9b1328e7d55be8bf30" | 18 | SRCREV = "ed3f3e2b87fba05a8f2a5b9b1328e7d55be8bf30" |
18 | 19 | ||
@@ -47,9 +48,46 @@ do_install() { | |||
47 | install ${WORKDIR}/GeoIPv6.dat ${D}/${datadir}/GeoIP/ | 48 | install ${WORKDIR}/GeoIPv6.dat ${D}/${datadir}/GeoIP/ |
48 | install ${WORKDIR}/GeoLiteCity.dat ${D}/${datadir}/GeoIP/ | 49 | install ${WORKDIR}/GeoLiteCity.dat ${D}/${datadir}/GeoIP/ |
49 | install ${WORKDIR}/GeoLiteCityv6.dat ${D}/${datadir}/GeoIP/ | 50 | install ${WORKDIR}/GeoLiteCityv6.dat ${D}/${datadir}/GeoIP/ |
51 | ln -s GeoLiteCity.dat ${D}${datadir}/GeoIP/GeoIPCity.dat | ||
50 | } | 52 | } |
51 | 53 | ||
52 | PACKAGES =+ "${PN}-database" | 54 | PACKAGES =+ "${PN}-database" |
53 | FILES_${PN}-database = "" | 55 | FILES_${PN}-database = "" |
54 | FILES_${PN}-database += "${datadir}/GeoIP/*" | 56 | FILES_${PN}-database += "${datadir}/GeoIP/*" |
55 | 57 | ||
58 | # We cannot do much looking up without databases. | ||
59 | # | ||
60 | RDEPENDS_${PN} += "${PN}-database" | ||
61 | |||
62 | inherit ptest | ||
63 | |||
64 | do_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 | |||
87 | do_install_ptest() { | ||
88 | oe_runmake -C test DESTDIR=${D} install-testPROGRAMS | ||
89 | install ${S}/test/*.txt ${D}${PTEST_PATH}/tests | ||
90 | } | ||
91 | |||
92 | |||
93 | |||