Merge pull request #22041 from jefferyto/python-cryptodomex-3.18.0
[feed/packages.git] / utils / syncthing / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=syncthing
4 PKG_VERSION:=1.24.0
5 PKG_RELEASE:=1
6
7 PKG_SOURCE:=syncthing-source-v$(PKG_VERSION).tar.gz
8 PKG_SOURCE_URL:=https://github.com/syncthing/syncthing/releases/download/v$(PKG_VERSION)
9 PKG_HASH:=4a9459667f9b70a7d1e7d572c7c9d02431ef8f055679eef368300ce1a826608f
10
11 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/$(PKG_NAME)
12
13 PKG_MAINTAINER:=Paul Spooren <mail@aparcar.org>
14 PKG_LICENSE:=MPL-2.0
15 PKG_LICENSE_FILES:=LICENSE
16 PKG_CPE_ID:=cpe:/a:syncthing:syncthing
17
18 PKG_BUILD_DEPENDS:=golang/host
19 PKG_BUILD_PARALLEL:=1
20 PKG_BUILD_FLAGS:=no-mips16
21
22 GO_PKG:=github.com/syncthing/syncthing
23 GO_PKG_BUILD_PKG:=\
24 $(if $(CONFIG_PACKAGE_syncthing),$(GO_PKG)/cmd/syncthing/) \
25 $(if $(CONFIG_PACKAGE_stdiscosrv),$(GO_PKG)/cmd/stdiscosrv/) \
26 $(if $(CONFIG_PACKAGE_strelaysrv),$(GO_PKG)/cmd/strelaysrv/)
27 GO_PKG_INSTALL_EXTRA:=^gui/
28
29 GO_PKG_TAGS:=noupgrade
30 GO_PKG_LDFLAGS_X:=\
31 $(GO_PKG)/lib/build.Version=v$(PKG_VERSION) \
32 $(GO_PKG)/lib/build.Stamp=$(SOURCE_DATE_EPOCH) \
33 $(GO_PKG)/lib/build.User=openwrt \
34 $(GO_PKG)/lib/build.Host=openwrt \
35 $(GO_PKG)/lib/build.Tags=$(GO_PKG_TAGS)
36
37 include $(INCLUDE_DIR)/package.mk
38 include ../../lang/golang/golang-package.mk
39
40 define Package/syncthing/Default
41 URL:=https://syncthing.net
42 DEPENDS:=$(GO_ARCH_DEPENDS)
43 SECTION:=utils
44 CATEGORY:=Utilities
45 endef
46
47 define Package/syncthing
48 $(call Package/syncthing/Default)
49 TITLE:=Continuous file synchronization program
50 USERID:=syncthing=499:syncthing=499
51 endef
52
53 define Package/stdiscosrv
54 $(call Package/syncthing/Default)
55 TITLE:=Discovery server for syncthing
56 endef
57
58 define Package/strelaysrv
59 $(call Package/syncthing/Default)
60 TITLE:=Relay server for syncthing
61 endef
62
63 define Package/syncthing/conffiles
64 /etc/config/syncthing
65 /etc/syncthing
66 endef
67
68 define Package/stdiscosrv/conffiles
69 /etc/config/stdiscosrv
70 /etc/stdiscosrv
71 endef
72
73 define Package/strelaysrv/conffiles
74 /etc/config/strelaysrv
75 /etc/strelaysrv
76 endef
77
78 define Package/syncthing/description
79 Syncthing replaces proprietary sync and cloud services with something
80 open, trustworthy and decentralized. Your data is your data alone and
81 you deserve to choose where it is stored, if it is shared with some
82 third party and how it's transmitted over the Internet.
83 endef
84
85 define Package/stdiscosrv/description
86 Relay server for syncthing
87 endef
88
89 define Package/strelaysrv/description
90 Relay server for syncthing
91 endef
92
93 define SyncthingInstall
94 $(INSTALL_DIR) $(1)/etc/$(2)
95
96 $(INSTALL_DIR) $(1)/etc/config/
97 $(INSTALL_CONF) $(CURDIR)/files/$(2).conf $(1)/etc/config/$(2)
98
99 $(INSTALL_DIR) $(1)/etc/init.d/
100 $(INSTALL_BIN) $(CURDIR)/files/$(2).init $(1)/etc/init.d/$(2)
101
102 $(INSTALL_DIR) $(1)/usr/bin/
103 $(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/$(2) $(1)/usr/bin
104 endef
105
106
107 define Package/syncthing/install
108 $(call SyncthingInstall,$(1),syncthing)
109
110 $(INSTALL_DIR) $(1)/etc/sysctl.d/
111 $(INSTALL_BIN) $(CURDIR)/files/syncthing-sysctl.conf $(1)/etc/sysctl.d/90-syncthing-inotify.conf
112 endef
113
114 define Package/stdiscosrv/install
115 $(call SyncthingInstall,$(1),stdiscosrv)
116 endef
117
118 define Package/strelaysrv/install
119 $(call SyncthingInstall,$(1),strelaysrv)
120 endef
121
122 $(eval $(call BuildPackage,syncthing))
123 $(eval $(call BuildPackage,stdiscosrv))
124 $(eval $(call BuildPackage,strelaysrv))