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.

284 lines
6.8 KiB

net-snmp: build against libnl-tiny Instead of causing nondeterministing conditional compilation depending on whether libnl-core happens to be present or not, fixup the net-snmp package to link against libnl-tiny which is present by default on the majority of systems. In order to successfully build against libnl-tiny, a number of things had to be fixed in both the upstream configure and the outer Makefile: - Add a patch which fixes the upstream configure macros to properly handle cases where the cache variables for nl_connect() and netlink.h tests are predefined. Without this patch, all subsequent link tests in configure will fail, causing the build system to assume functions like opendir() or readdir() to be missing, leading to build failures later on due to conflicting redefinitions of structures and function prototypes - In the same patch, stop probing the host systems /usr/include/libnl-3 if ac_cv_header_netlink_netlink_h is given. This brings the proprietary configure bits in line with the behaviour expected from autoconfig in a cross compile setting - Explicitely request nl support by passing the --with-nl flag to configure - Pass the required cache variables to skip the broken tests for nl_connect() and netlink.h - Amend TARGET_CPPFLAGS to let net-snmp's build system discover nl-tiny's netlink/netlink.h and netlink/socket.h - Enable the autoreconf fixup to regenerate the broken shipped configure from patched macros - Adjust the depends to unconditionally require libnl-tiny Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
net-snmp: build against libnl-tiny Instead of causing nondeterministing conditional compilation depending on whether libnl-core happens to be present or not, fixup the net-snmp package to link against libnl-tiny which is present by default on the majority of systems. In order to successfully build against libnl-tiny, a number of things had to be fixed in both the upstream configure and the outer Makefile: - Add a patch which fixes the upstream configure macros to properly handle cases where the cache variables for nl_connect() and netlink.h tests are predefined. Without this patch, all subsequent link tests in configure will fail, causing the build system to assume functions like opendir() or readdir() to be missing, leading to build failures later on due to conflicting redefinitions of structures and function prototypes - In the same patch, stop probing the host systems /usr/include/libnl-3 if ac_cv_header_netlink_netlink_h is given. This brings the proprietary configure bits in line with the behaviour expected from autoconfig in a cross compile setting - Explicitely request nl support by passing the --with-nl flag to configure - Pass the required cache variables to skip the broken tests for nl_connect() and netlink.h - Amend TARGET_CPPFLAGS to let net-snmp's build system discover nl-tiny's netlink/netlink.h and netlink/socket.h - Enable the autoreconf fixup to regenerate the broken shipped configure from patched macros - Adjust the depends to unconditionally require libnl-tiny Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
net-snmp: build against libnl-tiny Instead of causing nondeterministing conditional compilation depending on whether libnl-core happens to be present or not, fixup the net-snmp package to link against libnl-tiny which is present by default on the majority of systems. In order to successfully build against libnl-tiny, a number of things had to be fixed in both the upstream configure and the outer Makefile: - Add a patch which fixes the upstream configure macros to properly handle cases where the cache variables for nl_connect() and netlink.h tests are predefined. Without this patch, all subsequent link tests in configure will fail, causing the build system to assume functions like opendir() or readdir() to be missing, leading to build failures later on due to conflicting redefinitions of structures and function prototypes - In the same patch, stop probing the host systems /usr/include/libnl-3 if ac_cv_header_netlink_netlink_h is given. This brings the proprietary configure bits in line with the behaviour expected from autoconfig in a cross compile setting - Explicitely request nl support by passing the --with-nl flag to configure - Pass the required cache variables to skip the broken tests for nl_connect() and netlink.h - Amend TARGET_CPPFLAGS to let net-snmp's build system discover nl-tiny's netlink/netlink.h and netlink/socket.h - Enable the autoreconf fixup to regenerate the broken shipped configure from patched macros - Adjust the depends to unconditionally require libnl-tiny Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
net-snmp: build against libnl-tiny Instead of causing nondeterministing conditional compilation depending on whether libnl-core happens to be present or not, fixup the net-snmp package to link against libnl-tiny which is present by default on the majority of systems. In order to successfully build against libnl-tiny, a number of things had to be fixed in both the upstream configure and the outer Makefile: - Add a patch which fixes the upstream configure macros to properly handle cases where the cache variables for nl_connect() and netlink.h tests are predefined. Without this patch, all subsequent link tests in configure will fail, causing the build system to assume functions like opendir() or readdir() to be missing, leading to build failures later on due to conflicting redefinitions of structures and function prototypes - In the same patch, stop probing the host systems /usr/include/libnl-3 if ac_cv_header_netlink_netlink_h is given. This brings the proprietary configure bits in line with the behaviour expected from autoconfig in a cross compile setting - Explicitely request nl support by passing the --with-nl flag to configure - Pass the required cache variables to skip the broken tests for nl_connect() and netlink.h - Amend TARGET_CPPFLAGS to let net-snmp's build system discover nl-tiny's netlink/netlink.h and netlink/socket.h - Enable the autoreconf fixup to regenerate the broken shipped configure from patched macros - Adjust the depends to unconditionally require libnl-tiny Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
net-snmp: build against libnl-tiny Instead of causing nondeterministing conditional compilation depending on whether libnl-core happens to be present or not, fixup the net-snmp package to link against libnl-tiny which is present by default on the majority of systems. In order to successfully build against libnl-tiny, a number of things had to be fixed in both the upstream configure and the outer Makefile: - Add a patch which fixes the upstream configure macros to properly handle cases where the cache variables for nl_connect() and netlink.h tests are predefined. Without this patch, all subsequent link tests in configure will fail, causing the build system to assume functions like opendir() or readdir() to be missing, leading to build failures later on due to conflicting redefinitions of structures and function prototypes - In the same patch, stop probing the host systems /usr/include/libnl-3 if ac_cv_header_netlink_netlink_h is given. This brings the proprietary configure bits in line with the behaviour expected from autoconfig in a cross compile setting - Explicitely request nl support by passing the --with-nl flag to configure - Pass the required cache variables to skip the broken tests for nl_connect() and netlink.h - Amend TARGET_CPPFLAGS to let net-snmp's build system discover nl-tiny's netlink/netlink.h and netlink/socket.h - Enable the autoreconf fixup to regenerate the broken shipped configure from patched macros - Adjust the depends to unconditionally require libnl-tiny Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=net-snmp
  9. PKG_VERSION:=5.7.3
  10. PKG_RELEASE:=9
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=@SF/net-snmp
  13. PKG_HASH:=12ef89613c7707dc96d13335f153c1921efc9d61d3708ef09f3fc4a7014fb4f0
  14. PKG_MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
  15. PKG_LICENSE:=MIT BSD-3-Clause-Clear
  16. PKG_FIXUP:=autoreconf
  17. include $(INCLUDE_DIR)/package.mk
  18. define Package/net-snmp/Default
  19. SECTION:=net
  20. CATEGORY:=Network
  21. URL:=http://www.net-snmp.org/
  22. endef
  23. define Package/net-snmp/Default/description
  24. Simple Network Management Protocol (SNMP) is a widely used protocol for
  25. monitoring the health and welfare of network equipment (eg. routers),
  26. computer equipment and even devices like UPSs. Net-SNMP is a suite of
  27. applications used to implement SNMP v1, SNMP v2c and SNMP v3 using both
  28. IPv4 and IPv6.
  29. endef
  30. define Package/libnetsnmp
  31. $(call Package/net-snmp/Default)
  32. SECTION:=libs
  33. CATEGORY:=Libraries
  34. DEPENDS:=+libnl-tiny
  35. TITLE:=Open source SNMP implementation (libraries)
  36. endef
  37. define Package/libnetsnmp/description
  38. $(call Package/net-snmp/Default/description)
  39. .
  40. This package contains shared libraries, needed by other programs.
  41. endef
  42. define Package/snmp-mibs
  43. $(call Package/net-snmp/Default)
  44. TITLE:=Open source SNMP implementation (MIB-files)
  45. endef
  46. define Package/snmp-mibs/description
  47. $(call Package/net-snmp/Default/description)
  48. .
  49. This package contains SNMP MIB-Files.
  50. endef
  51. define Package/snmp-utils
  52. $(call Package/net-snmp/Default)
  53. DEPENDS:=+libnetsnmp
  54. TITLE:=Open source SNMP implementation (utilities)
  55. endef
  56. define Package/snmp-utils/description
  57. $(call Package/net-snmp/Default/description)
  58. .
  59. This package contains SNMP client utilities:
  60. - snmpget
  61. - snmpset
  62. - snmpstatus
  63. - snmptest
  64. - snmptrap
  65. - snmpwalk
  66. endef
  67. define Package/snmpd
  68. $(call Package/net-snmp/Default)
  69. DEPENDS:=+libnetsnmp
  70. TITLE:=Open source SNMP implementation (daemon)
  71. endef
  72. define Package/snmpd/description
  73. $(call Package/net-snmp/Default/description)
  74. .
  75. This package contains the SNMP agent, dynamically linked.
  76. endef
  77. define Package/snmpd-static
  78. $(call Package/net-snmp/Default)
  79. DEPENDS:=+snmpd
  80. TITLE:=Open source SNMP implementation (daemon)
  81. endef
  82. define Package/snmptrapd
  83. $(call Package/net-snmp/Default)
  84. DEPENDS:=+libnetsnmp
  85. TITLE:=Open source SNMP implementation (notification receiver)
  86. endef
  87. define Package/snmptrapd/description
  88. $(call Package/net-snmp/Default/description)
  89. .
  90. This package contains the SNMP notification receiver.
  91. endef
  92. SNMP_MIB_MODULES_INCLUDED = \
  93. agent/extend \
  94. agentx \
  95. host/hr_device \
  96. host/hr_disk \
  97. host/hr_filesys \
  98. host/hr_network \
  99. host/hr_partition \
  100. host/hr_proc \
  101. host/hr_storage \
  102. host/hr_system \
  103. ieee802dot11 \
  104. if-mib/ifXTable \
  105. mibII/at \
  106. mibII/icmp \
  107. mibII/ifTable \
  108. mibII/ip \
  109. mibII/snmp_mib \
  110. mibII/sysORTable \
  111. mibII/system_mib \
  112. mibII/tcp \
  113. mibII/udp \
  114. mibII/vacm_context \
  115. mibII/vacm_vars \
  116. snmpv3/snmpEngine \
  117. snmpv3/snmpMPDStats \
  118. snmpv3/usmConf \
  119. snmpv3/usmStats \
  120. snmpv3/usmUser \
  121. tunnel \
  122. ucd-snmp/disk \
  123. ucd-snmp/dlmod \
  124. ucd-snmp/extensible \
  125. ucd-snmp/loadave \
  126. ucd-snmp/memory \
  127. ucd-snmp/pass \
  128. ucd-snmp/pass_persist \
  129. ucd-snmp/proc \
  130. ucd-snmp/vmstat \
  131. util_funcs \
  132. utilities/execute \
  133. SNMP_MIB_MODULES_EXCLUDED = \
  134. agent_mibs \
  135. disman/event \
  136. disman/schedule \
  137. hardware \
  138. host \
  139. if-mib \
  140. mibII \
  141. notification \
  142. notification-log-mib \
  143. snmpv3mibs \
  144. target \
  145. tcp-mib \
  146. ucd_snmp \
  147. udp-mib \
  148. utilities \
  149. SNMP_TRANSPORTS_INCLUDED = Callback UDP Unix
  150. SNMP_TRANSPORTS_EXCLUDED = TCP TCPIPv6
  151. TARGET_CFLAGS += $(FPIC)
  152. TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny
  153. CONFIGURE_ARGS += \
  154. --enable-mfd-rewrites \
  155. --enable-shared \
  156. --enable-static \
  157. --with-endianness=$(if $(CONFIG_BIG_ENDIAN),big,little) \
  158. --with-logfile=/var/log/snmpd.log \
  159. --with-persistent-directory=/usr/lib/snmp/ \
  160. --with-default-snmp-version=1 \
  161. --with-sys-contact=root@localhost \
  162. --with-sys-location=Unknown \
  163. --enable-applications \
  164. --disable-debugging \
  165. --disable-manuals \
  166. --disable-scripts \
  167. --with-out-mib-modules="$(SNMP_MIB_MODULES_EXCLUDED)" \
  168. --with-mib-modules="$(SNMP_MIB_MODULES_INCLUDED)" \
  169. --with-out-transports="$(SNMP_TRANSPORTS_EXCLUDED)" \
  170. --with-transports="$(SNMP_TRANSPORTS_INCLUDED)" \
  171. --without-openssl \
  172. --without-libwrap \
  173. --without-mysql \
  174. --without-rpm \
  175. --without-zlib \
  176. --with-nl \
  177. $(call autoconf_bool,CONFIG_IPV6,ipv6) \
  178. CONFIGURE_VARS += \
  179. ac_cv_header_netlink_netlink_h=yes \
  180. netsnmp_cv_func_nl_connect_LIBS=-lnl-tiny \
  181. ifeq ($(CONFIG_IPV6),y)
  182. SNMP_TRANSPORTS_INCLUDED+= UDPIPv6
  183. endif
  184. TARGET_LDFLAGS += -L$(TOOLCHAIN_DIR)/usr/lib
  185. define Build/Compile
  186. $(MAKE) -C $(PKG_BUILD_DIR) \
  187. INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
  188. LDFLAGS="$(TARGET_LDFLAGS) -lm -lc" \
  189. all install
  190. endef
  191. define Build/InstallDev
  192. $(INSTALL_DIR) $(2)/bin
  193. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/net-snmp-config $(2)/bin/
  194. $(SED) 's,=/usr,=$(STAGING_DIR)/usr,g' $(2)/bin/net-snmp-config
  195. $(INSTALL_DIR) $(STAGING_DIR)/usr/bin
  196. $(LN) $(STAGING_DIR)/host/bin/net-snmp-config $(STAGING_DIR)/usr/bin/
  197. $(INSTALL_DIR) $(1)/usr/include
  198. $(CP) $(PKG_INSTALL_DIR)/usr/include/net-snmp $(1)/usr/include/
  199. $(INSTALL_DIR) $(1)/usr/lib
  200. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*} $(1)/usr/lib/
  201. endef
  202. define Package/libnetsnmp/install
  203. $(INSTALL_DIR) $(1)/usr/lib
  204. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.so.* $(1)/usr/lib/
  205. endef
  206. define Package/snmp-mibs/install
  207. $(INSTALL_DIR) $(1)/usr/share/snmp/mibs
  208. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/snmp/mibs/* $(1)/usr/share/snmp/mibs/
  209. endef
  210. define Package/snmp-utils/install
  211. $(INSTALL_DIR) $(1)/usr/bin
  212. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/snmp{get,set,status,test,trap,walk} $(1)/usr/bin/
  213. endef
  214. define Package/snmpd/conffiles
  215. /etc/config/snmpd
  216. endef
  217. define Package/snmpd/install
  218. $(INSTALL_DIR) $(1)/etc/config
  219. $(INSTALL_DATA) ./files/snmpd.conf $(1)/etc/config/snmpd
  220. $(INSTALL_DIR) $(1)/etc/snmp
  221. $(LN) /var/run/snmpd.conf $(1)/etc/snmp/
  222. $(INSTALL_DIR) $(1)/etc/init.d
  223. $(INSTALL_BIN) ./files/snmpd.init $(1)/etc/init.d/snmpd
  224. $(INSTALL_DIR) $(1)/usr/sbin
  225. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snmpd $(1)/usr/sbin/snmpd
  226. endef
  227. define Package/snmptrapd/install
  228. $(INSTALL_DIR) $(1)/etc/init.d
  229. $(INSTALL_BIN) ./files/snmptrapd.init $(1)/etc/init.d/snmptrapd
  230. $(INSTALL_DIR) $(1)/usr/lib
  231. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmptrapd.so.* $(1)/usr/lib/
  232. $(INSTALL_DIR) $(1)/usr/sbin
  233. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snmptrapd $(1)/usr/sbin/
  234. endef
  235. $(eval $(call BuildPackage,libnetsnmp))
  236. $(eval $(call BuildPackage,snmp-mibs))
  237. $(eval $(call BuildPackage,snmp-utils))
  238. $(eval $(call BuildPackage,snmpd))
  239. $(eval $(call BuildPackage,snmpd-static))
  240. $(eval $(call BuildPackage,snmptrapd))