1################################################################################ 2# 3# quagga 4# 5################################################################################ 6 7QUAGGA_VERSION = 1.2.4 8QUAGGA_SITE = http://download.savannah.gnu.org/releases/quagga 9QUAGGA_INSTALL_STAGING = YES 10QUAGGA_DEPENDENCIES = host-gawk host-pkgconf 11QUAGGA_LICENSE = GPL-2.0+ 12QUAGGA_LICENSE_FILES = COPYING 13QUAGGA_CPE_ID_VENDOR = quagga 14QUAGGA_SELINUX_MODULES = zebra 15 16# We need to override the sysconf and localstate directories so that 17# quagga can create files as the quagga user without extra 18# intervention 19QUAGGA_CONF_OPTS = \ 20 --program-transform-name='' \ 21 --sysconfdir=/etc/quagga \ 22 --localstatedir=/var/run/quagga 23 24# quagga has its own internal copy of getopt_long. To avoid conflicts with libc's 25# getopt, we need to make sure that the getopt function itself is also built. 26QUAGGA_CONF_ENV = \ 27 CFLAGS="$(TARGET_CFLAGS) -DREALLY_NEED_PLAIN_GETOPT" 28 29ifeq ($(BR2_PACKAGE_LIBCAP),y) 30QUAGGA_CONF_OPTS += --enable-capabilities 31QUAGGA_DEPENDENCIES += libcap 32else 33QUAGGA_CONF_OPTS += --disable-capabilities 34endif 35 36ifeq ($(BR2_PACKAGE_PROTOBUF_C),y) 37QUAGGA_CONF_OPTS += --enable-protobuf 38QUAGGA_DEPENDENCIES += protobuf-c 39else 40QUAGGA_CONF_OPTS += --disable-protobuf 41endif 42 43QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_ZEBRA),--enable-zebra,--disable-zebra) 44QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_BGPD),--enable-bgpd,--disable-bgpd) 45QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_RIPD),--enable-ripd,--disable-ripd) 46QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_RIPNGD),--enable-ripngd,--disable-ripngd) 47QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_OSPFD),--enable-ospfd,--disable-ospfd --disable-ospfapi) 48QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_OSPF6D),--enable-ospf6d,--disable-ospf6d) 49QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_PIMD),--enable-pimd,--disable-pimd) 50QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_WATCHQUAGGA),--enable-watchquagga,--disable-watchquagga) 51QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_ISISD),--enable-isisd,--disable-isisd) 52QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_BGP_ANNOUNCE),--enable-bgp-announce,--disable-bgp-announce) 53QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_TCP_ZEBRA),--enable-tcp-zebra,--disable-tcp-zebra) 54 55define QUAGGA_USERS 56 quagga -1 quagga -1 * - - - Quagga priv drop user 57endef 58 59# Set the permissions of /etc/quagga such that quagga (through vtysh) 60# can save the configuration - set the folder recursively as the files 61# need to be 600, and then set the folder (non-recursively) to 755 so 62# it can used. Quagga also needs to write to the folder as it moves 63# and creates, rather than overwriting. 64define QUAGGA_PERMISSIONS 65 /etc/quagga r 600 quagga quagga - - - - - 66 /etc/quagga d 755 quagga quagga - - - - - 67endef 68 69# In order for the QUAGGA_PERMISSIONS variable above to work, 70# /etc/quagga has to exist. However, this package without any 71# sub-option enabled will not create /etc/quagga, so let's create it 72# unconditionally in a post-install hook, in case it hasn't been 73# already created by the quagga installation. 74define QUAGGA_CREATE_ETC_QUAGGA 75 mkdir -p $(TARGET_DIR)/etc/quagga 76endef 77QUAGGA_POST_INSTALL_TARGET_HOOKS += QUAGGA_CREATE_ETC_QUAGGA 78 79ifeq ($(BR2_PACKAGE_QUAGGA_NHRPD),y) 80QUAGGA_CONF_OPTS += --enable-nhrpd 81QUAGGA_DEPENDENCIES += c-ares 82else 83QUAGGA_CONF_OPTS += --disable-nhrpd 84endif 85 86ifeq ($(BR2_PACKAGE_QUAGGA_SNMP),y) 87QUAGGA_CONF_ENV += ac_cv_path_NETSNMP_CONFIG=$(STAGING_DIR)/usr/bin/net-snmp-config 88QUAGGA_CONF_OPTS += --enable-snmp=agentx 89QUAGGA_DEPENDENCIES += netsnmp 90endif 91 92ifeq ($(BR2_PACKAGE_QUAGGA_VTYSH),y) 93QUAGGA_CONF_OPTS += --enable-vtysh 94QUAGGA_DEPENDENCIES += readline 95else 96QUAGGA_CONF_OPTS += --disable-vtysh 97endif 98 99ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),) 100QUAGGA_CONF_OPTS += --disable-pie 101endif 102 103define QUAGGA_INSTALL_INIT_SYSTEMD 104 $(INSTALL) -D -m 644 package/quagga/quagga_tmpfiles.conf \ 105 $(TARGET_DIR)/usr/lib/tmpfiles.d/quagga.conf 106 $(INSTALL) -D -m 644 package/quagga/quagga@.service \ 107 $(TARGET_DIR)/usr/lib/systemd/system/quagga@.service 108endef 109 110$(eval $(autotools-package)) 111