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.

81 lines
2.1 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.12.174
  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_URL:=https://github.com/CESNET/libyang.git
  15. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  16. PKG_SOURCE_VERSION:=7e811613b335afc8e1b2c0ee77e7b3f371bc9175
  17. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/cmake.mk
  22. define Package/libyang
  23. SECTION:=libs
  24. CATEGORY:=Libraries
  25. TITLE:=YANG data modeling language library
  26. URL:=$(PKG_SOURCE_URL)
  27. DEPENDS:=+libpcre
  28. endef
  29. define Package/yanglint
  30. SECTION:=utils
  31. CATEGORY:=Utilities
  32. TITLE:=YANG data modeling language utility
  33. URL:=$(PKG_SOURCE_URL)
  34. DEPENDS:=+libyang
  35. endef
  36. define Package/libyang/description
  37. libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
  38. The library is used e.g. in libnetconf2, Netopeer2 or sysrepo projects.
  39. endef
  40. TARGET_LDFLAGS += -lm
  41. CMAKE_OPTIONS += \
  42. -DCMAKE_INSTALL_PREFIX:PATH=/usr \
  43. -DCMAKE_BUILD_TYPE:STRING=Release
  44. define Build/InstallDev
  45. $(INSTALL_DIR) $(1)/usr/lib
  46. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libyang.so* $(1)/usr/lib/
  47. $(INSTALL_DIR) $(1)/usr/include/libyang
  48. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/include/libyang/* $(1)/usr/include/libyang/
  49. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  50. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libyang.pc $(1)/usr/lib/pkgconfig/
  51. endef
  52. define Package/libyang/install
  53. $(INSTALL_DIR) $(1)/usr/lib
  54. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libyang.so* $(1)/usr/lib/
  55. $(INSTALL_DIR) $(1)/usr/lib/libyang
  56. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libyang/* $(1)/usr/lib/libyang/
  57. endef
  58. define Package/yanglint/install
  59. $(INSTALL_DIR) $(1)/usr/bin
  60. $(INSTALL_BIN) $(PKG_BUILD_DIR)/yanglint $(1)/usr/bin/
  61. endef
  62. $(eval $(call BuildPackage,libyang))
  63. $(eval $(call BuildPackage,yanglint))