Move libexpat, unbound into core and introduce hnsd
[librecmc/librecmc.git] / package / network / services / hnsd / Makefile
1 #
2 # Copyright (c) 2018 libreCMC Project <info@librecmc.org>
3 # Copyright (c) 2018 Robert Call <bob@bobcall.me>
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=hnsd
12 PKG_VERSION:=0.1
13 PKG_RELEASE:=1
14 PKG_LICENSE:=MIT
15
16 PKG_SOURCE_PROTO:=git
17 PKG_SOURCE_VERSION:=HEAD
18 PKG_SOURCE_URL:=https://github.com/handshake-org/hnsd
19 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
20 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22
23 PKG_FIXUP:=autoreconf
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/hnsd
27         SECTION:=net
28         CATEGORY:=Network
29         TITLE:=Handshake SPV
30         DEPENDS:=+libunbound +libunbound
31         MAINTAINER:=Robert Call <bob@bobcall.me>
32         URL:=https://handshake.org
33 endef
34
35 define Package/hnsd/description
36 SPV resolver daemon for the Handshake network.
37 endef
38
39 define Build/Configure
40         ( cd $(PKG_BUILD_DIR); ./autogen.sh )
41         $(call Build/Configure/Default)
42 endef
43
44 define Build/Compile
45         +$(MAKE) -C $(PKG_BUILD_DIR) \
46                 CC="$(TARGET_CC)" \
47                 CXXFLAGS="$(TARGET_CXX)" \
48                 CFLAGS="$(TARGET_CFLAGS)" \
49                 LD="$(TARGET_CC)" \
50                 LDLIBS="$(LDLIBS)" \
51                 LDFLAGS="$(TARGET_LDFLAGS)"
52                 CROSS_COMPILE="$(TARGET_CROSS)" \
53                 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
54                 ARCH="$(ARCH)"
55
56 endef
57
58 define Package/hnsd/install
59         $(INSTALL_DIR) $(1)/usr/sbin
60         $(INSTALL_BIN) $(PKG_BUILD_DIR)/hnsd $(1)/usr/sbin/
61
62 endef
63
64 $(eval $(call BuildPackage,hnsd))