You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.9 KiB

  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. include $(TOPDIR)/rules.mk
  3. PKG_NAME:=geoipupdate
  4. PKG_VERSION:=4.8.0
  5. PKG_RELEASE:=1
  6. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  7. PKG_SOURCE_URL:=https://codeload.github.com/maxmind/geoipupdate/tar.gz/v$(PKG_VERSION)?
  8. PKG_HASH:=ca718c3ffcc595ef441363699888d20150f1d3a6583ac2d60bcbd34f052db09f
  9. PKG_LICENSE:=Apache-2.0 MIT
  10. PKG_LICENSE_FILES:=LICENSE-APACHE LICENSE-MIT
  11. PKG_MAINTAINER:=Matthew Hagan <mnhagan88@gmail.com>
  12. PKG_BUILD_DEPENDS:=golang/host
  13. PKG_BUILD_PARALLEL:=1
  14. PKG_USE_MIPS16:=0
  15. GO_PKG:=github.com/maxmind/geoipupdate
  16. GO_PKG_LDFLAGS_X:= \
  17. main.defaultConfigFile=/etc/GeoIP.conf \
  18. main.defaultDatabaseDirectory=/var/GeoIP
  19. include $(INCLUDE_DIR)/package.mk
  20. include ../../lang/golang/golang-package.mk
  21. define Package/geoipupdate
  22. TITLE:=GeoIP Update
  23. URL:=https://github.com/maxmind/geoipupdate
  24. SECTION:=net
  25. CATEGORY:=Network
  26. DEPENDS:=$(GO_ARCH_DEPENDS)
  27. endef
  28. define Package/geoipupdate/description
  29. The GeoIP Update program performs automatic updates of GeoIP2 and GeoIP
  30. Legacy binary databases. CSV databases are not supported.
  31. Users will need to update /etc/GeoIP.conf with their API key and DB
  32. choice, currently set to country only. To update the DB, the user can
  33. manually run the utility or set up a cron job.
  34. This package contains the program and config file.
  35. endef
  36. define Package/geoipupdate/install
  37. $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
  38. $(INSTALL_DIR) \
  39. $(1)/usr/sbin \
  40. $(1)/etc/init.d
  41. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/geoipupdate $(1)/usr/sbin/
  42. $(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/GeoIP.conf.default $(1)/etc/GeoIP.conf
  43. $(INSTALL_BIN) ./files/geoipupdate.init $(1)/etc/init.d/geoipupdate
  44. $(SED) "s/^EditionIDs GeoLite2-Country GeoLite2-City/EditionIDs GeoLite2-Country/" $(1)/etc/GeoIP.conf
  45. endef
  46. define Package/geoipupdate/conffiles
  47. /etc/GeoIP.conf
  48. endef
  49. $(eval $(call GoBinPackage,geoipupdate))
  50. $(eval $(call BuildPackage,geoipupdate))