63 lines
1.9 KiB
Plaintext
63 lines
1.9 KiB
Plaintext
# Description: SNMP daemon and client tools
|
|
# URL: http://net-snmp.sourceforge.net/
|
|
# Maintainer: Fredrik Rinnestam, fredrik at rinnestam dot se
|
|
# Depends on: perl lm_sensors
|
|
|
|
name=net-snmp
|
|
version=5.7.3
|
|
release=1
|
|
source=(http://download.sourceforge.net/$name/$name-$version.tar.gz \
|
|
snmpd snmpd.conf)
|
|
|
|
build() {
|
|
cd $name-$version
|
|
export NETSNMP_DONT_CHECK_VERSION=1
|
|
./configure --prefix=/usr \
|
|
--sysconfdir=/etc \
|
|
--mandir=/usr/man \
|
|
--enable-shared \
|
|
--enable-embedded-perl \
|
|
--with-perl-modules \
|
|
--without-rpm \
|
|
--with-openssl \
|
|
--with-zlib \
|
|
--with-mib-modules="ucd-snmp/lmsensorsMib smux agentx ucd-snmp/diskio" \
|
|
--with-sys-location="Unknown" \
|
|
--with-sys-contact="root@localhost" \
|
|
--with-default-snmp-version="3" \
|
|
--with-logfile=/var/log/snmp/snmpd.log \
|
|
--with-persistent-directory=/var/lib/snmp \
|
|
--with-ldflags="-lsensors"
|
|
make
|
|
make install INSTALL_PREFIX=$PKG DESTDIR=$PKG
|
|
|
|
# Clean up perl stuff: clean common junks first, ...
|
|
find $PKG/usr/lib/perl5 -name .packlist \
|
|
-o -name perllocal.pod \
|
|
-o \( \
|
|
-name *.bs -a -empty \
|
|
\) \
|
|
| xargs rm
|
|
# ... less common ones and empty directories
|
|
rm -rf \
|
|
$PKG/usr/lib/perl5/site_perl/5.1?/linux/Bundle \
|
|
$PKG/usr/lib/perl5/5.1? \
|
|
$PKG/usr/lib/perl5/site_perl/5.1?/linux/auto/Bundle
|
|
rm $PKG/usr/include/net-snmp/library/README
|
|
|
|
mkdir -p $PKG/var/{lib,run,log}/snmp
|
|
touch $PKG/var/log/snmp/snmpd.log
|
|
|
|
# Can not decide whether to install this dummy files to allow correct
|
|
# cleanup on package removal or not. (snmpd creates them)
|
|
#touch $PKG/var/lib/snmpd.conf
|
|
#touch $PKG/usr/share/snmp/mibs/.index
|
|
|
|
chown -R daemon:daemon $PKG/var/{lib,run,log}/snmp
|
|
|
|
# Seems to be an overkill, install a very basic config instead
|
|
#install -D -m 644 EXAMPLE.conf $PKG/etc/snmp/snmpd.conf.sample
|
|
install -D -m 644 $SRC/snmpd.conf $PKG/etc/snmp/snmpd.conf
|
|
install -D -m 755 $SRC/snmpd $PKG/etc/rc.d/snmpd
|
|
}
|