From 98e24f1af940f46860c7b0c9dafb90df6fa3c31f Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Fri, 20 Mar 2020 04:36:45 +0800 Subject: [PATCH] simple-torrent: add package --- package/ctcgfw/simple-torrent/Makefile | 62 ++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 package/ctcgfw/simple-torrent/Makefile diff --git a/package/ctcgfw/simple-torrent/Makefile b/package/ctcgfw/simple-torrent/Makefile new file mode 100644 index 0000000000..3a7d384c7f --- /dev/null +++ b/package/ctcgfw/simple-torrent/Makefile @@ -0,0 +1,62 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=simple-torrent +PKG_VERSION:=2ae7de9 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/boypt/simple-torrent.git +PKG_SOURCE_VERSION:=2ae7de933624625e3d01c00ad2a3a3a524818b57 +PKG_MAINTAINER:=[CTCGFW] Project OpenWrt / CN_SZTL + +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(PKG_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:=cloud-torrent +GO_PKG_LDFLAGS:=-s -w +GO_PKG_LDFLAGS_X:= \ + main.VERSION=$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk + +define Package/$(PKG_NAME) + SECTION:=net + CATEGORY:=Network + SUBMENU:=BitTorrent + TITLE:=a self-hosted remote torrent client + URL:=https://github.com/ginuerzh/gost + DEPENDS:=$(GO_ARCH_DEPENDS) +endef + +define Package/$(PKG_NAME)/description + SimpleTorrent is a a self-hosted remote torrent client, written in Go (golang). + Started torrents remotely, download sets of files on the local disk of the server, which are then retrievable or streamable via HTTP. +endef + +define Build/Prepare + tar -zxf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --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)/cloud-torrent +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/cloud-torrent $(1)/usr/bin/simple-torrent +endef + +$(eval $(call GoBinPackage,$(PKG_NAME))) +$(eval $(call BuildPackage,$(PKG_NAME)))