Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add net-snmp-5.7.1

  • Loading branch information...
commit 1def9871a3eb69651114392d2dd39fdf4965bab1 1 parent 592481f
@ivan-m authored
View
1  metadata/categories.conf
@@ -1 +1,2 @@
app-text
+net
View
201 packages/net/net-snmp/net-snmp-5.7.1.exheres-0
@@ -0,0 +1,201 @@
+# Copyright 2011 Ivan Miljenovic <Ivan.Miljenovic@gmail.com>
+# Distributed under the terms of the GNU General Public License v2
+# Based in part upon 'net-snmp-5.6.1.ebuild' from Gentoo, which is:
+# Copyright 1999-2011 Gentoo Foundation
+
+require flag-o-matic python [ python_dep="2.3&<3" ] perl-module sourceforge [ suffix=tar.gz ]
+
+SUMMARY="Various tools relating to the Simple Network Management Protocol"
+DESCRIPTION="
+The suite includes:
+
+ * An extensible agent
+ * An SNMP library
+ * tools to request or set information from SNMP agents
+ * tools to generate and handle SNMP traps
+ * a version of the unix 'netstat' command using SNMP
+ * a graphical Perl/Tk/SNMP based mib browser
+"
+HOMEPAGE="http://www.net-snmp.org/"
+
+LICENCES="BSD-3 BSD-2"
+SLOT="0"
+PLATFORMS="~amd64"
+
+MYOPTIONS="
+ bzip2
+ diskio [[ description = [ Enable the use of diskio mibs ] ]]
+ doc
+ elf [[ description = [ Enable the use of elf utils to check uptime on some systems ] ]]
+ extensible [[ description = [ build deprecated extensible mib module (extend is successor) ] ]]
+ ipv6
+ mfd-rewrites [[ description = [ Use MFD rewrites of mib modules where available ] ]]
+ minimal
+ perl
+ python
+ rpm [[ requires = [ bzip2 zlib ] description = [ Enable the rpm snmp probing ] ]]
+ sendmail [[ description = [ Enable sendmail statistics monitoring ] ]]
+ smux [[ description = [ Enable the smux MIBS module ] ]]
+ ssl
+ tcpd
+ X [[ note = [ Only used with the perl option ] ]]
+ zlib
+"
+
+DEPENDENCIES="
+ build:
+ sys-devel/autoconf[>=2.61]
+ sys-apps/sed[>=4]
+ doc? ( app-doc/doxygen )
+
+ build+run:
+ ssl? ( dev-libs/openssl[>=0.9.6d] )
+ tcpd? ( sys-apps/tcp-wrappers[>=7.6] )
+ rpm? (
+ app-arch/rpm
+ dev-libs/popt
+ )
+ bzip2? ( app-arch/bzip2 )
+ zlib? ( sys-libs/zlib[>=1.1.4] )
+ elf? ( dev-util/elfutils )
+ python? ( dev-python/setuptools )
+
+ run:
+ perl? (
+ X? ( dev-perl/Tk )
+ !minimal? ( dev-perl/TermReadKey )
+ )
+"
+
+# autoconf dep required for gentoo bug #225893
+
+pkg_setup() {
+ option python && python_pkg_setup
+}
+
+src_prepare() {
+ # fix access violation in make check
+ sed -i \
+ -e 's/\(snmpd.*\)-Lf/\1-l/' \
+ testing/fulltests/support/simple_eval_tools.sh || die "sed eval_tools.sh failed"
+ # fix path in fixproc
+ sed -i \
+ -e 's|\(database_file =.*\)/local\(.*\)$|\1\2|' \
+ local/fixproc || die "sed fixproc failed"
+ if option python ; then
+ PYTHON_DIR="$(python_get_sitedir)"
+ sed -i -e "s:\(install --basedir=\$\$dir\):\1 --root='${IMAGE}':" Makefile.in || \
+ die "sed python failed"
+ fi
+
+ # remove CFLAGS from net-snmp-config script (Gentoo bug #257622):
+ sed -i \
+ -e 's|@CFLAGS@ ||g' \
+ -e 's|@LDFLAGS@ ||g' \
+ net-snmp-config.in || die "sedding CFLAGS failed"
+
+ # Respect LDFLAGS
+ sed -i Makefile.top \
+ -e '/^LIB_LD_CMD/{s|$(CFLAGS)|& $(LDFLAGS)|g}' \
+ || die "sed LDFLAGS failed"
+
+ # Fix version number:
+ sed -i \
+ -e "s|PACKAGE_VERSION|\"${PV}\"|g" \
+ snmplib/snmp_version.c || die "sedding version failed"
+}
+
+src_configure() {
+ strip-flags
+
+ local mibs="host ucd-snmp/dlmod"
+ option diskio && mibs="${mibs} ucd-snmp/diskio"
+ option extensible && mibs="${mibs} ucd-snmp/extensible"
+ option sendmail && mibs="${mibs} mibII/mta_sendmail"
+ option smux && mibs="${mibs} smux"
+
+ econf \
+ --with-install-prefix="${IMAGE}" \
+ --with-sys-location="Unknown" \
+ --with-sys-contact="root@Unknown" \
+ --with-default-snmp-version="3" \
+ --with-mib-modules="${mibs}" \
+ --with-logfile="/var/log/net-snmpd.log" \
+ --with-persistent-directory="/var/lib/net-snmp" \
+ --enable-ucd-snmp-compatibility \
+ --enable-shared \
+ --with-ldflags="${LDFLAGS} " \
+ --enable-as-needed \
+ $(option_enable ipv6) \
+ $(option_enable perl embedded-perl) \
+ $(option_enable !ssl internal-md5) \
+ $(option_with elf) \
+ $(option_with perl perl-modules) \
+ $(option_with python python-modules) \
+ $(option_with ssl openssl) \
+ $(option_with tcpd libwrap) \
+ $(option_with bzip2) \
+ $(option_with zlib) \
+ $(option_with rpm)
+}
+
+src_compile() {
+ emake -j1 OTHERLDFLAGS="${LDFLAGS}" || die "emake failed"
+
+ if option doc ; then
+ einfo "Building HTML Documentation"
+ make docsdox || die "failed to build docs"
+ fi
+}
+
+src_test() {
+ cd testing
+ if ! make test ; then
+ echo
+ einfo "Don't be alarmed if a few tests FAIL."
+ einfo "This could happen for several reasons:"
+ einfo " - You don't already have a working configuration."
+ einfo " - Your ethernet interface isn't properly configured."
+ echo
+ fi
+}
+
+src_install () {
+ # Gentoo bug #317965
+ emake -j1 DESTDIR="${IMAGE}" install || die "make install failed"
+
+ if option perl ; then
+ fixlocalpod
+ option X || rm -f "${IMAGE}"/usr/bin/tkmib
+ else
+ rm -f "${IMAGE}"/usr/bin/mib2c "${IMAGE}"/usr/bin/snmpcheck "${IMAGE}"/usr/bin/tkmib
+ fi
+
+ dodoc AGENT.txt ChangeLog FAQ INSTALL NEWS PORTING README* TODO || die
+ newdoc EXAMPLE.conf.def EXAMPLE.conf || die
+
+ option doc && { dodoc docs/html/* || die ; }
+
+ keepdir /etc/snmp /var/lib/net-snmp
+
+ # newinitd "${FILES}"/snmpd.init snmpd || die
+ # newconfd "${FILES}"/snmpd.conf snmpd || die
+
+ # newinitd "${FILES}"/snmptrapd.init snmptrapd || die
+ # newconfd "${FILES}"/snmptrapd.conf snmptrapd || die
+
+ # Remove everything not required for an agent.
+ # Keep only the snmpd, snmptrapd, MIBs, headers and libraries.
+ if option minimal; then
+ elog "OPTION='minimal' is set. Removing excess/non-minimal components."
+ rm -rf "${IMAGE}"/usr/bin/{encode_keychange,snmp{get,getnext,set,usm,walk,bulkwalk,table,trap,bulkget,translate,status,delta,test,df,vacm,netstat,inform,snmpcheck}}
+ rm -rf "${IMAGE}"/usr/share/snmp/snmpconf-data "${IMAGE}"/usr/share/snmp/*.conf
+ rm -rf "${IMAGE}"/usr/bin/{fixproc,traptoemail} "${IMAGE}"/usr/bin/snmpc{heck,onf}
+ find "${IMAGE}" -name '*.pl' -exec rm -f '{}' \;
+ option ipv6 || rm -rf "${IMAGE}"/usr/share/snmp/mibs/IPV6*
+ fi
+
+ option python && python_bytecompile
+
+}
+
Please sign in to comment.
Something went wrong with that request. Please try again.