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.

292 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:=2
  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. BUILDONLY:=1
  83. endef
  84. define Package/snmptrapd
  85. $(call Package/net-snmp/Default)
  86. DEPENDS:=+libnetsnmp
  87. TITLE:=Open source SNMP implementation (notification receiver)
  88. endef
  89. define Package/snmptrapd/description
  90. $(call Package/net-snmp/Default/description)
  91. .
  92. This package contains the SNMP notification receiver.
  93. endef
  94. SNMP_MIB_MODULES_INCLUDED = \
  95. agent/extend \
  96. agentx \
  97. host/hr_device \
  98. host/hr_disk \
  99. host/hr_filesys \
  100. host/hr_network \
  101. host/hr_partition \
  102. host/hr_proc \
  103. host/hr_storage \
  104. host/hr_system \
  105. ieee802dot11 \
  106. if-mib/ifXTable \
  107. ip-mib/inetNetToMediaTable \
  108. mibII/at \
  109. mibII/icmp \
  110. mibII/ifTable \
  111. mibII/ip \
  112. mibII/snmp_mib \
  113. mibII/sysORTable \
  114. mibII/system_mib \
  115. mibII/tcp \
  116. mibII/udp \
  117. mibII/vacm_context \
  118. mibII/vacm_vars \
  119. snmpv3/snmpEngine \
  120. snmpv3/snmpMPDStats \
  121. snmpv3/usmConf \
  122. snmpv3/usmStats \
  123. snmpv3/usmUser \
  124. tunnel \
  125. ucd-snmp/disk \
  126. ucd-snmp/dlmod \
  127. ucd-snmp/extensible \
  128. ucd-snmp/loadave \
  129. ucd-snmp/memory \
  130. ucd-snmp/pass \
  131. ucd-snmp/pass_persist \
  132. ucd-snmp/proc \
  133. ucd-snmp/vmstat \
  134. util_funcs \
  135. utilities/execute \
  136. SNMP_MIB_MODULES_EXCLUDED = \
  137. agent_mibs \
  138. disman/event \
  139. disman/schedule \
  140. hardware \
  141. host \
  142. if-mib \
  143. ip-mib \
  144. mibII \
  145. notification \
  146. notification-log-mib \
  147. snmpv3mibs \
  148. target \
  149. tcp-mib \
  150. ucd_snmp \
  151. udp-mib \
  152. utilities \
  153. SNMP_TRANSPORTS_INCLUDED = Callback UDP Unix
  154. SNMP_TRANSPORTS_EXCLUDED = TCP TCPIPv6
  155. TARGET_CFLAGS += $(FPIC)
  156. TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny
  157. CONFIGURE_ARGS += \
  158. --enable-mfd-rewrites \
  159. --enable-shared \
  160. --enable-static \
  161. --with-endianness=$(if $(CONFIG_BIG_ENDIAN),big,little) \
  162. --with-logfile=/var/log/snmpd.log \
  163. --with-persistent-directory=/usr/lib/snmp/ \
  164. --with-default-snmp-version=1 \
  165. --with-sys-contact=root@localhost \
  166. --with-sys-location=Unknown \
  167. --enable-applications \
  168. --disable-debugging \
  169. --disable-manuals \
  170. --disable-scripts \
  171. --with-out-mib-modules="$(SNMP_MIB_MODULES_EXCLUDED)" \
  172. --with-mib-modules="$(SNMP_MIB_MODULES_INCLUDED)" \
  173. --with-out-transports="$(SNMP_TRANSPORTS_EXCLUDED)" \
  174. --with-transports="$(SNMP_TRANSPORTS_INCLUDED)" \
  175. --without-openssl \
  176. --without-libwrap \
  177. --without-mysql \
  178. --without-rpm \
  179. --without-zlib \
  180. --with-nl \
  181. $(call autoconf_bool,CONFIG_IPV6,ipv6) \
  182. --disable-perl-cc-checks \
  183. --disable-embedded-perl \
  184. --without-perl-modules
  185. CONFIGURE_VARS += \
  186. ac_cv_header_netlink_netlink_h=yes \
  187. ac_cv_header_pcre_h=no \
  188. netsnmp_cv_func_nl_connect_LIBS=-lnl-tiny \
  189. ifeq ($(CONFIG_IPV6),y)
  190. SNMP_TRANSPORTS_INCLUDED+= UDPIPv6
  191. endif
  192. TARGET_LDFLAGS += -L$(TOOLCHAIN_DIR)/usr/lib
  193. define Build/Compile
  194. $(MAKE) -C $(PKG_BUILD_DIR) \
  195. INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
  196. LDFLAGS="$(TARGET_LDFLAGS) -lm -lc" \
  197. all install
  198. endef
  199. define Build/InstallDev
  200. $(INSTALL_DIR) $(2)/bin
  201. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/net-snmp-config $(2)/bin/
  202. $(SED) 's,=/usr,=$(STAGING_DIR)/usr,g' $(2)/bin/net-snmp-config
  203. $(INSTALL_DIR) $(STAGING_DIR)/usr/bin
  204. $(LN) $(STAGING_DIR)/host/bin/net-snmp-config $(STAGING_DIR)/usr/bin/
  205. $(INSTALL_DIR) $(1)/usr/include
  206. $(CP) $(PKG_INSTALL_DIR)/usr/include/net-snmp $(1)/usr/include/
  207. $(INSTALL_DIR) $(1)/usr/lib
  208. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*} $(1)/usr/lib/
  209. endef
  210. define Package/libnetsnmp/install
  211. $(INSTALL_DIR) $(1)/usr/lib
  212. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.so.* $(1)/usr/lib/
  213. endef
  214. define Package/snmp-mibs/install
  215. $(INSTALL_DIR) $(1)/usr/share/snmp/mibs
  216. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/snmp/mibs/* $(1)/usr/share/snmp/mibs/
  217. endef
  218. define Package/snmp-utils/install
  219. $(INSTALL_DIR) $(1)/usr/bin
  220. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/snmp{get,set,status,test,trap,walk} $(1)/usr/bin/
  221. endef
  222. define Package/snmpd/conffiles
  223. /etc/config/snmpd
  224. endef
  225. define Package/snmpd/install
  226. $(INSTALL_DIR) $(1)/etc/config
  227. $(INSTALL_DATA) ./files/snmpd.conf $(1)/etc/config/snmpd
  228. $(INSTALL_DIR) $(1)/etc/snmp
  229. $(LN) /var/run/snmpd.conf $(1)/etc/snmp/
  230. $(INSTALL_DIR) $(1)/etc/init.d
  231. $(INSTALL_BIN) ./files/snmpd.init $(1)/etc/init.d/snmpd
  232. $(INSTALL_DIR) $(1)/usr/sbin
  233. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snmpd $(1)/usr/sbin/snmpd
  234. endef
  235. define Package/snmptrapd/install
  236. $(INSTALL_DIR) $(1)/etc/init.d
  237. $(INSTALL_BIN) ./files/snmptrapd.init $(1)/etc/init.d/snmptrapd
  238. $(INSTALL_DIR) $(1)/usr/lib
  239. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmptrapd.so.* $(1)/usr/lib/
  240. $(INSTALL_DIR) $(1)/usr/sbin
  241. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snmptrapd $(1)/usr/sbin/
  242. endef
  243. $(eval $(call BuildPackage,libnetsnmp))
  244. $(eval $(call BuildPackage,snmp-mibs))
  245. $(eval $(call BuildPackage,snmp-utils))
  246. $(eval $(call BuildPackage,snmpd))
  247. $(eval $(call BuildPackage,snmpd-static))
  248. $(eval $(call BuildPackage,snmptrapd))