initial import
This commit is contained in:
79
net-snmp/PKGBUILD
Normal file
79
net-snmp/PKGBUILD
Normal file
@@ -0,0 +1,79 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
pkgname=net-snmp
|
||||
pkgver=5.9.3
|
||||
_debver=$pkgver
|
||||
_debrel=2
|
||||
pkgrel=2
|
||||
pkgdesc="A suite of applications used to implement SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6"
|
||||
arch=('i686' 'x86_64')
|
||||
url='http://www.net-snmp.org/'
|
||||
license=('Expat' 'ISC' 'Modified-BSD')
|
||||
depends=('libnsl' 'libpcap' 'pciutils' 'pcre')
|
||||
makedepends=('python-setuptools' 'quilt')
|
||||
optdepends=('perl-term-readkey: for snmpcheck application'
|
||||
'perl-tk: for snmpcheck and tkmib applications'
|
||||
'python: for the python modules'
|
||||
'logger: message logging support')
|
||||
options=('!emptydirs' '!makeflags')
|
||||
source=(https://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz
|
||||
https://deb.debian.org/debian/pool/main/n/net-snmp/net-snmp_${_debver}+dfsg-${_debrel}.debian.tar.xz
|
||||
snmpd.initd
|
||||
snmpd.confd
|
||||
snmptrapd.initd
|
||||
snmptrapd.confd)
|
||||
sha512sums=('a476df4967029a2eb03d27b0e250170785d0a8c143d49b900ee958c3cbdfaccd415b70af40f6fbed9cb8819d522c35a6073a431091d908ccc7c018fa0aaa2abc'
|
||||
'6fdefc9f42c55a23cfbb7066dda98eff78f0f918934489b5dcd182bac5bf5622168dd7b9349343cd77e7a9bb20138c0359d8991ac9cf20274c898db384b482fb'
|
||||
'10394f04dee23537a195f5aed63a3e758ca90227e269076ae9d13f883c7bd666c1c43823d1b869c43f232e97dc4138e52648cae995327f7a7f676ba416ee6fff'
|
||||
'e64f93631e5cb2160d3fb26abb84fc74f5632d8875227d5c8dfa24809b25e8202dcf23251ea8f296aedf16298c31ce49b8e64fb6325c18775d8899a50b853bbc'
|
||||
'316964703559082b1626280bd0532a32533185741d1919f255473ae6bfe30f82b71bee79093cb0b341c99427e14a5ed201b6aa2886a9123c89d5f5f78496f706'
|
||||
'283d1503ebca55046cc273f693a257be3e8e6f26b5db10a3b64a5455079a41568eb40c1a3f5dbc698b822502d5e8120ea80b9e2c3ac4aa1d830d318228c0beca')
|
||||
|
||||
prepare() {
|
||||
cd ${pkgname}-${pkgver}
|
||||
|
||||
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
|
||||
# Debian patches
|
||||
export QUILT_PATCHES=debian/patches
|
||||
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
|
||||
export QUILT_DIFF_ARGS='--no-timestamps'
|
||||
|
||||
mv "$srcdir"/debian .
|
||||
|
||||
# Doesn't apply
|
||||
rm -v debian/patches/26_kfreebsd.patch || true
|
||||
rm -v debian/patches/27_kfreebsd.patch || true
|
||||
|
||||
quilt push -av
|
||||
fi
|
||||
|
||||
autoreconf -vi
|
||||
}
|
||||
|
||||
build() {
|
||||
cd ${pkgname}-${pkgver}
|
||||
./configure --prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
--mandir=/usr/share/man \
|
||||
--enable-ucd-snmp-compatibility \
|
||||
--enable-ipv6 \
|
||||
--with-python-modules \
|
||||
--with-default-snmp-version="3" \
|
||||
--with-sys-contact="root@localhost" \
|
||||
--with-sys-location="Unknown" \
|
||||
--with-logfile="/var/log/snmpd.log" \
|
||||
--with-mib-modules="host misc/ipfwacc ucd-snmp/diskio tunnel ucd-snmp/dlmod" \
|
||||
--with-persistent-directory="/var/net-snmp"
|
||||
make NETSNMP_DONT_CHECK_VERSION=1
|
||||
}
|
||||
|
||||
package() {
|
||||
cd ${pkgname}-${pkgver}
|
||||
sed -i -e "s:install --basedir=\$\$dir:install --basedir=\$\$dir --root=${pkgdir}:" Makefile
|
||||
make DESTDIR="${pkgdir}" INSTALL_PREFIX="${pkgdir}" INSTALLDIRS=vendor install
|
||||
install -D -m644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}"
|
||||
for f in snmpd snmptrapd; do
|
||||
install -D -m644 "${srcdir}/$f.confd" "${pkgdir}/etc/conf.d/$f"
|
||||
install -D -m755 "${srcdir}/$f.initd" "${pkgdir}/etc/init.d/$f"
|
||||
done
|
||||
}
|
||||
19
net-snmp/snmpd.confd
Normal file
19
net-snmp/snmpd.confd
Normal file
@@ -0,0 +1,19 @@
|
||||
# Copyright 1999-2004 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# Initial (empty) options.
|
||||
SNMPD_FLAGS=""
|
||||
|
||||
# Disable smux by default
|
||||
SNMPD_FLAGS="${SNMPD_FLAGS} -I -smux"
|
||||
|
||||
# Enable connection logging.
|
||||
#SNMPD_FLAGS="${SNMPD_FLAGS} -a"
|
||||
|
||||
# Enable syslog and disable file log.
|
||||
#SNMPD_FLAGS="${SNMPD_FLAGS} -Lsd -Lf /dev/null"
|
||||
|
||||
# Enable agentx socket as /var/agentx/master
|
||||
# *NOTE* Before uncommenting this, make sure
|
||||
# the /var/agentx directory exists.
|
||||
#SNMPD_FLAGS="${SNMPD_FLAGS} -x /var/agentx/master"
|
||||
34
net-snmp/snmpd.initd
Normal file
34
net-snmp/snmpd.initd
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
SNMPD_PIDFILE="${SNMPD_PIDFILE:-/var/run/snmpd.pid}"
|
||||
|
||||
extra_started_commands="reload"
|
||||
|
||||
command="/usr/sbin/snmpd"
|
||||
command_args="-p ${SNMPD_PIDFILE} ${SNMPD_FLAGS}"
|
||||
pidfile="${SNMPD_PIDFILE}"
|
||||
|
||||
depend() {
|
||||
use logger
|
||||
}
|
||||
|
||||
checkconfig() {
|
||||
if [ ! -e /etc/snmp/snmpd.conf ] ; then
|
||||
eerror "${SVCNAME} requires an /etc/snmp/snmpd.conf configuration file"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkconfig || return 1
|
||||
}
|
||||
|
||||
reload() {
|
||||
checkconfig || return 1
|
||||
|
||||
ebegin "Reloading ${SVCNAME} configuration"
|
||||
kill -HUP $(cat ${SNMPD_PIDFILE}) 2>&1 > /dev/null
|
||||
eend $?
|
||||
}
|
||||
15
net-snmp/snmptrapd.confd
Normal file
15
net-snmp/snmptrapd.confd
Normal file
@@ -0,0 +1,15 @@
|
||||
# Copyright 1999-2005 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# extra flags to pass to snmptrapd
|
||||
SNMPTRAPD_FLAGS=""
|
||||
|
||||
# ignore authentication failure traps
|
||||
#SNMPTRAPD_FLAGS="${SNMPTRAPD_FLAGS} -a"
|
||||
|
||||
# log messages to specified file
|
||||
#SNMPTRAPD_FLAGS="${SNMPTRAPD_FLAGS} -Lf /var/log/snmptrapd.log"
|
||||
|
||||
# log messages to syslog with the specified facility
|
||||
# where facility is: 'd' = LOG_DAEMON, 'u' = LOG_USER, [0-7] = LOG_LOCAL[0-7]
|
||||
#SNMPTRAPD_FLAGS="${SNMPTRAPD_FLAGS} -Ls d"
|
||||
13
net-snmp/snmptrapd.initd
Normal file
13
net-snmp/snmptrapd.initd
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
SNMPTRAPD_PIDFILE="${SNMPTRAPD_PIDFILE:-/var/run/snmptrapd.pid}"
|
||||
|
||||
command="/usr/sbin/snmptrapd"
|
||||
command_args="-p ${SNMPTRAPD_PIDFILE} ${SNMPTRAPD_FLAGS}"
|
||||
pidfile="${SNMPTRAPD_PIDFILE}"
|
||||
|
||||
depend() {
|
||||
use logger
|
||||
}
|
||||
Reference in New Issue
Block a user