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.

88 lines
2.5 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.15.130
  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:=d6baaf90e24af3b07649e9dda6fc0d9b272b2ebc
  15. PKG_MIRROR_HASH:=eace667ae787ac27b7c717a52f672d05e55608c47d9e54d39d60f8ab5e47f0c9
  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_DIR) $(1)/usr/lib/libyang/extensions
  60. $(INSTALL_DIR) $(1)/usr/lib/libyang/user_types
  61. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libyang/extensions/* $(1)/usr/lib/libyang/extensions
  62. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libyang/user_types/* $(1)/usr/lib/libyang/user_types
  63. endef
  64. define Package/yanglint/install
  65. $(INSTALL_DIR) $(1)/usr/bin
  66. $(INSTALL_BIN) $(PKG_BUILD_DIR)/yanglint $(1)/usr/bin/
  67. endef
  68. $(eval $(call BuildPackage,libyang))
  69. $(eval $(call BuildPackage,yanglint))