Commit 69389f2e authored by Natanael Copa's avatar Natanael Copa

main/net-snmp: misc fixes and reorganize

- use perl vendor dir instead of /usr/local
- fix parallel build issue with man aliases
- split -libs -agent-libs -perl and -gui subpackages
parent 8f2b9bbd
......@@ -2,7 +2,7 @@
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=net-snmp
pkgver=5.7.1
pkgrel=2
pkgrel=3
pkgdesc="Simple Network Management Protocol"
url="http://www.net-snmp.org/"
arch="all"
......@@ -10,7 +10,8 @@ license="GPL"
depends=
depends_dev="openssl-dev"
makedepends="perl-dev openssl-dev"
subpackages="$pkgname-doc $pkgname-dev $pkgname-tools"
subpackages="$pkgname-doc $pkgname-dev $pkgname-libs $pkgname-agent-libs:alibs
$pkgname-perl:pl $pkgname-gui $pkgname-tools"
source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
netsnmp-arp-netlink-fix.patch
netsnmp-swinst-crash.patch
......@@ -62,16 +63,28 @@ build() {
--enable-ipv6 \
--enable-shared \
--enable-as-needed \
--with-perl-modules="INSTALLDIRS=vendor" \
--disable-embedded-perl
# embedded-perl seems to create TEXTREL's
# work around parallell build issue
make sedscript && make -j1 -C man || return 1
make || return 1
}
package() {
cd "$_builddir"
make -j1 DESTDIR="$pkgdir" install || return 1
# remove things we dont want distribute
rm "$pkgdir"/usr/lib/*.la || return 1
rm "$pkgdir"/usr/lib/libsnmp* \
"$pkgdir"/usr/bin/snmpcheck \
"$pkgdir"/usr/bin/fixproc \
"$pkgdir"/usr/share/man/man1/fixproc* \
"$pkgdir"/usr/bin/ipf-mod.pl \
"$pkgdir"/usr/bin/snmpinform \
|| return 1
ln -s snmptrap "$pkgdir"/usr/bin/snmpinform || return 1
install -m755 -D "$srcdir"/snmpd.initd "$pkgdir"/etc/init.d/snmpd
install -m644 -D "$srcdir"/snmpd.confd "$pkgdir"/etc/conf.d/snmpd
......@@ -82,7 +95,55 @@ package() {
find "$pkgdir" -name perllocal.pod -delete
}
libs() {
pkgdesc="The NET-SNMP runtime client libraries"
replaces="net-snmp"
mkdir -p "$subpkgdir"/usr/lib "$subpkgdir"/usr/share/snmp || return 1
mv "$pkgdir"/usr/lib/libnetsnmp.so.* "$subpkgdir"/usr/lib/ || return 1
mv "$pkgdir"/usr/share/snmp/mibs "$subpkgdir"/usr/share/snmp/ \
|| return 1
}
alibs() {
pkgdesc="The NET-SNMP runtime agent libraries"
replaces="net-snmp"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libnetsnmpagent*.so.* \
"$pkgdir"/usr/lib/libnetsnmphelpers*.so.* \
"$pkgdir"/usr/lib/libnetsnmpmibs*.so.* \
"$pkgdir"/usr/lib/libnetsnmptrapd*.so.* \
"$subpkgdir"/usr/lib/
}
pl() {
pkgdesc="The perl NET-SNMP module and the mib2c tool"
replaces="net-snmp"
mkdir -p "$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin \
"$subpkgdir"/usr/share/snmp
mv "$pkgdir"/usr/bin/mib2c-update \
"$pkgdir"/usr/bin/mib2c \
"$pkgdir"/usr/bin/snmp-bridge-mib \
"$pkgdir"/usr/bin/net-snmp-cert \
"$pkgdir"/usr/bin/traptoemail \
"$subpkgdir"/usr/bin/ || return 1
mv "$pkgdir"/usr/lib/perl* "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/share/snmp/mib2c* \
"$pkgdir"/usr/share/snmp/*.pl \
"$subpkgdir"/usr/share/snmp/
}
gui() {
pkgdesc="An interactive graphical MIB browser for SNMP"
depends="perl-net-snmp" # needs perl-tk too...
replaces="net-snmp-tools"
mkdir -p "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/tkmib "$subpkgdir"/usr/bin/
}
tools() {
pkgdesc="Network management utilities using SNMP"
mkdir -p "$subpkgdir"/usr
mv "$pkgdir"/usr/bin "$subpkgdir"/usr
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment