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.

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