blob: e08bf7938e41dd331aaf66b666575b86d07f3dfe (
plain)
1 # Description: SNMP daemon and client tools
2 # URL: http://net-snmp.sourceforge.net/
3 # Maintainer: Mikhail Kolesnik, mike at openbunker dot org
4 # Packager: Oleksiy V. Khilkevich, centericq at ukr dot net
5 # Depends on: perl lm_sensors
6
7 name=net-snmp
8 version=5.4.1
9 release=3
10 source=(http://dl.sourceforge.net/sourceforge/$name/$name-$version.tar.gz \
11 snmpd snmpd.conf net-snmp-5.4.1-sensors3.patch)
12
13 build() {
14 cd $name-$version
15 patch -p0 -i $SRC/net-snmp-5.4.1-sensors3.patch
16 ./configure --prefix=/usr \
17 --sysconfdir=/etc \
18 --enable-shared \
19 --enable-embedded-perl \
20 --with-perl-modules \
21 --without-rpm \
22 --with-openssl \
23 --with-libwrap \
24 --with-zlib \
25 --with-mib-modules="ucd-snmp/lmsensorsMib smux agentx ucd-snmp/diskio" \
26 --with-sys-location="Unknown" \
27 --with-sys-contact="root@localhost" \
28 --with-default-snmp-version="3" \
29 --with-logfile=/var/log/snmp/snmpd.log \
30 --with-persistent-directory=/var/lib/snmp \
31 --with-ldflags="-lsensors"
32 make
33 make install INSTALL_PREFIX=$PKG DESTDIR=$PKG
34
35 # Clean up perl stuff: clean common junks first, ...
36 find $PKG/usr/lib/perl5 -name .packlist \
37 -o -name perllocal.pod \
38 -o \( \
39 -name *.bs -a -empty \
40 \) \
41 | xargs rm
42 # ... less common ones and empty directories
43 rm -rf \
44 $PKG/usr/lib/perl5/site_perl/5.8.?/linux/Bundle \
45 $PKG/usr/lib/perl5/5.8.? \
46 $PKG/usr/lib/perl5/site_perl/5.8.?/linux/auto/Bundle
47 rm $PKG/usr/include/net-snmp/library/README
48
49 mkdir -p $PKG/var/{lib,run,log}/snmp
50 touch $PKG/var/log/snmp/snmpd.log
51
52 # Can not decide whether to install this dummy files to allow correct
53 # cleanup on package removal or not. (snmpd creates them)
54 #touch $PKG/var/lib/snmpd.conf
55 #touch $PKG/usr/share/snmp/mibs/.index
56
57 chown -R daemon:daemon $PKG/var/{lib,run,log}/snmp
58
59 # Seems to be an overkill, install a very basic config instead
60 #install -D -m 644 EXAMPLE.conf $PKG/etc/snmp/snmpd.conf.sample
61 install -D -m 644 $SRC/snmpd.conf $PKG/etc/snmp/snmpd.conf
62 install -D -m 755 $SRC/snmpd $PKG/etc/rc.d/snmpd
63 }
|