Skip to content

Commit

Permalink
frr: merge frr-libfrr and frr-vtysh to frr
Browse files Browse the repository at this point in the history
frr-libfrr and frr-vtysh are required components, which makes their
menuconfig entries obsolete. Merge them in the frr package.

Signed-off-by: Georgi Valkov <[email protected]>
  • Loading branch information
httpstorm committed May 5, 2024
1 parent e295093 commit 639c4a5
Showing 1 changed file with 18 additions and 45 deletions.
63 changes: 18 additions & 45 deletions net/frr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=frr
PKG_VERSION:=10.0
PKG_RELEASE:=1
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_VERSION:=$(PKG_NAME)-$(PKG_VERSION)
Expand Down Expand Up @@ -49,8 +49,7 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_FRR_INTERNAL \
CONFIG_FRR_SNMP \
CONFIG_FRR_NO_SNMP \
CONFIG_PACKAGE_frr-libfrr \
CONFIG_PACKAGE_frr-vtysh \
CONFIG_PACKAGE_frr \
CONFIG_PACKAGE_frr-watchfrr \
CONFIG_PACKAGE_frr-zebra \
$(patsubst %,CONFIG_PACKAGE_frr-%,$(PKG_DAEMON_AVAILABLE)) \
Expand All @@ -66,7 +65,7 @@ HOST_BUILD_DEPENDS:=python3/host
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk

define Package/frr-libfrr/config
define Package/frr/config
source "$(SOURCE)/Config.in"
endef

Expand All @@ -80,7 +79,8 @@ endef

define Package/frr
$(call Package/frr/Default)
DEPENDS:=+librt
DEPENDS:=+librt +libatomic +libcap +libncurses +libjson-c +libreadline \
+libyang +libprotobuf-c +FRR_OPENSSL:libopenssl +FRR_SNMP:libnetsnmp +more
TITLE:=The FRRouting (FRR) Software Routing Suite
MENU:=1
endef
Expand All @@ -94,41 +94,23 @@ define Package/frr/description
NHRP.
endef

define Package/frr-libfrr
$(call Package/frr/Default)
TITLE:=zebra library
DEPENDS+=+librt +libatomic +libcap +libjson-c +libyang +libprotobuf-c +FRR_OPENSSL:libopenssl +FRR_SNMP:libnetsnmp
CONFLICTS:=quagga-libzebra
endef

define Package/frr-vtysh
$(call Package/frr/Default)
DEPENDS+=+frr-libfrr +libreadline +libncurses +more
TITLE:=integrated shell for frr routing software
CONFLICTS:=quagga-vtysh
DEFAULT:=y if PACKAGE_frr
HIDDEN:=1
endef

define Package/frr-watchfrr
$(call Package/frr/Default)
TITLE:=frr watchdog
DEPENDS+=+frr-libfrr
DEFAULT:=y if PACKAGE_frr
endef

define Package/frr-zebra
$(call Package/frr/Default)
TITLE:=Zebra daemon
DEPENDS+=+frr-libfrr
DEFAULT:=y if PACKAGE_frr
CONFLICTS:=quagga-zebra
endef

define Package/frr-pythontools
$(call Package/frr/Default)
TITLE:=Python reload tool
DEPENDS+=+frr-libfrr +python3-base +python3-light +python3-logging
DEPENDS+=+python3-base +python3-light +python3-logging
endef

##Migrate from quagga
Expand All @@ -146,7 +128,7 @@ define BuildDaemon
define Package/frr-$(1)
$$(call Package/frr/Default)
TITLE:= $(1) routing engine
DEPENDS+=frr-libfrr $(2)
DEPENDS+=$(2)
endef
# if [ "$(1)" == "bfdd" ]; then \
# export HAVE_BFDD == 1 ; fi
Expand All @@ -162,7 +144,7 @@ define BuildDaemon
$$(eval $$(call BuildPackage,frr-$(1)))
endef

define Package/frr-libfrr/conffiles
define Package/frr/conffiles
/etc/frr/daemons
/etc/frr/frr.conf
/etc/frr/vtysh.conf
Expand All @@ -187,6 +169,8 @@ endef
CONFIGURE_ARGS+= \
--with-clippy=$(STAGING_DIR_HOSTPKG)/bin/clippy \
--prefix=/usr \
--enable-vtysh \
--enable-zebra \
--enable-shared \
--disable-static \
--enable-user=network \
Expand All @@ -199,15 +183,20 @@ CONFIGURE_ARGS+= \
$(if $(CONFIG_FRR_OPENSSL),--with-crypto=openssl,) \
$(if $(CONFIG_FRR_SNMP),--enable-snmp,) \
$(foreach m,$(PKG_DAEMON_AVAILABLE), \
$(call autoconf_bool,CONFIG_PACKAGE_frr-$(m),$(m)) ) \
$(call autoconf_bool,CONFIG_PACKAGE_frr-vtysh,vtysh) \
$(call autoconf_bool,CONFIG_PACKAGE_frr-libfrr,zebra)
$(call autoconf_bool,CONFIG_PACKAGE_frr-$(m),$(m)) )


define Package/frr/install
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d
$(INSTALL_BIN) ./files/frrcommon.sh $(1)/usr/sbin/
$(INSTALL_BIN) ./files/frr $(1)/etc/init.d/
$(INSTALL_DIR) $(1)/usr/bin $(1)/etc/frr
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vtysh $(1)/usr/bin/
$(INSTALL_CONF) ./files/vtysh.conf $(1)/etc/frr/
$(INSTALL_DIR) $(1)/usr/lib $(1)/etc/frr
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libfrr.so* $(1)/usr/lib/
$(if $(CONFIG_FRR_SNMP),$(CP) $(PKG_INSTALL_DIR)/usr/lib/libfrrsnmp.so* $(1)/usr/lib/,)
$(INSTALL_CONF) ./files/{frr.conf,daemons} $(1)/etc/frr/
endef

define Package/frr-watchfrr/install
Expand All @@ -221,34 +210,18 @@ define Package/frr-zebra/install
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/zebra $(1)/usr/sbin/
endef

define Package/frr-libfrr/install
$(INSTALL_DIR) $(1)/usr/lib $(1)/etc/frr
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libfrr.so* $(1)/usr/lib/
$(if $(CONFIG_FRR_SNMP),$(CP) $(PKG_INSTALL_DIR)/usr/lib/libfrrsnmp.so* $(1)/usr/lib/,)
$(INSTALL_CONF) ./files/{frr.conf,daemons} $(1)/etc/frr/
endef


define Package/frr-pythontools/install
$(INSTALL_DIR) $(1)/usr/lib/frr $(1)/usr/sbin $(1)/etc/frr
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/*.py $(1)/usr/lib/frr/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/frr-reload $(1)/usr/sbin/
$(INSTALL_CONF) $(PKG_BUILD_DIR)/tools/etc/frr/support_bundle_commands.conf $(1)/etc/frr/
endef

define Package/frr-vtysh/install
$(INSTALL_DIR) $(1)/usr/bin $(1)/etc/frr
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vtysh $(1)/usr/bin/
$(INSTALL_CONF) ./files/vtysh.conf $(1)/etc/frr/
endef

$(eval $(call HostBuild))
$(eval $(call BuildPackage,frr))
$(eval $(call BuildPackage,frr-libfrr))
$(eval $(call BuildPackage,frr-pythontools))
$(eval $(call BuildPackage,frr-watchfrr))
$(eval $(call BuildPackage,frr-zebra))
$(eval $(call BuildPackage,frr-vtysh))
$(eval $(call BuildDaemon,babeld,))
$(eval $(call BuildDaemon,bfdd,))
$(eval $(call BuildDaemon,bgpd,))
Expand Down

0 comments on commit 639c4a5

Please sign in to comment.