blob: 041e1b1562abc4863f2999697b92d251eaa32e70 [file] [log] [blame]
################################################################################
#
# netopeer2
#
################################################################################
NETOPEER2_VERSION = 1.1.39
NETOPEER2_SITE = $(call github,CESNET,Netopeer2,v$(NETOPEER2_VERSION))
NETOPEER2_DL_SUBDIR = netopeer2
NETOPEER2_LICENSE = BSD-3-Clause
NETOPEER2_LICENSE_FILES = LICENSE
NETOPEER2_DEPENDENCIES = libnetconf2 libyang sysrepo
NETOPEER2_CONF_OPTS = -DBUILD_CLI=$(if $(BR2_PACKAGE_NETOPEER2_CLI),ON,OFF) \
-DINSTALL_MODULES=OFF \
-DGENERATE_HOSTKEY=OFF \
-DMERGE_LISTEN_CONFIG=OFF
define NETOPEER2_INSTALL_SETUP_SCRIPTS
# Helpers for provisioning configuration and the SSH host key
$(INSTALL) -D -m 0755 -t $(TARGET_DIR)/usr/libexec/netopeer2 \
package/netopeer2/setup.sh \
package/netopeer2/merge_hostkey.sh \
package/netopeer2/merge_config.sh \
package/netopeer2/ensure-config.sh
# Upstream defaults to IPv4 and is unwilling to change
# https://github.com/CESNET/netopeer2/pull/470
sed -i 's|<local-address>0.0.0.0</local-address>|<local-address>::</local-address>|' \
$(TARGET_DIR)/usr/libexec/netopeer2/merge_config.sh
endef
NETOPEER2_POST_INSTALL_TARGET_HOOKS += NETOPEER2_INSTALL_SETUP_SCRIPTS
define NETOPEER2_INSTALL_INIT_SYSV
$(INSTALL) -m 755 -D package/netopeer2/S52netopeer2 \
$(TARGET_DIR)/etc/init.d/S52netopeer2
endef
define NETOPEER2_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 -t $(TARGET_DIR)/usr/lib/systemd/system \
package/netopeer2/netopeer2-install-yang.service \
package/netopeer2/netopeer2-setup.service \
package/netopeer2/netopeer2.service
endef
$(eval $(cmake-package))