You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.3 KiB

  1. #
  2. # Copyright (C) 2017 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:=libyang
  9. PKG_VERSION:=0.13.46
  10. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  11. PKG_LICENSE:=GPL-2.0+
  12. PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
  13. PKG_SOURCE_PROTO:=git
  14. PKG_SOURCE_VERSION:=d1556e0ae3872d676dfd63bd6073fe7e72d0130f
  15. PKG_MIRROR_HASH:=4a23a3854ceca147e113ab65ecdce3371e30b59436680e7d981b0bab6dbe751d
  16. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
  17. PKG_SOURCE_URL:=https://github.com/CESNET/libyang.git
  18. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
  19. PKG_BUILD_ROOT:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
  20. PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)
  21. PKG_BUILD_PARALLEL:=1
  22. PKG_INSTALL:=1
  23. include $(INCLUDE_DIR)/package.mk
  24. include $(INCLUDE_DIR)/cmake.mk
  25. define Package/libyang
  26. SECTION:=libs
  27. CATEGORY:=Libraries
  28. TITLE:=YANG data modeling language library
  29. URL:=$(PKG_SOURCE_URL)
  30. DEPENDS:=+libpcre +libpthread
  31. endef
  32. define Package/yanglint
  33. SECTION:=utils
  34. CATEGORY:=Utilities
  35. TITLE:=YANG data modeling language utility
  36. URL:=$(PKG_SOURCE_URL)
  37. DEPENDS:=+libyang
  38. endef
  39. define Package/libyang/description
  40. libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
  41. The library is used e.g. in libnetconf2, Netopeer2 or sysrepo projects.
  42. endef
  43. TARGET_LDFLAGS += -lm
  44. CMAKE_OPTIONS += \
  45. -DCMAKE_INSTALL_PREFIX:PATH=/usr \
  46. -DCMAKE_BUILD_TYPE:STRING=Release
  47. define Build/InstallDev
  48. $(INSTALL_DIR) $(1)/usr/lib
  49. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyang.so* $(1)/usr/lib/
  50. $(INSTALL_DIR) $(1)/usr/include/libyang
  51. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/include/libyang/* $(1)/usr/include/libyang/
  52. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  53. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libyang.pc $(1)/usr/lib/pkgconfig/
  54. endef
  55. define Package/libyang/install
  56. $(INSTALL_DIR) $(1)/usr/lib
  57. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyang.so* $(1)/usr/lib/
  58. $(INSTALL_DIR) $(1)/usr/lib/libyang
  59. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libyang/* $(1)/usr/lib/libyang/
  60. endef
  61. define Package/yanglint/install
  62. $(INSTALL_DIR) $(1)/usr/bin
  63. $(INSTALL_BIN) $(PKG_BUILD_DIR)/yanglint $(1)/usr/bin/
  64. endef
  65. $(eval $(call BuildPackage,libyang))
  66. $(eval $(call BuildPackage,yanglint))