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