diff --git a/packages/addons/service/net-snmp/changelog.txt b/packages/addons/service/net-snmp/changelog.txt new file mode 100644 index 0000000000..d2e563e110 --- /dev/null +++ b/packages/addons/service/net-snmp/changelog.txt @@ -0,0 +1,3 @@ +100 +- Initial addon +- net-snmp 5.7.3 diff --git a/packages/addons/service/net-snmp/icon/icon.png b/packages/addons/service/net-snmp/icon/icon.png new file mode 100644 index 0000000000..1e3f6137a2 Binary files /dev/null and b/packages/addons/service/net-snmp/icon/icon.png differ diff --git a/packages/addons/service/net-snmp/package.mk b/packages/addons/service/net-snmp/package.mk new file mode 100644 index 0000000000..16265e921c --- /dev/null +++ b/packages/addons/service/net-snmp/package.mk @@ -0,0 +1,68 @@ +################################################################################ +# This file is part of LibreELEC - https://libreelec.tv +# Copyright (C) 2016 Team LibreELEC +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ + +PKG_NAME="net-snmp" +PKG_VERSION="5.7.3" +PKG_REV="100" +PKG_ARCH="any" +PKG_LICENSE="BSD" +PKG_SITE="http://www.net-snmp.org" +PKG_URL="http://sourceforge.net/projects/net-snmp/files/$PKG_NAME/$PKG_VERSION/$PKG_NAME-$PKG_VERSION.tar.gz" +PKG_DEPENDS_TARGET="toolchain" +PKG_SECTION="service" +PKG_SHORTDESC="Simple Network Management Protocol utilities." +PKG_LONGDESC="Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment." +PKG_AUTORECONF="yes" + +PKG_IS_ADDON="yes" +PKG_ADDON_NAME="Net-SNMP" +PKG_ADDON_TYPE="xbmc.service" + +PKG_CONFIGURE_OPTS_TARGET="--with-defaults \ + --disable-applications \ + --disable-manuals \ + --disable-debugging \ + --disable-deprecated \ + --disable-snmptrapd-subagent \ + --disable-perl-cc-checks \ + --with-perl-modules=no \ + --enable-mini-agent \ + --enable-static=no \ + --enable-shared=yes \ + --with-logfile=/storage/.kodi/userdata/addon_data/${PKG_ADDON_ID}/ \ + --with-persistent-directory=/storage/.kodi/userdata/addon_data/${PKG_ADDON_ID}/ \ + --disable-embedded-perl" + +make_target() { + make +} + +makeinstall_target() { + make install INSTALL_PREFIX=$ROOT/$PKG_BUILD/.$TARGET_NAME +} + +addon() { + mkdir -p $ADDON_BUILD/$PKG_ADDON_ID + mv $PKG_BUILD/.$TARGET_NAME/usr/sbin/snmpd $PKG_BUILD/.$TARGET_NAME/usr/bin/snmpd + rm -rf $PKG_BUILD/.$TARGET_NAME/usr/sbin/ + rm -rf $PKG_BUILD/.$TARGET_NAME/usr/include/ + cp -r $PKG_BUILD/.$TARGET_NAME/usr/* $ADDON_BUILD/$PKG_ADDON_ID/ + $STRIP $ADDON_BUILD/$PKG_ADDON_ID/lib/*.so + $STRIP $ADDON_BUILD/$PKG_ADDON_ID/bin/snmpd +} + diff --git a/packages/addons/service/net-snmp/source/bin/snmpd.start b/packages/addons/service/net-snmp/source/bin/snmpd.start new file mode 100644 index 0000000000..79c318bf53 --- /dev/null +++ b/packages/addons/service/net-snmp/source/bin/snmpd.start @@ -0,0 +1,27 @@ +#!/bin/sh +################################################################################ +# This file is part of LibreELEC - https://libreelec.tv +# Copyright (C) 2016 Team LibreELEC +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ + +. /etc/profile +oe_setup_addon service.net-snmp + +ADDON_ID=service.net-snmp +ADDON_DIR="$HOME/.kodi/addons/$ADDON_ID" +ADDON_HOME="$HOME/.kodi/userdata/addon_data/$ADDON_ID" + +$ADDON_DIR/bin/snmpd -LS0-6d -c $ADDON_DIR/snmpd.conf -M /storage/.kodi/addons/service.net-snmp/share/snmp/mibs -p /var/run/snmpd.pid diff --git a/packages/addons/service/net-snmp/source/bin/snmpd.stop b/packages/addons/service/net-snmp/source/bin/snmpd.stop new file mode 100644 index 0000000000..25847b0fca --- /dev/null +++ b/packages/addons/service/net-snmp/source/bin/snmpd.stop @@ -0,0 +1,28 @@ +#!/bin/sh +################################################################################ +# This file is part of LibreELEC - https://libreelec.tv +# Copyright (C) 2016 Team LibreELEC +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ + +. /etc/profile +oe_setup_addon service.net-snmp + +ADDON_ID=service.net-snmp +ADDON_DIR="$HOME/.kodi/addons/$ADDON_ID" +ADDON_HOME="$HOME/.kodi/userdata/addon_data/$ADDON_ID" + +PID=`cat /var/run/snmpd.pid` +kill -TERM $PID diff --git a/packages/addons/service/net-snmp/source/default.py b/packages/addons/service/net-snmp/source/default.py new file mode 100644 index 0000000000..1a91d91ede --- /dev/null +++ b/packages/addons/service/net-snmp/source/default.py @@ -0,0 +1,17 @@ +################################################################################ +# This file is part of LibreELEC - https://libreelec.tv +# Copyright (C) 2016 Team LibreELEC +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ diff --git a/packages/addons/service/net-snmp/source/snmpd.conf b/packages/addons/service/net-snmp/source/snmpd.conf new file mode 100644 index 0000000000..df025fa93a --- /dev/null +++ b/packages/addons/service/net-snmp/source/snmpd.conf @@ -0,0 +1,10 @@ +com2sec local default libreelec +group localgroup v2c local +access localgroup "" any noauth exact all all none + +view all included .1 80 + +syslocation HOME +syscontact root@libreelec + +dontLogTCPWrappersConnects yes diff --git a/packages/addons/service/net-snmp/source/system.d/service.net-snmp.service b/packages/addons/service/net-snmp/source/system.d/service.net-snmp.service new file mode 100644 index 0000000000..bec1832670 --- /dev/null +++ b/packages/addons/service/net-snmp/source/system.d/service.net-snmp.service @@ -0,0 +1,12 @@ +[Unit] +Description=Net-SNMP software bundle +After=network-online.target +Requires=network-online.target + +[Service] +Type=forking +ExecStart=/bin/sh -c "exec sh /storage/.kodi/addons/service.net-snmp/bin/snmpd.start" +ExecStop=/bin/sh -c "exec sh /storage/.kodi/addons/service.net-snmp/bin/snmpd.stop" + +[Install] +WantedBy=kodi.target