Merge pull request #4825 from nxhack/node-hid_fix_depends
[feed/packages.git] / libs / libcoap / Makefile
1 #
2 # Copyright (C) 2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=libcoap
11 PKG_VERSION:=v4.1.2
12 PKG_RELEASE:=1
13
14 PKG_SOURCE_PROTO:=git
15 PKG_SOURCE_URL:=https://github.com/obgm/libcoap
16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)
17 PKG_SOURCE_VERSION:=fa5248603049ddf95cc84608aad569120763bf2b
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
19 PKG_MIRROR_HASH:=0ab4bc9569a78904743cc3074fd1c0fc9c78c85fd510fef5145dd872523619e6
20
21 PKG_MAINTAINER:=Anton Glukhov <anton.a.glukhov@gmail.com>
22 PKG_LICENSE:=GPL-2.0+ BSD-2-Clause
23 PKG_LICENSE_FILES:=COPYING LICENSE.GPL LICENSE.BSD
24
25 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
26
27 PKG_FIXUP:=autoreconf
28 PKG_INSTALL:=1
29
30 include $(INCLUDE_DIR)/package.mk
31
32 define Package/libcoap
33 SECTION:=libs
34 CATEGORY:=Libraries
35 TITLE:=CoAP (RFC 7252) library
36 URL:=http://libcoap.net/
37 endef
38
39 define Package/libcoap/description
40 Constrained Application Protocol (RFC 7252) library
41 endef
42
43 define Package/coap-client
44 SECTION:=utils
45 CATEGORY:=Utilities
46 DEPENDS:=+libcoap
47 TITLE:=CoAP (RFC 7252) client tool
48 endef
49
50 define Package/coap-client/description
51 Constrained Application Protocol (RFC7252) client tool
52 endef
53
54 define Package/coap-server
55 SECTION:=net
56 CATEGORY:=Network
57 DEPENDS:=+libcoap
58 TITLE:=CoAP (RFC 7252) server programs
59 endef
60
61 define Package/coap-server/description
62 Constrained Application Protocol (RFC 7252) server and resource directory server
63 endef
64
65 TARGET_CFLAGS += $(FPIC)
66
67 CONFIGURE_ARGS += \
68 --enable-examples \
69 --disable-documentation
70
71 ifeq ($(CONFIG_BIG_ENDIAN),y)
72 TARGET_CFLAGS += -DWORDS_BIGENDIAN
73 endif
74
75 define Build/InstallDev
76 $(INSTALL_DIR) $(1)/usr/include
77 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
78
79 $(INSTALL_DIR) $(1)/usr/lib
80 $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
81 endef
82
83 define Package/libcoap/install
84 $(INSTALL_DIR) $(1)/usr/lib
85 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcoap-1.so* $(1)/usr/lib/
86 endef
87
88 define Package/coap-client/install
89 $(INSTALL_DIR) $(1)/usr/bin
90 $(CP) $(PKG_INSTALL_DIR)/usr/bin/coap-client $(1)/usr/bin/
91 endef
92
93 define Package/coap-server/install
94 $(INSTALL_DIR) $(1)/usr/bin
95 $(CP) $(PKG_INSTALL_DIR)/usr/bin/coap-server $(1)/usr/bin/
96 $(CP) $(PKG_INSTALL_DIR)/usr/bin/coap-rd $(1)/usr/bin/
97 endef
98
99 $(eval $(call BuildPackage,libcoap))
100 $(eval $(call BuildPackage,coap-client))
101 $(eval $(call BuildPackage,coap-server))