forked from kenzok8/small-package
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
94 lines (75 loc) · 2.57 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# SPDX-License-Identifier: GPL-3.0-only
#
# Copyright (C) 2021-2022 sirpdboy <[email protected]> https://github.com/sirpdboy/luci-app-ddnsgo
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ddnsgo
PKG_VERSION:=5.0.5
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/jeessy2/ddns-go.git
PKG_SOURCE_VERSION:=947ff9832d62b856761805f4b3485275bb1c841f
PKG_MIRROR_HASH:=5f9f2453e755dd967130672d6584a0d9821fb4bb32e4337c78ab2d62f9e06e18
PKG_LICENSE:=AGPL-3.0-only
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=herboy2008 <[email protected]>
PKG_CONFIG_DEPENDS:= \
CONFIG_DDNS-GO_COMPRESS_GOPROXY \
CONFIG_DDNS-GO_COMPRESS_UPX
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
GO_PKG:=github.com/jeessy2/ddns-go/v5
GO_PKG_LDFLAGS:=-s -w
GO_PKG_LDFLAGS_X:=m.version=$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/ddnsgo
TITLE:=A Linux web GUI client of ddns-go
SECTION:=net
CATEGORY:=Network
SUBMENU:=Web Servers/Proxies
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
URL:=https://github.com/jeessy2/ddns-go
endef
define Package/$(PKG_NAME)/description
ddns-go is a automatically obtain your public IPv4 or IPv6 address and resolve it to the corresponding domain name service,
support Alidns Dnspod Cloudflare Hicloud Callback Baiducloud porkbun GoDaddy Google Domains.
endef
define Package/$(PKG_NAME)/config
config DDNS-GO_COMPRESS_GOPROXY
bool "Compiling with GOPROXY proxy"
default n
config DDNS-GO_COMPRESS_UPX
bool "Compress executable files with UPX"
depends on !mips64
default n
endef
ifeq ($(CONFIG_DDNS-GO_COMPRESS_GOPROXY),y)
export GO111MODULE=on
export GOPROXY=https://goproxy.baidu.com
endif
define Package/$(PKG_NAME)/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
[ -f /etc/uci-defaults/luci-ddns-go ] && /etc/uci-defaults/luci-ddns-go && rm -f /etc/uci-defaults/luci-ddns-go
fi
endef
define Build/Compile
$(call GoPackage/Build/Compile)
ifneq ($(CONFIG_DDNS-GO_COMPRESS_UPX),)
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/ddns-go
endif
endef
define Package/$(PKG_NAME)/install
$(call GoPackage/Package/Install/Bin,$(1))
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./file/ddnsgo.init $(1)/etc/init.d/ddnsgo
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./file/luci-ddns-go.uci-default $(1)/etc/uci-defaults/luci-ddns-go
endef
$(eval $(call GoBinPackage,ddnsgo))
$(eval $(call BuildPackage,ddnsgo))