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.

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