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.

144 lines
4.9 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. # Warning by default OpenWrt does not have a root password which is necessery for NETCONF server.
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=netopeer2
  10. PKG_LICENSE:=BSD-3-Clause
  11. PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
  12. PKG_VERSION:=0.3.65
  13. PKG_SOURCE_PROTO:=git
  14. PKG_SOURCE_VERSION:=c204b59f9c2bb7e63eb907f33c44adbf208295ee
  15. PKG_MIRROR_HASH:=61a2b3e0ee9a3cf2f73715843f059c79292446ad3643f4eeb85d48d1e185c3b9
  16. PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
  17. PKG_SOURCE_URL:=https://github.com/CESNET/Netopeer2.git
  18. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(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. CMAKE_INSTALL:=1
  24. include $(INCLUDE_DIR)/package.mk
  25. include $(INCLUDE_DIR)/cmake.mk
  26. define Package/netopeer2-server
  27. SECTION:=util
  28. CATEGORY:=Utilities
  29. TITLE:=NETCONF server
  30. URL:=$(PKG_SOURCE_URL)
  31. DEPENDS:=+libpthread +libyang +libnetconf2 +netopeer2-keystored +libsysrepo +sysrepocfg +sysrepoctl
  32. endef
  33. define Package/netopeer2-cli
  34. SECTION:=util
  35. CATEGORY:=Utilities
  36. TITLE:=Netopeer2 cli tool
  37. URL:=$(PKG_SOURCE_URL)
  38. DEPENDS:=+libpthread +libyang +libnetconf2 +libopenssl
  39. endef
  40. define Package/netopeer2-keystored
  41. SECTION:=util
  42. CATEGORY:=Utilities
  43. TITLE:=Netopeer2 key store management
  44. URL:=$(PKG_SOURCE_URL)
  45. DEPENDS:=+libopenssl +libsysrepo +sysrepo-plugind +sysrepocfg +sysrepoctl
  46. endef
  47. define Package/netopeer2/description
  48. Netopeer2 is a set of tools implementing network configuration tools based on the NETCONF
  49. Protocol. This is the second generation of the toolset, originally available as the Netopeer
  50. project. Netopeer2 is based on the new generation of the NETCONF and YANG libraries -
  51. libyang and libnetconf2. The Netopeer server uses sysrepo as a NETCONF datastore implementation.
  52. endef
  53. CMAKE_OPTIONS += \
  54. -DCMAKE_INSTALL_PREFIX:PATH=/usr \
  55. -DCMAKE_BUILD_TYPE:STRING=Release \
  56. -DKEYSTORED_KEYS_DIR:STRING=/etc/keystored/keys
  57. define Build/Configure
  58. $(eval PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)/server)
  59. $(call Build/Configure/Default)
  60. $(eval PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)/cli)
  61. $(call Build/Configure/Default)
  62. $(eval PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)/keystored)
  63. $(call Build/Configure/Default)
  64. endef
  65. define Build/Compile
  66. $(eval PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)/server)
  67. $(call Build/Compile/Default)
  68. $(eval PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)/cli)
  69. $(call Build/Compile/Default)
  70. $(eval PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)/keystored)
  71. $(call Build/Compile/Default)
  72. endef
  73. define Package/netopeer2-server/install
  74. $(INSTALL_DIR) $(1)/bin
  75. $(INSTALL_BIN) $(PKG_BUILD_ROOT)/server/netopeer2-server $(1)/bin/
  76. $(INSTALL_DIR) $(1)/etc/sysrepo/yang
  77. $(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-ssh-server.yang $(1)/etc/sysrepo/yang/
  78. $(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-tls-server.yang $(1)/etc/sysrepo/yang/
  79. $(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/iana-crypt-hash.yang $(1)/etc/sysrepo/yang/
  80. $(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-x509-cert-to-name.yang $(1)/etc/sysrepo/yang/
  81. $(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-netconf-server.yang $(1)/etc/sysrepo/yang/
  82. $(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-netconf-server.yang $(1)/etc/sysrepo/yang/
  83. $(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-system.yang $(1)/etc/sysrepo/yang/
  84. $(INSTALL_DIR) $(1)/etc/uci-defaults
  85. $(INSTALL_BIN) ./files/netopeer2-server.default $(1)/etc/uci-defaults/99_netopeer2-server
  86. $(INSTALL_DIR) $(1)/etc/init.d/
  87. $(INSTALL_BIN) ./files/netopeer2-server.init $(1)/etc/init.d/netopeer2-server
  88. $(INSTALL_DIR) $(1)/usr/share/netopeer2-server
  89. $(INSTALL_DATA) $(PKG_BUILD_ROOT)/server/stock_config.xml $(1)/usr/share/netopeer2-server
  90. endef
  91. define Package/netopeer2-cli/install
  92. $(INSTALL_DIR) $(1)/bin
  93. $(INSTALL_BIN) $(PKG_BUILD_ROOT)/cli/netopeer2-cli $(1)/bin/
  94. endef
  95. define Package/netopeer2-keystored/install
  96. $(INSTALL_DIR) $(1)/usr/lib/sysrepo/plugins/
  97. $(INSTALL_BIN) $(PKG_BUILD_ROOT)/keystored/libkeystored.so $(1)/usr/lib/sysrepo/plugins/
  98. $(INSTALL_DIR) $(1)/etc/sysrepo/yang
  99. $(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-keystore.yang $(1)/etc/sysrepo/yang
  100. $(INSTALL_DIR) $(1)/etc/uci-defaults
  101. $(INSTALL_BIN) ./files/netopeer2-keystored.default $(1)/etc/uci-defaults/97_netopeer2-keystored
  102. $(INSTALL_DIR) $(1)/usr/share/netopeer2-keystored
  103. $(INSTALL_DATA) $(PKG_BUILD_ROOT)/keystored/stock_key_config.xml $(1)/usr/share/netopeer2-keystored
  104. $(INSTALL_DIR) $(1)/etc/keystored/keys
  105. #$(INSTALL_DATA) ./files/ssh_host_rsa_key.pem $(1)/etc/keystored/keys
  106. #$(INSTALL_DATA) ./files/ssh_host_rsa_key.pub.pem $(1)/etc/keystored/keys
  107. #ssh key name is specified in stock_key_config.xml file, you will need to provide the ssh keys yourself.
  108. endef
  109. $(eval $(call BuildPackage,netopeer2-server))
  110. $(eval $(call BuildPackage,netopeer2-cli))
  111. $(eval $(call BuildPackage,netopeer2-keystored))