Makefile (6062B)
1 # 2 # Copyright (C) 2006-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 8 include $(TOPDIR)/rules.mk 9 10 PKG_NAME:=net-snmp 11 PKG_VERSION:=5.7.3 12 PKG_RELEASE:=4 13 14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 15 PKG_SOURCE_URL:=@SF/net-snmp 16 PKG_MD5SUM:=d4a3459e1577d0efa8d96ca70a885e53 17 PKG_MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be> 18 PKG_LICENSE:=MIT BSD-3-Clause-Clear 19 20 PKG_FIXUP:=autoreconf 21 22 include $(INCLUDE_DIR)/package.mk 23 24 define Package/net-snmp/Default 25 SECTION:=net 26 CATEGORY:=Network 27 URL:=http://www.net-snmp.org/ 28 endef 29 30 define Package/net-snmp/Default/description 31 Simple Network Management Protocol (SNMP) is a widely used protocol for 32 monitoring the health and welfare of network equipment (eg. routers), 33 computer equipment and even devices like UPSs. Net-SNMP is a suite of 34 applications used to implement SNMP v1, SNMP v2c and SNMP v3 using both 35 IPv4 and IPv6. 36 endef 37 38 39 define Package/libnetsnmp 40 $(call Package/net-snmp/Default) 41 SECTION:=libs 42 CATEGORY:=Libraries 43 DEPENDS:=+libnl-tiny 44 TITLE:=Open source SNMP implementation (libraries) 45 endef 46 47 define Package/libnetsnmp/description 48 $(call Package/net-snmp/Default/description) 49 . 50 This package contains shared libraries, needed by other programs. 51 endef 52 53 54 define Package/snmp-mibs 55 $(call Package/net-snmp/Default) 56 TITLE:=Open source SNMP implementation (MIB-files) 57 endef 58 59 define Package/snmp-mibs/description 60 $(call Package/net-snmp/Default/description) 61 . 62 This package contains SNMP MIB-Files. 63 endef 64 65 66 define Package/snmp-utils 67 $(call Package/net-snmp/Default) 68 DEPENDS:=+libnetsnmp 69 TITLE:=Open source SNMP implementation (utilities) 70 endef 71 72 define Package/snmp-utils/description 73 $(call Package/net-snmp/Default/description) 74 . 75 This package contains SNMP client utilities. 76 endef 77 78 79 define Package/snmpd 80 $(call Package/net-snmp/Default) 81 DEPENDS:=+libnetsnmp 82 TITLE:=Open source SNMP implementation (daemon) 83 endef 84 85 define Package/snmpd/description 86 $(call Package/net-snmp/Default/description) 87 . 88 This package contains the SNMP agent, dynamically linked. 89 endef 90 91 92 define Package/snmpd-static 93 $(call Package/net-snmp/Default) 94 DEPENDS:=+snmpd 95 TITLE:=Open source SNMP implementation (daemon) 96 endef 97 98 99 100 SNMP_MIB_MODULES_INCLUDED = \ 101 agent/extend \ 102 agentx \ 103 host/hr_device \ 104 host/hr_disk \ 105 host/hr_filesys \ 106 host/hr_network \ 107 host/hr_partition \ 108 host/hr_proc \ 109 host/hr_storage \ 110 host/hr_system \ 111 ieee802dot11 \ 112 if-mib/ifXTable \ 113 mibII/at \ 114 mibII/icmp \ 115 mibII/ifTable \ 116 mibII/ip \ 117 mibII/snmp_mib \ 118 mibII/sysORTable \ 119 mibII/system_mib \ 120 mibII/tcp \ 121 mibII/udp \ 122 mibII/vacm_context \ 123 mibII/vacm_vars \ 124 snmpv3/snmpEngine \ 125 snmpv3/snmpMPDStats \ 126 snmpv3/usmConf \ 127 snmpv3/usmStats \ 128 snmpv3/usmUser \ 129 tunnel \ 130 ucd-snmp/disk \ 131 ucd-snmp/dlmod \ 132 ucd-snmp/extensible \ 133 ucd-snmp/loadave \ 134 ucd-snmp/memory \ 135 ucd-snmp/pass \ 136 ucd-snmp/pass_persist \ 137 ucd-snmp/proc \ 138 ucd-snmp/vmstat \ 139 util_funcs \ 140 utilities/execute \ 141 142 SNMP_MIB_MODULES_EXCLUDED = \ 143 agent_mibs \ 144 disman/event \ 145 disman/schedule \ 146 hardware \ 147 host \ 148 if-mib \ 149 mibII \ 150 notification \ 151 notification-log-mib \ 152 snmpv3mibs \ 153 target \ 154 tcp-mib \ 155 ucd_snmp \ 156 udp-mib \ 157 utilities \ 158 159 SNMP_TRANSPORTS_INCLUDED = Callback UDP Unix 160 161 SNMP_TRANSPORTS_EXCLUDED = TCP TCPIPv6 162 163 TARGET_CFLAGS += $(FPIC) 164 TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny 165 166 CONFIGURE_ARGS += \ 167 --enable-mfd-rewrites \ 168 --enable-shared \ 169 --enable-static \ 170 --with-endianness=$(if $(CONFIG_BIG_ENDIAN),big,little) \ 171 --with-logfile=/var/log/snmpd.log \ 172 --with-persistent-directory=/usr/lib/snmp/ \ 173 --with-default-snmp-version=1 \ 174 --with-sys-contact=root@localhost \ 175 --with-sys-location=Unknown \ 176 --enable-applications \ 177 --disable-debugging \ 178 --disable-manuals \ 179 --disable-scripts \ 180 --with-out-mib-modules="$(SNMP_MIB_MODULES_EXCLUDED)" \ 181 --with-mib-modules="$(SNMP_MIB_MODULES_INCLUDED)" \ 182 --with-out-transports="$(SNMP_TRANSPORTS_EXCLUDED)" \ 183 --with-transports="$(SNMP_TRANSPORTS_INCLUDED)" \ 184 --without-openssl \ 185 --without-libwrap \ 186 --without-rpm \ 187 --without-zlib \ 188 --with-nl \ 189 $(call autoconf_bool,CONFIG_IPV6,ipv6) \ 190 191 CONFIGURE_VARS += \ 192 ac_cv_header_netlink_netlink_h=yes \ 193 netsnmp_cv_func_nl_connect_LIBS=-lnl-tiny \ 194 195 ifeq ($(CONFIG_IPV6),y) 196 SNMP_TRANSPORTS_INCLUDED+= UDPIPv6 197 endif 198 199 TARGET_LDFLAGS += -L$(TOOLCHAIN_DIR)/usr/lib 200 201 define Build/Compile 202 $(MAKE) -C $(PKG_BUILD_DIR) \ 203 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \ 204 LDFLAGS="$(TARGET_LDFLAGS) -lm -lc" \ 205 all install 206 endef 207 208 define Build/InstallDev 209 $(INSTALL_DIR) $(2)/bin 210 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/net-snmp-config $(2)/bin/ 211 $(SED) 's,=/usr,=$(STAGING_DIR)/usr,g' $(2)/bin/net-snmp-config 212 213 $(INSTALL_DIR) $(1)/usr/include 214 $(CP) $(PKG_INSTALL_DIR)/usr/include/net-snmp $(1)/usr/include/ 215 $(INSTALL_DIR) $(1)/usr/lib 216 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*} $(1)/usr/lib/ 217 endef 218 219 define Package/libnetsnmp/install 220 $(INSTALL_DIR) $(1)/usr/lib 221 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.so.* $(1)/usr/lib/ 222 endef 223 224 define Package/snmp-mibs/install 225 $(INSTALL_DIR) $(1)/usr/share/snmp/mibs 226 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/snmp/mibs/* $(1)/usr/share/snmp/mibs/ 227 endef 228 229 define Package/snmp-utils/install 230 $(INSTALL_DIR) $(1)/usr/bin 231 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/snmp{get,set,status,test,trap,walk} $(1)/usr/bin/ 232 endef 233 234 define Package/snmpd/conffiles 235 /etc/config/snmpd 236 endef 237 238 define Package/snmpd/install 239 $(INSTALL_DIR) $(1)/etc/config 240 $(INSTALL_DATA) ./files/snmpd.conf $(1)/etc/config/snmpd 241 $(INSTALL_DIR) $(1)/etc/snmp 242 ln -sf /var/run/snmpd.conf $(1)/etc/snmp/ 243 $(INSTALL_DIR) $(1)/etc/init.d 244 $(INSTALL_BIN) ./files/snmpd.init $(1)/etc/init.d/snmpd 245 $(INSTALL_DIR) $(1)/usr/sbin 246 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snmpd $(1)/usr/sbin/snmpd 247 endef 248 249 $(eval $(call BuildPackage,libnetsnmp)) 250 $(eval $(call BuildPackage,snmp-mibs)) 251 $(eval $(call BuildPackage,snmp-utils)) 252 $(eval $(call BuildPackage,snmpd)) 253 $(eval $(call BuildPackage,snmpd-static))