summaryrefslogtreecommitdiffstats
path: root/source.local/n/net-snmp
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2013-03-22 16:47:17 -0700
committer Eric Hameleers <alien@slackware.com>2013-03-22 16:47:17 -0700
commit69dd99f961988fa15da8d7f0d63b62f3385419c3 (patch)
treed57eb3e85e1d08e7815787de26946ee42c398b66 /source.local/n/net-snmp
downloadalienarm-69dd99f961988fa15da8d7f0d63b62f3385419c3.tar.gz
alienarm-69dd99f961988fa15da8d7f0d63b62f3385419c3.tar.xz
Initial commit of a Slackware cross-arch bootstrap framework.
Diffstat (limited to 'source.local/n/net-snmp')
-rw-r--r--source.local/n/net-snmp/doinst.sh.gzbin0 -> 344 bytes
-rwxr-xr-xsource.local/n/net-snmp/net-snmp.SlackBuild192
-rw-r--r--source.local/n/net-snmp/net-snmp.net-snmp-create-v3-user.etc.snmpd.conf.diff.gzbin0 -> 341 bytes
-rw-r--r--source.local/n/net-snmp/rc.snmpd54
-rw-r--r--source.local/n/net-snmp/slack-desc19
-rw-r--r--source.local/n/net-snmp/snmpd.conf.gzbin0 -> 4909 bytes
6 files changed, 265 insertions, 0 deletions
diff --git a/source.local/n/net-snmp/doinst.sh.gz b/source.local/n/net-snmp/doinst.sh.gz
new file mode 100644
index 0000000..89901a7
--- /dev/null
+++ b/source.local/n/net-snmp/doinst.sh.gz
Binary files differ
diff --git a/source.local/n/net-snmp/net-snmp.SlackBuild b/source.local/n/net-snmp/net-snmp.SlackBuild
new file mode 100755
index 0000000..645bdb7
--- /dev/null
+++ b/source.local/n/net-snmp/net-snmp.SlackBuild
@@ -0,0 +1,192 @@
+#!/bin/sh
+
+# Copyright 2006, 2007, 2008, 2009, 2010, 2011 Patrick J. Volkerding, Sebeka, MN, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Modified 2012 by Eric Hameleers <alien at slackware.com> for ARM port.
+
+
+PKGNAM=net-snmp
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-2}
+
+# Automatically determine the architecture we're building on:
+MARCH=$( uname -m )
+if [ -z "$ARCH" ]; then
+ case "$MARCH" in
+ i?86) export ARCH=i486 ;;
+ armv7hl) export ARCH=$MARCH ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$MARCH ;;
+ esac
+fi
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+elif [ "$ARCH" = "armv7hl" ]; then
+ SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16"
+ LIBDIRSUFFIX=""
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+case "$ARCH" in
+ arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
+ *) TARGET=$ARCH-slackware-linux ;;
+esac
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-${PKGNAM}
+rm -rf $PKG
+mkdir -p $TMP $PKG
+
+cd $TMP
+rm -rf ${PKGNAM}-${VERSION}
+tar xvf $CWD/${PKGNAM}-$VERSION.tar.?z* || exit 1
+cd ${PKGNAM}-$VERSION
+
+zcat $CWD/net-snmp.net-snmp-create-v3-user.etc.snmpd.conf.diff.gz | patch -p1 --verbose || exit 1
+
+# Make sure ownerships and permissions are sane:
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# Configure:
+CFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc/snmp \
+ --mandir=/usr/man \
+ --enable-ipv6 \
+ --disable-debugging \
+ --enable-static=no \
+ --with-libwrap \
+ --with-perl-modules \
+ --with-default-snmp-version=3 \
+ --with-sys-contact="root@example.org" \
+ --with-sys-location="unknown" \
+ --with-logfile="/var/log/snmpd.log" \
+ --with-persistent-directory="/var/lib/net-snmp" \
+ --without-rpm \
+ --program-suffix= \
+ --program-prefix= \
+ --build=$TARGET
+
+# This appears to require additional third-party python modules?
+# Maybe something for later.
+# --with-python-modules
+
+# Build and install:
+# This seems to not play well with "-j N"...
+make INSTALLDIRS=vendor || exit 1
+make install INSTALLDIRS=vendor DESTDIR=$PKG || exit 1
+
+# Evidently --mandir=/usr/man doesn't catch everything...
+if [ -d $PKG/usr/share/man/man3 ]; then
+ mkdir -p $PKG/usr/man/man3
+ mv $PKG/usr/share/man/man3/* $PKG/usr/man/man3
+ rmdir $PKG/usr/share/man/man3 $PKG/usr/share/man
+fi
+mkdir -p $PKG/usr
+mv $PKG/usr/share/man $PKG/usr
+
+mkdir -p $PKG/var/lib/net-snmp
+mkdir -p $PKG/etc/snmp
+zcat $CWD/snmpd.conf.gz > $PKG/etc/snmp/snmpd.conf.new
+mkdir -p $PKG/etc/rc.d
+cat $CWD/rc.snmpd > $PKG/etc/rc.d/rc.snmpd.new
+
+# Strip binaries:
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+
+# Compress and link manpages, if any:
+if [ -d $PKG/usr/man ]; then
+ ( cd $PKG/usr/man
+ for manpagedir in $(find . -type d -name "man*") ; do
+ ( cd $manpagedir
+ for eachpage in $( find . -type l -maxdepth 1) ; do
+ ln -s $( readlink $eachpage ).gz $eachpage.gz
+ rm $eachpage
+ done
+ gzip -9 *.*
+ )
+ done
+ )
+fi
+
+# Compress info files, if any:
+if [ -d $PKG/usr/info ]; then
+ ( cd $PKG/usr/info
+ rm -f dir
+ gzip -9 *
+ )
+fi
+
+# Remove perllocal files:
+( cd $PKG ; find . -name perllocal.pod -exec rm "{}" \; )
+
+# This removes our DESTDIR from the packlist filenames, to keep perl's
+# internal inventories consistent and correct.
+find $PKG -name .packlist | while read plist ; do
+ sed -e "s%$PKG%%g" \
+ -e "s%/share/man%/man%g" \
+ -re "s%\.([1-9]n?|3pm)$%&.gz%g # extend man filenames for .gz" \
+ ${plist} > ${plist}.new
+ mv -f ${plist}.new ${plist}
+done
+
+# Add a documentation directory:
+mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
+cp -a \
+ AGENT.txt CHANGES COPYING* CodingStyle EXAMPLE* FAQ \
+ INSTALL NEWS PORTING README* TODO \
+ $PKG/usr/doc/${PKGNAM}-$VERSION
+
+# If there's a ChangeLog, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r ChangeLog ]; then
+ DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
+ cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+ touch -r ChangeLog $DOCSDIR/ChangeLog
+fi
+
+mkdir -p $PKG/install
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz
+
diff --git a/source.local/n/net-snmp/net-snmp.net-snmp-create-v3-user.etc.snmpd.conf.diff.gz b/source.local/n/net-snmp/net-snmp.net-snmp-create-v3-user.etc.snmpd.conf.diff.gz
new file mode 100644
index 0000000..91992c6
--- /dev/null
+++ b/source.local/n/net-snmp/net-snmp.net-snmp-create-v3-user.etc.snmpd.conf.diff.gz
Binary files differ
diff --git a/source.local/n/net-snmp/rc.snmpd b/source.local/n/net-snmp/rc.snmpd
new file mode 100644
index 0000000..cd52366
--- /dev/null
+++ b/source.local/n/net-snmp/rc.snmpd
@@ -0,0 +1,54 @@
+#!/bin/sh
+#
+# rc.snmpd This shell script takes care of starting and stopping
+# the net-snmp SNMP daemon
+
+OPTIONS="-A -p /var/run/snmpd -a"
+
+start() {
+ if [ -x /usr/sbin/snmpd -a -f /etc/snmp/snmpd.conf ]; then
+ echo -n "Starting snmpd: "
+ /usr/sbin/snmpd $OPTIONS -c /etc/snmp/snmpd.conf
+ echo " /usr/sbin/snmpd $OPTIONS -c /etc/snmp/snmpd.conf"
+ fi
+}
+
+stop() {
+ # Stop daemons.
+ COUNT=0
+ echo -n "Shutting down snmpd: "
+ while `killall snmpd 2>/dev/null`; do
+ echo -n "."
+ sleep 1
+ COUNT=$((COUNT+1))
+ if [ $COUNT -ge 30 ]; then
+ killall -9 snmpd
+ sleep 1
+ break
+ fi
+ done
+ echo " DONE"
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|reload)
+ stop
+ start
+ ;;
+ condrestart)
+ if [ -f /var/run/snmpd ]; then
+ stop
+ start
+ fi
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|condrestart}"
+ ;;
+esac
diff --git a/source.local/n/net-snmp/slack-desc b/source.local/n/net-snmp/slack-desc
new file mode 100644
index 0000000..7659f7f
--- /dev/null
+++ b/source.local/n/net-snmp/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+net-snmp: net-snmp (Simple Network Management Protocol tools)
+net-snmp:
+net-snmp: Various tools relating to the Simple Network Management Protocol:
+net-snmp:
+net-snmp: An extensible agent
+net-snmp: An SNMP library
+net-snmp: Tools to request or set information from SNMP agents
+net-snmp: Tools to generate and handle SNMP traps
+net-snmp: A version of the unix 'netstat' command using SNMP
+net-snmp: A graphical Perl/Tk/SNMP based mib browser
+net-snmp:
diff --git a/source.local/n/net-snmp/snmpd.conf.gz b/source.local/n/net-snmp/snmpd.conf.gz
new file mode 100644
index 0000000..25b8131
--- /dev/null
+++ b/source.local/n/net-snmp/snmpd.conf.gz
Binary files differ