geoipupdate: Update to 7.0.1
authorTianling Shen <cnsztl@immortalwrt.org>
Tue, 30 Jul 2024 15:02:32 +0000 (23:02 +0800)
committerTianling Shen <cnsztl@gmail.com>
Sun, 4 Aug 2024 05:13:37 +0000 (13:13 +0800)
- do not touch default configuration
- put the binary into /usr/bin as it's not a "system" application
- update GO_PKG path
- remove useless init script[1]
- other minor clean up

1. The database directory will be automatically created by the program.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
net/geoipupdate/Makefile
net/geoipupdate/files/geoipupdate.init [deleted file]

index 4cb37a3a87ba440512d7bf518ee3691ee6a2e54b..d2424fd94fd78acfa6435c2e402a6d1de1fa8f39 100644 (file)
@@ -3,12 +3,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=geoipupdate
-PKG_VERSION:=4.9.0
+PKG_VERSION:=7.0.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/maxmind/geoipupdate/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=43195d457a372dc07be593d815212d6ea21e499a37a6111058efa3296759cba9
+PKG_HASH:=59c80ab737f128fc05e4ecdec4d84652182851dc8c8bea892022e3fc12db9101
 
 PKG_LICENSE:=Apache-2.0 MIT
 PKG_LICENSE_FILES:=LICENSE-APACHE LICENSE-MIT
@@ -18,19 +18,20 @@ PKG_BUILD_DEPENDS:=golang/host
 PKG_BUILD_PARALLEL:=1
 PKG_BUILD_FLAGS:=no-mips16
 
-GO_PKG:=github.com/maxmind/geoipupdate
+GO_PKG:=github.com/maxmind/geoipupdate/v7
 GO_PKG_LDFLAGS_X:= \
        main.defaultConfigFile=/etc/GeoIP.conf \
-       main.defaultDatabaseDirectory=/var/GeoIP
+       main.defaultDatabaseDirectory=/var/GeoIP \
+       main.version=$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
 include ../../lang/golang/golang-package.mk
 
 define Package/geoipupdate
-  TITLE:=GeoIP Update
-  URL:=https://github.com/maxmind/geoipupdate
   SECTION:=net
   CATEGORY:=Network
+  TITLE:=GeoIP Update
+  URL:=https://github.com/maxmind/geoipupdate
   DEPENDS:=$(GO_ARCH_DEPENDS)
 endef
 
@@ -46,17 +47,10 @@ define Package/geoipupdate/description
 endef
 
 define Package/geoipupdate/install
-       $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
-       
-       $(INSTALL_DIR) \
-       $(1)/usr/sbin \
-       $(1)/etc/init.d
+       $(call GoPackage/Package/Install/Bin,$(1))
 
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/geoipupdate $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc
        $(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/GeoIP.conf.default $(1)/etc/GeoIP.conf
-       $(INSTALL_BIN) ./files/geoipupdate.init $(1)/etc/init.d/geoipupdate
-
-       $(SED) "s/^EditionIDs GeoLite2-Country GeoLite2-City/EditionIDs GeoLite2-Country/" $(1)/etc/GeoIP.conf
 endef
 
 define Package/geoipupdate/conffiles
diff --git a/net/geoipupdate/files/geoipupdate.init b/net/geoipupdate/files/geoipupdate.init
deleted file mode 100644 (file)
index 9dd354f..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh /etc/rc.common
-
-START=99
-
-start() {
-       [ -d /var/GeoIP ] || {
-               mkdir -p /var/GeoIP
-       }
-}