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.

131 lines
5.1 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:=0.6-r1
  11. PKG_LICENSE:=BSD-3-Clause
  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/Netopeer2/tar.gz/v$(PKG_VERSION)?
  15. PKG_HASH:=5f38db43f6021e389cf1f3c5c70e432586d8ba7f2d64ed5bd2bea8c7ea6b39e6
  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/netopeer2-keystored/config
  22. source "$(SOURCE)/Config_keystored.in"
  23. endef
  24. define Package/netopeer2-server
  25. SECTION:=utils
  26. CATEGORY:=Utilities
  27. TITLE:=NETCONF server
  28. URL:=$(PKG_SOURCE_URL)
  29. DEPENDS:=+libpthread +libyang +libnetconf2 +netopeer2-keystored +libsysrepo +sysrepocfg +sysrepoctl +sysrepo
  30. MENU:=1
  31. endef
  32. define Package/netopeer2-cli
  33. SECTION:=utils
  34. CATEGORY:=Utilities
  35. TITLE:=Netopeer2 cli tool
  36. URL:=$(PKG_SOURCE_URL)
  37. DEPENDS:=+libpthread +libyang +libnetconf2 +libopenssl
  38. endef
  39. define Package/netopeer2-keystored
  40. SECTION:=utils
  41. CATEGORY:=Utilities
  42. TITLE:=Netopeer2 key store management
  43. URL:=$(PKG_SOURCE_URL)
  44. DEPENDS:=+libopenssl +libsysrepo +sysrepo +sysrepocfg +sysrepoctl +SSH_KEYS:openssh-keygen
  45. MENU:=1
  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. -DENABLE_CONFIGURATION:BOOL=OFF \
  58. -DMODEL_INSTALL:BOOL=OFF \
  59. -DSSH_KEY_INSTALL:BOOL=OFF
  60. define Package/netopeer2-server/install
  61. $(INSTALL_DIR) $(1)/bin
  62. $(INSTALL_BIN) $(PKG_BUILD_DIR)/server/netopeer2-server $(1)/bin/
  63. $(INSTALL_DIR) $(1)/etc/sysrepo/yang
  64. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-ssh-server.yang $(1)/etc/sysrepo/yang/ietf-ssh-server@2016-11-02.yang
  65. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-tls-server.yang $(1)/etc/sysrepo/yang/ietf-tls-server@2016-11-02.yang
  66. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/iana-crypt-hash.yang $(1)/etc/sysrepo/yang/iana-crypt-hash@2014-08-06.yang
  67. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-x509-cert-to-name.yang $(1)/etc/sysrepo/yang/ietf-x509-cert-to-name@2014-12-10.yang
  68. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf-server.yang $(1)/etc/sysrepo/yang/ietf-netconf-server@2016-11-02.yang
  69. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf-monitoring.yang $(1)/etc/sysrepo/yang/ietf-netconf-monitoring@2010-10-04.yang
  70. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf-with-defaults.yang $(1)/etc/sysrepo/yang/ietf-netconf-with-defaults@2011-06-01.yang
  71. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-system.yang $(1)/etc/sysrepo/yang/ietf-system@2014-08-06.yang
  72. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-datastores.yang $(1)/etc/sysrepo/yang/ietf-datastores@2017-08-17.yang
  73. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-yang-library.yang $(1)/etc/sysrepo/yang/ietf-yang-library@2018-01-17.yang
  74. $(INSTALL_DIR) $(1)/etc/uci-defaults
  75. $(INSTALL_BIN) ./files/netopeer2-server.default $(1)/etc/uci-defaults/98_netopeer2-server
  76. $(INSTALL_DIR) $(1)/etc/init.d/
  77. $(INSTALL_BIN) ./files/netopeer2-server.init $(1)/etc/init.d/netopeer2-server
  78. $(INSTALL_DIR) $(1)/usr/share/netopeer2-server
  79. $(INSTALL_DATA) ./files/stock_config.xml $(1)/usr/share/netopeer2-server
  80. endef
  81. define Package/netopeer2-cli/install
  82. $(INSTALL_DIR) $(1)/bin
  83. $(INSTALL_BIN) $(PKG_BUILD_DIR)/cli/netopeer2-cli $(1)/bin/
  84. endef
  85. define Package/netopeer2-keystored/install
  86. $(INSTALL_DIR) $(1)/usr/lib/sysrepo/plugins/
  87. $(INSTALL_BIN) $(PKG_BUILD_DIR)/keystored/libkeystored.so $(1)/usr/lib/sysrepo/plugins/
  88. $(INSTALL_DIR) $(1)/etc/sysrepo/yang
  89. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-keystore.yang $(1)/etc/sysrepo/yang/ietf-keystore@2016-10-31.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. $(INSTALL_DIR) $(1)/usr/share/netopeer2-keystored
  101. $(INSTALL_DATA) $(PKG_BUILD_DIR)/keystored/stock_key_config.xml $(1)/usr/share/netopeer2-keystored
  102. endef
  103. $(eval $(call BuildPackage,netopeer2-server))
  104. $(eval $(call BuildPackage,netopeer2-cli))
  105. $(eval $(call BuildPackage,netopeer2-keystored))