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.

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