Skip to contentSkip to conversation

geoip: new package

PATCH New Gustavo Zacarias 3 participants 9 messages Jun 17, 2014 – Jun 23, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 geoip: new package

---
 package/Config.in       |  1 +
 package/geoip/Config.in | 11 +++++++++++
 package/geoip/geoip.mk  | 15 +++++++++++++++
 3 files changed, 27 insertions(+)
 create mode 100644 package/geoip/Config.in
 create mode 100644 package/geoip/geoip.mk
package/Config.in +1 -0
index 9231c45..d9bd23d 100644
@@ -719,6 +719,7 @@ menu "Networking"
 	source "package/czmq/Config.in"
 	source "package/filemq/Config.in"
 	source "package/fmlib/Config.in"
+	source "package/geoip/Config.in"
 	source "package/glib-networking/Config.in"
 	source "package/libcgi/Config.in"
 	source "package/libcgicc/Config.in"
package/geoip/Config.in new file +11 -0
new file mode 100644
index 0000000..a198a31
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_GEOIP
+	bool "geoip"
+	help
+	  GeoIP is a C library that enables the user to find geographical
+	  and network information of an IP address.
+	  To use this library, you need to download MaxMind's free GeoLite or
+	  commercial GeoIP binary databases into the target's /usr/share/GeoIP
+	  directory in uncompressed form.
+	  Note that GeoIP2 / GeoLite2 are not supported by this library.
+
+	  https://github.com/maxmind/geoip-api-c
package/geoip/geoip.mk new file +15 -0
new file mode 100644
index 0000000..fde07cb
@@ -0,0 +1,15 @@
+################################################################################
+#
+# geoip
+#
+################################################################################
+
+GEOIP_VERSION = 1.6.0
+GEOIP_SOURCE = GeoIP-$(GEOIP_VERSION).tar.gz
+GEOIP_SITE = $(call github,maxmind,geoip-api-c,v$(GEOIP_VERSION))
+GEOIP_AUTORECONF = YES
+GEOIP_INSTALL_STAGING = YES
+GEOIP_LICENSE = LGPLv2.1+
+GEOIP_LICENSE_FILES = COPYING
+
+$(eval $(autotools-package))
Signature · 1 line
1.8.5.5
#1 lore raw

PATCH v2 2/2 php-geoip: new package

---
 package/Config.in              |  1 +
 package/php-geoip/Config.in    |  8 ++++++++
 package/php-geoip/php-geoip.mk | 26 ++++++++++++++++++++++++++
 3 files changed, 35 insertions(+)
 create mode 100644 package/php-geoip/Config.in
 create mode 100644 package/php-geoip/php-geoip.mk
package/Config.in +1 -0
index d9bd23d..8bdbe4c 100644
@@ -429,6 +429,7 @@ endif
 if BR2_PACKAGE_PHP
 if !BR2_PREFER_STATIC_LIB
 menu "External php extensions"
+	source "package/php-geoip/Config.in"
 	source "package/php-gnupg/Config.in"
 	source "package/php-imagick/Config.in"
 	source "package/php-ssh2/Config.in"
package/php-geoip/Config.in new file +8 -0
new file mode 100644
index 0000000..adb2046
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_PHP_GEOIP
+	bool "php-geoip"
+	depends on BR2_PACKAGE_PHP
+	select BR2_PACKAGE_GEOIP
+	help
+	  PHP GeoIP-based IP address mapper to geographical places.
+
+	  http://pecl.php.net/package/geoip
package/php-geoip/php-geoip.mk new file +26 -0
new file mode 100644
index 0000000..99f74e0
@@ -0,0 +1,26 @@
+################################################################################
+#
+# php-geoip
+#
+################################################################################
+
+PHP_GEOIP_VERSION = 1.1.0
+PHP_GEOIP_SOURCE = geoip-$(PHP_GEOIP_VERSION).tgz
+PHP_GEOIP_SITE = http://pecl.php.net/get
+PHP_GEOIP_CONF_OPT = --with-php-config=$(STAGING_DIR)/usr/bin/php-config \
+	--with-geoip=$(STAGING_DIR)/usr
+# phpize does the autoconf magic
+PHP_GEOIP_DEPENDENCIES = geoip php host-autoconf
+PHP_GEOIP_LICENSE = PHP
+PHP_GEOIP_LICENSE_FILES = LICENSE
+
+define PHP_GEOIP_PHPIZE
+	(cd $(@D); \
+		PHP_AUTOCONF=$(HOST_DIR)/usr/bin/autoconf \
+		PHP_AUTOHEADER=$(HOST_DIR)/usr/bin/autoheader \
+		$(STAGING_DIR)/usr/bin/phpize)
+endef
+
+PHP_GEOIP_PRE_CONFIGURE_HOOKS += PHP_GEOIP_PHPIZE
+
+$(eval $(autotools-package))
Signature · 1 line
1.8.5.5
#2 lore raw

PATCH v2 2/2 php-geoip: new package

Dear Gustavo Zacarias,

Quoted 8 lines · Gustavo Zacarias
---
 package/Config.in              |  1 +
 package/php-geoip/Config.in    |  8 ++++++++
 package/php-geoip/php-geoip.mk | 26 ++++++++++++++++++++++++++
 3 files changed, 35 insertions(+)
 create mode 100644 package/php-geoip/Config.in
 create mode 100644 package/php-geoip/php-geoip.mk

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH v2 1/2 geoip: new package

In reply to Gustavo Zacarias

Dear Gustavo Zacarias,

Quoted 8 lines · Gustavo Zacarias
---
 package/Config.in       |  1 +
 package/geoip/Config.in | 11 +++++++++++
 package/geoip/geoip.mk  | 15 +++++++++++++++
 3 files changed, 27 insertions(+)
 create mode 100644 package/geoip/Config.in
 create mode 100644 package/geoip/geoip.mk

Thanks, applied. One comment below.

package/geoip/Config.in line 8

Quoted 5 lines
package/geoip/Config.in new file +5 -0
+	  GeoIP is a C library that enables the user to find geographical
+	  and network information of an IP address.
+	  To use this library, you need to download MaxMind's free GeoLite or
+	  commercial GeoIP binary databases into the target's /usr/share/GeoIP
+	  directory in uncompressed form.

Wouldn't it make sense to create a package for the free database, so that GeoIP can be useful out of the box?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH v2 1/2 geoip: new package

Quoted 8 lines · Thomas Petazzoni

package/geoip/Config.in line 8

Quoted 5 lines
package/geoip/Config.in new file +5 -0
+	  GeoIP is a C library that enables the user to find geographical
+	  and network information of an IP address.
+	  To use this library, you need to download MaxMind's free GeoLite or
+	  commercial GeoIP binary databases into the target's /usr/share/GeoIP
+	  directory in uncompressed form.

Wouldn't it make sense to create a package for the free database, so that GeoIP can be useful out of the box?

As the current infra is right now, not really, even with fixes i wouldn't go for it.
That's because the tarball naming is fixed (no hash, timestamp or anything) and they change at least daily, so an old sources.buildroot.net copy/mirror could be really old.
Even if we can say "don't mirror it" the same can happen to people with their local copy.
Regards.

#5 lore raw

PATCH v2 1/2 geoip: new package

Gustavo, All,

On 2014-06-22 19:34 -0300, Gustavo Zacarias spake thusly:

Quoted 11 lines · Thomas Petazzoni
Quoted 9 lines

package/geoip/Config.in line 8

Quoted 6 lines
package/geoip/Config.in new file +5 -0
+	  GeoIP is a C library that enables the user to find geographical
+	  and network information of an IP address.
+	  To use this library, you need to download MaxMind's free GeoLite or
+	  commercial GeoIP binary databases into the target's /usr/share/GeoIP
+	  directory in uncompressed form.

Wouldn't it make sense to create a package for the free database, so that GeoIP can be useful out of the box?

Quoted 7 lines

As the current infra is right now, not really, even with fixes i wouldn't go for it.
That's because the tarball naming is fixed (no hash, timestamp or anything) and they change at least daily, so an old sources.buildroot.net copy/mirror could be really old.
Even if we can say "don't mirror it" the same can happen to people with their local copy.

Then would it make sense to package geoipudate instead, either or both as a target and/or a host package:
https://github.com/maxmind/geoipupdate

The GeoIP Update program performs automatic updates of GeoIP2 and GeoIP Legacy binary databases.

That way, the user can get it with a post-build script, and/or a cron-like job on the target, to be up-to-date.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH v2 1/2 geoip: new package

Quoted 9 lines · Yann E. MORIN

Then would it make sense to package geoipudate instead, either or both as a target and/or a host package:
https://github.com/maxmind/geoipupdate

The GeoIP Update program performs automatic updates of GeoIP2 and GeoIP Legacy binary databases.

That way, the user can get it with a post-build script, and/or a cron-like job on the target, to be up-to-date.

Geoipupdate is for commercial users AFAIK, i have no such access/account to test the package. You need to configure a maxmind user/password to make it work, it's not an out-of-the-box experience.
Someone who has might be interested to make it though. Regards.

#7 lore raw

PATCH v2 1/2 geoip: new package

Gustavo, All,

On 2014-06-22 19:47 -0300, Gustavo Zacarias spake thusly:

Quoted 8 lines · Yann E. MORIN
Quoted 7 lines

Then would it make sense to package geoipudate instead, either or both as a target and/or a host package:
https://github.com/maxmind/geoipupdate

The GeoIP Update program performs automatic updates of GeoIP2 and GeoIP Legacy binary databases.

Quoted 6 lines
Quoted 2 lines

That way, the user can get it with a post-build script, and/or a cron-like job on the target, to be up-to-date.

Geoipupdate is for commercial users AFAIK, i have no such access/account to test the package. You need to configure a maxmind user/password to make it work, it's not an out-of-the-box experience.

Well, I don't see where the problem lies. There's nothing that prevents us from packaging geoipupdate, even if it requires a runtime configuration with a login+password.

That's basically the same as for a webserver: we do package more than one webserver, but the user is still responsible for providing the content of the server-root.

Quoted 1 line

Someone who has might be interested to make it though.

I agree with you on that. ;-)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#8 lore raw

PATCH v2 1/2 geoip: new package

Quoted 11 lines · Yann E. MORIN
Quoted 3 lines

Geoipupdate is for commercial users AFAIK, i have no such access/account to test the package. You need to configure a maxmind user/password to make it work, it's not an out-of-the-box experience.

Well, I don't see where the problem lies. There's nothing that prevents us from packaging geoipupdate, even if it requires a runtime configuration with a login+password.

That's basically the same as for a webserver: we do package more than one webserver, but the user is still responsible for providing the content of the server-root.

I disagree a bit there, but then people are free to do what they like, like shipping a probably toughly-licensed user/pass combination in plaintext in a firmware which someone else can pick up and use let's say in shady terms :)
It's mostly intended for servers where access is restricted and that wouldn't happen normally.

Quoted 3 lines
Quoted 1 line

Someone who has might be interested to make it though.

I agree with you on that. ;-)

I like to test new packages a bit, and getting the help just doesn't feel like a proper test, hence my reluctance ;)
Regards.