68 lines
2.1 KiB
Plaintext
68 lines
2.1 KiB
Plaintext
# Description: SNMP daemon and client tools
|
|
# URL: http://net-snmp.sourceforge.net/
|
|
# Maintainer: Mikhail Kolesnik, mike at openbunker dot org
|
|
# Packager: Oleksiy V. Khilkevich, centericq at ukr dot net
|
|
# Depends on: perl zlib openssl lm_sensors
|
|
|
|
name=net-snmp
|
|
version=5.3.1
|
|
release=2
|
|
source=(http://dl.sourceforge.net/sourceforge/$name/$name-$version.tar.gz \
|
|
eval_pv_detection.fix snmpd snmpd.conf)
|
|
|
|
build() {
|
|
cd $name-$version
|
|
./configure --prefix=/usr \
|
|
--sysconfdir=/etc \
|
|
--enable-shared \
|
|
--enable-embedded-perl \
|
|
--with-perl-modules \
|
|
--without-rpm \
|
|
--with-openssl \
|
|
--with-libwrap \
|
|
--with-zlib \
|
|
--with-mib-modules="ucd-snmp/lmSensors smux agentx ucd-snmp/diskio mibII/mta_sendmail" \
|
|
--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
|
|
|
|
# Fix wrong ./configure detection about eval_pv()
|
|
# in include/net-snmp/net-snmp-config.h
|
|
patch include/net-snmp/net-snmp-config.h $SRC/eval_pv_detection.fix
|
|
|
|
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 \
|
|
\) \
|
|
-o -name *.ix \
|
|
| xargs rm
|
|
# ... less common ones and empty directories
|
|
rm -rf \
|
|
$PKG/usr/lib/perl5/site_perl/5.8.?/linux/Bundle \
|
|
$PKG/usr/lib/perl5/5.8.? \
|
|
$PKG/usr/lib/perl5/site_perl/5.8.?/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
|
|
}
|