net-snmp: add snmptrapd packages
authorStijn Tintel <stijn@linux-ipv6.be>
Thu, 28 Sep 2017 23:28:23 +0000 (02:28 +0300)
committerStijn Tintel <stijn@linux-ipv6.be>
Thu, 28 Sep 2017 23:40:49 +0000 (02:40 +0300)
Closes #4724.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
net/net-snmp/Makefile
net/net-snmp/files/snmptrapd.init [new file with mode: 0644]

index a66f4a880c179bbe1dca1ad8c9b1f961e81526b5..5f6a61d734954736a2293a2d2cbc4261f8095f21 100644 (file)
@@ -102,6 +102,18 @@ $(call Package/net-snmp/Default)
 endef
 
 
+define Package/snmptrapd
+$(call Package/net-snmp/Default)
+  DEPENDS:=+libnetsnmp
+  TITLE:=Open source SNMP implementation (notification receiver)
+endef
+
+define Package/snmptrapd/description
+$(call Package/net-snmp/Default/description)
+ .
+ This package contains the SNMP notification receiver.
+endef
+
 
 SNMP_MIB_MODULES_INCLUDED = \
        agent/extend \
@@ -189,6 +201,7 @@ CONFIGURE_ARGS += \
        --with-transports="$(SNMP_TRANSPORTS_INCLUDED)" \
        --without-openssl \
        --without-libwrap \
+       --without-mysql \
        --without-rpm \
        --without-zlib \
        --with-nl \
@@ -253,8 +266,18 @@ define Package/snmpd/install
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snmpd $(1)/usr/sbin/snmpd
 endef
 
+define Package/snmptrapd/install
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/snmptrapd.init $(1)/etc/init.d/snmptrapd
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmptrapd.so.* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snmptrapd $(1)/usr/sbin/
+endef
+
 $(eval $(call BuildPackage,libnetsnmp))
 $(eval $(call BuildPackage,snmp-mibs))
 $(eval $(call BuildPackage,snmp-utils))
 $(eval $(call BuildPackage,snmpd))
 $(eval $(call BuildPackage,snmpd-static))
+$(eval $(call BuildPackage,snmptrapd))
diff --git a/net/net-snmp/files/snmptrapd.init b/net/net-snmp/files/snmptrapd.init
new file mode 100644 (file)
index 0000000..43278a2
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh /etc/rc.common
+
+START=50
+
+USE_PROCD=1
+PROG="/usr/sbin/snmptrapd"
+
+start_service() {
+       procd_open_instance
+
+       procd_set_param command $PROG -Lf /dev/null -f
+       procd_set_param respawn
+
+       procd_close_instance
+}