This repository has been archived by the owner on Oct 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (52 loc) · 1.82 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
include $(TOPDIR)/rules.mk
PKG_NAME:=flowerss-bot
PKG_VERSION:=2021-06-21
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/indes/flowerss-bot.git
PKG_SOURCE_VERSION:=1c552b9dec9dc2d213602dde2b99591f11fe1ced
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
GO_PKG:=github.com/indes/flowerss-bot
GO_PKG_LDFLAGS_X:= \
$(GO_PKG)/config.commit=$(PKG_SOURCE_VERSION) \
$(GO_PKG)/config.date=$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
TITLE:=A telegram bot for rss reader (golang)
DEPENDS:=$(GO_ARCH_DEPENDS)
URL:=https://github.com/indes/flowerss-bot
SUBMENU:=Telegram Bot
endef
define Package/$(PKG_NAME)/description
A telegram bot for rss reader (Golang)
endef
define Build/Prepare
tar -zxvf $(DL_DIR)/$(PKG_SOURCE) -C $(BUILD_DIR)/$(PKG_NAME) --strip-components 1
endef
define Build/Configure
endef
define Build/Compile
$(eval GO_PKG_BUILD_PKG:=$(GO_PKG))
$(call GoPackage/Build/Configure)
$(call GoPackage/Build/Compile)
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/flowerss-bot || true
chmod +wx $(GO_PKG_BUILD_BIN_DIR)/flowerss-bot
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/flowerss-bot $(1)/usr/bin/flowerss-bot
$(INSTALL_DIR) $(1)/home/flowerss-bot
$(CP) ./files/config.yml.sample $(1)/home/flowerss-bot/config.yml.sample
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(CP) ./files/flowerss-bot $(1)/lib/upgrade/keep.d/flowerss-bot
endef
$(eval $(call GoBinPackage,$(PKG_NAME)))
$(eval $(call BuildPackage,$(PKG_NAME)))