Makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=libcoap
  9. PKG_VERSION:=v4.1.2
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=https://github.com/obgm/libcoap
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)
  14. PKG_SOURCE_VERSION:=fa5248603049ddf95cc84608aad569120763bf2b
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  16. PKG_MIRROR_HASH:=0ab4bc9569a78904743cc3074fd1c0fc9c78c85fd510fef5145dd872523619e6
  17. PKG_MAINTAINER:=Anton Glukhov <anton.a.glukhov@gmail.com>
  18. PKG_LICENSE:=GPL-2.0+ BSD-2-Clause
  19. PKG_LICENSE_FILES:=COPYING LICENSE.GPL LICENSE.BSD
  20. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
  21. PKG_FIXUP:=autoreconf
  22. PKG_INSTALL:=1
  23. include $(INCLUDE_DIR)/package.mk
  24. define Package/libcoap
  25. SECTION:=libs
  26. CATEGORY:=Libraries
  27. TITLE:=CoAP (RFC 7252) library
  28. URL:=http://libcoap.net/
  29. endef
  30. define Package/libcoap/description
  31. Constrained Application Protocol (RFC 7252) library
  32. endef
  33. define Package/coap-client
  34. SECTION:=utils
  35. CATEGORY:=Utilities
  36. DEPENDS:=+libcoap
  37. TITLE:=CoAP (RFC 7252) client tool
  38. endef
  39. define Package/coap-client/description
  40. Constrained Application Protocol (RFC7252) client tool
  41. endef
  42. define Package/coap-server
  43. SECTION:=net
  44. CATEGORY:=Network
  45. DEPENDS:=+libcoap
  46. TITLE:=CoAP (RFC 7252) server programs
  47. endef
  48. define Package/coap-server/description
  49. Constrained Application Protocol (RFC 7252) server and resource directory server
  50. endef
  51. TARGET_CFLAGS += $(FPIC)
  52. CONFIGURE_ARGS += \
  53. --enable-examples \
  54. --disable-documentation
  55. ifeq ($(CONFIG_BIG_ENDIAN),y)
  56. TARGET_CFLAGS += -DWORDS_BIGENDIAN
  57. endif
  58. define Build/InstallDev
  59. $(INSTALL_DIR) $(1)/usr/include
  60. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  61. $(INSTALL_DIR) $(1)/usr/lib
  62. $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
  63. endef
  64. define Package/libcoap/install
  65. $(INSTALL_DIR) $(1)/usr/lib
  66. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcoap-1.so* $(1)/usr/lib/
  67. endef
  68. define Package/coap-client/install
  69. $(INSTALL_DIR) $(1)/usr/bin
  70. $(CP) $(PKG_INSTALL_DIR)/usr/bin/coap-client $(1)/usr/bin/
  71. endef
  72. define Package/coap-server/install
  73. $(INSTALL_DIR) $(1)/usr/bin
  74. $(CP) $(PKG_INSTALL_DIR)/usr/bin/coap-server $(1)/usr/bin/
  75. $(CP) $(PKG_INSTALL_DIR)/usr/bin/coap-rd $(1)/usr/bin/
  76. endef
  77. $(eval $(call BuildPackage,libcoap))
  78. $(eval $(call BuildPackage,coap-client))
  79. $(eval $(call BuildPackage,coap-server))