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.

128 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_VERSION:=1.1.27
  11. PKG_RELEASE:=2
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=https://codeload.github.com/CESNET/Netopeer2/tar.gz/v$(PKG_VERSION)?
  14. PKG_HASH:=e3914aae78d19f445a37ef37408f7ce209ebf0b05deb412b1bc56a021448885f
  15. PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
  16. PKG_LICENSE:=BSD-3-Clause
  17. PKG_LICENSE_FILES:=LICENSE
  18. CMAKE_INSTALL:=1
  19. PKG_BUILD_PARALLEL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/cmake.mk
  22. define Package/netopeer2-keystored/config
  23. source "$(SOURCE)/Config_keystored.in"
  24. endef
  25. define Package/netopeer2-server
  26. SECTION:=utils
  27. CATEGORY:=Utilities
  28. TITLE:=NETCONF server
  29. URL:=https://github.com/CESNET/Netopeer2
  30. DEPENDS:=+libcurl +libpthread +libyang +libnetconf2 +netopeer2-keystored +libsysrepo +sysrepocfg +sysrepoctl +sysrepo
  31. MENU:=1
  32. endef
  33. define Package/netopeer2-cli
  34. SECTION:=utils
  35. CATEGORY:=Utilities
  36. TITLE:=Netopeer2 cli tool
  37. URL:=https://github.com/CESNET/Netopeer2
  38. DEPENDS:=+libpthread +libyang +libnetconf2 +libopenssl
  39. endef
  40. define Package/netopeer2-keystored
  41. SECTION:=utils
  42. CATEGORY:=Utilities
  43. TITLE:=Netopeer2 key store management
  44. URL:=https://github.com/CESNET/Netopeer2
  45. DEPENDS:=+libopenssl +libsysrepo +sysrepo +sysrepocfg +sysrepoctl +SSH_KEYS:openssh-keygen
  46. MENU:=1
  47. endef
  48. define Package/netopeer2/description
  49. Netopeer2 is a set of tools implementing network configuration tools based on the NETCONF
  50. Protocol. This is the second generation of the toolset, originally available as the Netopeer
  51. project. Netopeer2 is based on the new generation of the NETCONF and YANG libraries -
  52. libyang and libnetconf2. The Netopeer server uses sysrepo as a NETCONF datastore implementation.
  53. endef
  54. CMAKE_OPTIONS += \
  55. -DGENERATE_HOSTKEY:BOOL=OFF \
  56. -DINSTALL_MODULES:BOOL=OFF \
  57. -DCMAKE_BUILD_TYPE=release
  58. #-DKEYSTORED_KEYS_DIR:STRING=/etc/keystored/keys \
  59. define Package/netopeer2-server/install
  60. $(INSTALL_DIR) $(1)/usr/bin
  61. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/netopeer2-server $(1)/usr/bin/
  62. $(INSTALL_DIR) $(1)/etc/sysrepo/yang
  63. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-ssh-server@2019-07-02.yang $(1)/etc/sysrepo/yang/
  64. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-tls-server@2019-07-02.yang $(1)/etc/sysrepo/yang/
  65. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/iana-crypt-hash@2014-08-06.yang $(1)/etc/sysrepo/yang/
  66. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-x509-cert-to-name@2014-12-10.yang $(1)/etc/sysrepo/yang/
  67. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf-server@2019-07-02.yang $(1)/etc/sysrepo/yang/
  68. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf-monitoring@2010-10-04.yang $(1)/etc/sysrepo/yang/
  69. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf-acm@2018-02-14.yang $(1)/etc/sysrepo/yang/
  70. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf-nmda@2019-01-07.yang $(1)/etc/sysrepo/yang/
  71. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf@2013-09-29.yang $(1)/etc/sysrepo/yang/
  72. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-datastores@2017-08-17.yang $(1)/etc/sysrepo/yang/
  73. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-crypto-types@2019-07-02.yang $(1)/etc/sysrepo/yang/
  74. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/iana-crypt-hash@2014-08-06.yang $(1)/etc/sysrepo/yang/
  75. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-tcp-server@2019-07-02.yang $(1)/etc/sysrepo/yang/
  76. $(INSTALL_DIR) $(1)/etc/uci-defaults
  77. $(INSTALL_BIN) ./files/netopeer2-server.default $(1)/etc/uci-defaults/98_netopeer2-server
  78. $(INSTALL_DIR) $(1)/etc/init.d/
  79. $(INSTALL_BIN) ./files/netopeer2-server.init $(1)/etc/init.d/netopeer2-server
  80. $(INSTALL_DIR) $(1)/usr/share/netopeer2-server
  81. $(INSTALL_DATA) ./files/stock_config.xml $(1)/usr/share/netopeer2-server
  82. endef
  83. define Package/netopeer2-cli/install
  84. $(INSTALL_DIR) $(1)/usr/bin
  85. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/netopeer2-cli $(1)/usr/bin/
  86. endef
  87. define Package/netopeer2-keystored/install
  88. $(INSTALL_DIR) $(1)/etc/sysrepo/yang
  89. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-keystore@2019-07-02.yang $(1)/etc/sysrepo/yang/
  90. $(INSTALL_DIR) $(1)/etc/uci-defaults
  91. $(INSTALL_DIR) $(1)/etc/keystored/keys
  92. ifeq ($(CONFIG_SSH_KEYS),y)
  93. $(INSTALL_BIN) ./files/netopeer2-keystored-keygen.default $(1)/etc/uci-defaults/97_netopeer2-keystored
  94. else
  95. $(INSTALL_BIN) ./files/netopeer2-keystored.default $(1)/etc/uci-defaults/97_netopeer2-keystored
  96. #ssh key name is specified in ./files/stock_config.xml file, you will need to provide the ssh keys yourself.
  97. $(INSTALL_DATA) ./files/ssh_host_rsa_key.pem $(1)/etc/keystored/keys
  98. $(INSTALL_DATA) ./files/ssh_host_rsa_key.pub.pem $(1)/etc/keystored/keys
  99. endif
  100. endef
  101. $(eval $(call BuildPackage,netopeer2-server))
  102. $(eval $(call BuildPackage,netopeer2-cli))
  103. $(eval $(call BuildPackage,netopeer2-keystored))